com.ibm.portal.resolver.service
Interface PortletPocServiceHome
- All Superinterfaces:
- PortletService
public interface PortletPocServiceHome
- extends PortletService
Portlet service which allows for creating POC URLs that cannot be created via
the JSR 168 API.
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 JNDI_NAME.
Coding example for accessing the POC service from within a JSR168 portlet:
PortletServiceHome psh;
javax.naming.Context ctx = new javax.naming.InitialContext();
try {
psh = (PortletServiceHome)
ctx.lookup("portletservice/com.ibm.portal.resolver.service.PortletPocServiceHome");
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
// use the service
PortletPocServiceHome service = (PortletPocServiceHome) psh.getPortletService(PortletPocServiceHome.class);
// get the POC service for the current request
PocService pocSvc = service.getPortletPocService(request, response);
// create URLs etc.
...
// dispose the poc service as we do not need it any longer
pocSvc.dispose();
The returned PortletServiceHome object is valid for the lifetime of
the portal. It is recommended to perform the JNDI lookup in the
javax.portlet.Portlet#init(PortletConfig) method of the portlet and
store the PortletServiceHome object
home in an instance variable. That also applies to the actual
PortletPocServiceHome.
Note that it is not permitted to access references to the PocService
longer than one request. These objects must be retrieved from the
PortletServiceHome object whenever they are used in another request.
Also note that the PortletServiceHome is 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
Disposable.dispose() method must be invoked.
- Since:
- 6.0.1
Field Summary |
static java.lang.String
| JNDI_NAME
Name that can be used for the JNDI lookup of this service
|
JNDI_NAME
static final java.lang.String JNDI_NAME
- Name that can be used for the JNDI lookup of this service
getPortletPocService
PortletPocService getPortletPocService(PortletRequest request,
PortletResponse response)
throws StateManagerException
- Get a portlet POC service for the current request and response.
- Parameters:
- request - The current portlet request. Must not be
null
.- response - The current portlet response. Must not be
null
.
- Returns:
- A poc service for accessing POC related functionality
- Throws:
- StateManagerException - thrown if the initialization of the
PortletPocService fails.