com.ibm.portal.state.service
Interface StateManagerService
- All Superinterfaces:
- Disposable
- All Known Subinterfaces:
- PortalStateManagerService, PortletStateManager, PortletStateManagerController
public interface StateManagerService
- extends Disposable
Service interface that allows for creating a variety of URLs. URLs can be
obtained via the URLFactory interface. To modify the
navigational state that is carried by a URL, the State Accessor SPI can be
used. The State Accessor SPI provides so-called state accessors for a variety
of state aspects (e.g. portlet-related state, page selection information,
theme template information etc.). The state accessors are each accessible via
a special accessor factory (see com.ibm.portal.state.accessors.*
packages) that can be obtained using the getAccessorFactory()
method of this service.
Note that this service interface is derived from the Disposable
interface which means that the programmer using this interface must
explicitly indicate when the service is no longer used by invoking the
offered dispose()
method. Typically the maximum lifetime of
the service is one servlet request. However, their might be implementations
that are not tied to a servlet request possibly implying a longer lifetime.
- Since:
- 6.0
getURLFactory
URLFactory getURLFactory()
throws CannotInstantiateURLFactoryException
- Provides access to the URLFactory. The
URLFactory provides various methods to create engine URLs
as well as resource URLs.
- Returns:
- A URLFactory instance. Not
null
.
- Throws:
- CannotInstantiateURLFactoryException - If the URLFactory cannot be instantiated or
initialized properly.
getAccessorFactory
<T> T getAccessorFactory(java.lang.Class<T> cls)
throws UnknownAccessorTypeException,
CannotInstantiateAccessorException
- Get a factory that provides accessors for typed access on the state
holder. There may be arbitrary accessors to custom state types, so this
interface is designed as a generic factory. The result object may be cast
to the specific type referenced by the given class object.
- Parameters:
- cls - Class object for the accessor factory type (refers to the
accessor factory interface, not to its implementation). Must
not be
null
.
- Returns:
- An instance of the requested accessor factory. You may keep a
reference to this instance for performance reasons. Not
null
.
- Throws:
- UnknownAccessorTypeException - If the class object cannot be mapped to a valid accessor
factory.
- CannotInstantiateAccessorException - If the factory type is known but cannot be instantiated.