org.apache.pluto
Interface PortletContainer

All Known Implementing Classes:
PortletContainerImpl

public interface PortletContainer

The publicized entry point into Pluto. The base functionality of the portlet container can be enhanced or even modified by PortletContainerServices.

The methods of this class have to be called in the following order:

Version:
$Id: PortletContainer.java 36010 2004-07-30 14:16:06Z ddewolf $

MethodDescriptionConstraints
init(javax.servlet.ServletContext) Initialized the portlet container. Performed only once per container lifecycle.
doAction(org.apache.pluto.PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) Perform the action for the targeted portlet Optionally performed for a single portlet per request
doRender(org.apache.pluto.PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) Render the portlet Performed once for each portlet per request.
destroy() Destroy and remove container from service. Performed only once per container lifecylce
Method Summary
 void destroy()
          Shuts down the container.
 void doAction(PortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Indicates that a portlet action occured in the current request and calls the processAction method of this portlet.
 void doAdmin(PortletWindow portletWindow, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Indicates that the portal needs to perform administrative actions upon the portlet and/or portlet application.
 void doLoad(PortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Indicates that the portlet must be initialized
 void doRender(PortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls the render method of the given portlet window.
 void doServeResource(PortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Indicates that a portlet resource Serving occured in the current request and calls the processServeResource method of this portlet.
 String getName()
          Retrieve the unique container name
 OptionalContainerServices getOptionalContainerServices()
          Retrieve the optional container services associated with this contianer.
 PortletAppDD getPortletApplicationDescriptor(String context)
          Retrieve the PortletAppDD for the portlet located at the supplied context.
 RequiredContainerServices getRequiredContainerServices()
          Retreive the required container services associated with this container.
 javax.servlet.ServletContext getServletContext()
           
 void init(javax.servlet.ServletContext servletContext)
          Initializes the container for use within the given servlet context.
 boolean isInitialized()
          Returns whether the container is already initialized or not.
 

Method Detail

init

void init(javax.servlet.ServletContext servletContext)
          throws PortletContainerException
Initializes the container for use within the given servlet context.

Parameters:
servletContext - the servlet context.
Throws:
PortletContainerException - if an error occurs.

destroy

void destroy()
             throws PortletContainerException
Shuts down the container. After calling this method it is no longer valid to call any method on the portlet container.

Throws:
PortletContainerException - if an error occurs while shutting down the container

doRender

void doRender(PortletWindow internalPortletWindow,
              javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
              throws PortletException,
                     IOException,
                     PortletContainerException
Calls the render method of the given portlet window.

Parameters:
internalPortletWindow - the portlet Window
request - the servlet request
response - the servlet response
Throws:
PortletException - if one portlet has trouble fulfilling the request
IOException - if the streaming causes an I/O problem
PortletContainerException - if the portlet container implementation has trouble fulfilling the request

doServeResource

void doServeResource(PortletWindow internalPortletWindow,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
                     throws PortletException,
                            IOException,
                            PortletContainerException
Indicates that a portlet resource Serving occured in the current request and calls the processServeResource method of this portlet.

Parameters:
internalPortletWindow - the portlet Window
request - the servlet request
response - the servlet response
Throws:
PortletException - if one portlet has trouble fulfilling the request
PortletContainerException - if the portlet container implementation has trouble fulfilling the request
IOException

doAction

void doAction(PortletWindow internalPortletWindow,
              javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
              throws PortletException,
                     IOException,
                     PortletContainerException
Indicates that a portlet action occured in the current request and calls the processAction method of this portlet.

Parameters:
internalPortletWindow - the portlet Window
request - the servlet request
response - the servlet response
Throws:
PortletException - if one portlet has trouble fulfilling the request
PortletContainerException - if the portlet container implementation has trouble fulfilling the request
IOException

doLoad

void doLoad(PortletWindow internalPortletWindow,
            javax.servlet.http.HttpServletRequest servletRequest,
            javax.servlet.http.HttpServletResponse servletResponse)
            throws PortletException,
                   IOException,
                   PortletContainerException
Indicates that the portlet must be initialized

Parameters:
internalPortletWindow - the portlet Window
servletRequest - the servlet request
servletResponse - the servlet response
Throws:
PortletException - if one portlet has trouble fulfilling the request
PortletContainerException - if the portlet container implementation has trouble fulfilling the request
IOException

doAdmin

void doAdmin(PortletWindow portletWindow,
             javax.servlet.http.HttpServletRequest servletRequest,
             javax.servlet.http.HttpServletResponse servletResponse)
             throws PortletException,
                    IOException,
                    PortletContainerException
Indicates that the portal needs to perform administrative actions upon the portlet and/or portlet application. An administrative request will be spawned and any registered handlers invoked.

Parameters:
portletWindow - the portlet window
servletRequest - the servlet request
servletResponse - the servlet response
Throws:
PortletContainerException - if the request can not be fullfilled.
PortletException
IOException

isInitialized

boolean isInitialized()
Returns whether the container is already initialized or not.

Returns:
true if the container is initialized

getName

String getName()
Retrieve the unique container name

Returns:
the container name.

getRequiredContainerServices

RequiredContainerServices getRequiredContainerServices()
Retreive the required container services associated with this container.

Returns:
the required container services associated with this container.

getOptionalContainerServices

OptionalContainerServices getOptionalContainerServices()
Retrieve the optional container services associated with this contianer.

Returns:
the container services provided by either the portal or the defaults.

getPortletApplicationDescriptor

PortletAppDD getPortletApplicationDescriptor(String context)
                                             throws PortletContainerException
Retrieve the PortletAppDD for the portlet located at the supplied context. Must not return null.

Parameters:
context - the context of the portlet
Returns:
the portlet application descriptor
Throws:
PortletContainerException - if the container has trouble obtaining the context of the portlet, or retrieving the PortletAppDD

getServletContext

javax.servlet.ServletContext getServletContext()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.