|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletStateManagerService
Portlet service which allows for creating URLs that cannot be created via the
JSR 168 API. This service also provides access to the current state of the
portlet window calling this service.
The portlet service is accessed by a JNDI lookup; the lookup returns an
implementation of this interface, which allows to get the actual portlet
service under the JNDI name
"portletservice/com.ibm.portal.state.service.PortletStateManagerService".
Coding example for accessing the state manager from within a standard portlet:
PortletServiceHome psh; javax.naming.Context ctx = new javax.naming.InitialContext(); try { psh = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.state.service.PortletStateManagerService"); } catch(javax.naming.NameNotFoundException ex) { ... error handling ... } ... // use the service PortletStateManagerService service = (PortletStateManagerService) psh.getPortletService(PortletStateManagerService.class); // get the portlet state manager for the current request PortletStateManager manager = service.getPortletStateManager(request, response); // create URLs etc. ... // dispose the portlet state manager as we do not need it any longer manager.dispose();The returned
PortletServiceHome
object is valid for the
lifetime of the portal. It is recommended to perform the JNDI lookup in the
init
method of the portlet and store the
PortletServiceHome
object home in an instance variable. That
also applies to the actual PortletStateManagerService
.PortletStateManager
or
PortletStateManagerController
longer than one request. These
objects must be retrieved from the PortletStateManagerService
object whenever they are used in another request. Also note that the
PortletStateManager
as well as the
PortletStateManagerController
are derived fron the
Disposable
interface, i.e. whenever these objects are not
needed any longer (at the end of a request at the latest) their dispose()
method must be invoked.
Field Summary | |
---|---|
static java.lang.String |
JNDI_NAME
the JNDI name for this service |
Method Summary | |
---|---|
PortletStateManager |
getPortletStateManager(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response)
Get a portlet state manager for the current request and response. |
PortletStateManagerController |
getPortletStateManagerController(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
Get a portlet state manager for the current request. |
PortletStateManagerController |
getPortletStateManagerController(javax.portlet.EventRequest request,
javax.portlet.EventResponse response)
Get a portlet state manager for the current request. |
Methods inherited from interface com.ibm.portal.state.accessors.AccessorFactory |
---|
compact |
Field Detail |
---|
static final java.lang.String JNDI_NAME
Method Detail |
---|
PortletStateManager getPortletStateManager(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) throws StateManagerException
request
- The current portlet request. Must not be null
.response
- The current portlet response. Must not be null
.
StateManagerException
- thrown if the initialization of the
PortletStateManager
fails.PortletStateManagerController getPortletStateManagerController(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) throws StateManagerException
request
- The current portlet action request. Must not be
null
.response
- The current portlet action response. Must not be
null
.
StateManagerException
- thrown if the initialization of the
PortletStateManagerController
fails.PortletStateManagerController getPortletStateManagerController(javax.portlet.EventRequest request, javax.portlet.EventResponse response) throws StateManagerException
request
- The current portlet event request. Must not be
null
.response
- The current portlet event response. Must not be
null
.
StateManagerException
- thrown if the initialization of the
PortletStateManagerController
fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |