|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Portlet interface is used by the portlet container to invoke the portlet. Every portlet has to derive directly or indirectly from this interface.
A portlet is a small Java program that runs withing a portal server. Portlets receive and respond to requests from the portal container. As part of running within the portal server each portal has a life-cycle. The corresponding methods are called in the following sequence:
In addition to the life-cycle methods, this interface provides the getPortletConfig() method which allows the portlet can use to get any startup information, and the getServletInfo() method which allows the portlet to return basic information about itself, such as author, version, and copyright.
PortletConfig
Method Summary | |
void |
destroy()
Called by the portlet container to indicate to this portlet that it is being taken out of service. |
PortletConfig |
getPortletConfig()
Returns the configuration of this portlet. |
java.lang.String |
getPortletInfo()
Returns information about the servlet, such as author, version, and copyright. |
void |
init(PortletConfig aConfig)
Called by the portlet container to indicate to this portlet that it is being placed into service. |
void |
service(PortletRequest aRequest,
PortletResponse aResponse)
The service method is called by the framework to ask this portlet to render its content using the given context. |
Method Detail |
public java.lang.String getPortletInfo()
The string that this method returns should be plain text and not markup of any kind (such as HTML, XML, etc.).
public PortletConfig getPortletConfig()
public void init(PortletConfig aConfig) throws PortletException
The portlet container calls the init() method exactly once after instantiating the portlet. The init() method must complete successfully before the servlet can receive any requests.
The portlet container cannot place the portlet into service if the init() method
aConfig
- the portlet configuration containing the portlet's configuration
and initialization parametersPortletConfig.getPortletContext()
public void destroy()
This method gives the portlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the portlet's current state in memory.
public void service(PortletRequest aRequest, PortletResponse aResponse) throws PortletException, java.io.IOException
The context is the portlet's view of the framework. All that is required to perform the rendering of the content is accessible through the context.
Please note that every portlet gets passed a different context.
aRequest
- the requestaResponse
- the respnse
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |