org.apache.pluto.core
Class PortletContainerImpl

java.lang.Object
  extended by org.apache.pluto.core.PortletContainerImpl
All Implemented Interfaces:
EventContainer, PortletContainer

public class PortletContainerImpl
extends java.lang.Object
implements PortletContainer, EventContainer

Default Pluto Container implementation.

Since:
Sep 18, 2004
Version:
1.0

Constructor Summary
PortletContainerImpl(java.lang.String name, RequiredContainerServices requiredServices, OptionalContainerServices optionalServices)
          Default Constructor.
 
Method Summary
 void destroy()
          Destroy this container.
 void doAction(PortletWindow portletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process action for the portlet associated with the given portlet window.
 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 portletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Loads the portlet associated with the specified portlet window.
 void doRender(PortletWindow portletWindow, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Renders the portlet associated with the specified portlet window.
 void doServeResource(PortletWindow portletWindow, 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.
 void fireEvent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PortletWindow window, Event event)
          Fire Event for the portlet associated with the given portlet window and eventName
 java.lang.String getName()
          Retrieve the unique container name
 OptionalContainerServices getOptionalContainerServices()
          Retrieve the optional container services used by the container.
 PortletAppDD getPortletApplicationDescriptor(java.lang.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)
          Initialize the container for use within the given configuration scope.
 boolean isInitialized()
          Determine whether this container has been initialized or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletContainerImpl

public PortletContainerImpl(java.lang.String name,
                            RequiredContainerServices requiredServices,
                            OptionalContainerServices optionalServices)
Default Constructor. Create a container implementation whith the given name and given services.

Parameters:
name - the name of the container.
requiredServices - the required container services implementation.
optionalServices - the optional container services implementation.
Method Detail

init

public void init(javax.servlet.ServletContext servletContext)
          throws PortletContainerException
Initialize the container for use within the given configuration scope.

Specified by:
init in interface PortletContainer
Parameters:
servletContext - the servlet context of the portal webapp.
Throws:
PortletContainerException - if an error occurs.

isInitialized

public boolean isInitialized()
Determine whether this container has been initialized or not.

Specified by:
isInitialized in interface PortletContainer
Returns:
true if the container has been initialized.

destroy

public void destroy()
Destroy this container.

Specified by:
destroy in interface PortletContainer

doRender

public void doRender(PortletWindow portletWindow,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws PortletException,
                     java.io.IOException,
                     PortletContainerException
Renders the portlet associated with the specified portlet window.

Specified by:
doRender in interface PortletContainer
Parameters:
portletWindow - the portlet window.
request - the servlet request.
response - the servlet response.
Throws:
java.lang.IllegalStateException - if the container is not initialized.
PortletException
java.io.IOException
PortletContainerException
See Also:
Portlet.render(RenderRequest, RenderResponse)

doServeResource

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

Specified by:
doServeResource in interface PortletContainer
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
java.io.IOException

doAction

public void doAction(PortletWindow portletWindow,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws PortletException,
                     java.io.IOException,
                     PortletContainerException
Process action for the portlet associated with the given portlet window.

Specified by:
doAction in interface PortletContainer
Parameters:
portletWindow - the portlet window.
request - the servlet request.
response - the servlet response.
Throws:
PortletException
java.io.IOException
PortletContainerException
See Also:
Portlet.processAction(ActionRequest, ActionResponse)

doLoad

public void doLoad(PortletWindow portletWindow,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws PortletException,
                   java.io.IOException,
                   PortletContainerException
Loads the portlet associated with the specified portlet window.

Specified by:
doLoad in interface PortletContainer
Parameters:
portletWindow - the portlet window.
request - the servlet request.
response - the servlet response.
Throws:
PortletException
java.io.IOException
PortletContainerException

doAdmin

public void doAdmin(PortletWindow portletWindow,
                    javax.servlet.http.HttpServletRequest servletRequest,
                    javax.servlet.http.HttpServletResponse servletResponse)
             throws PortletException,
                    java.io.IOException,
                    PortletContainerException
Description copied from interface: PortletContainer
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.

Specified by:
doAdmin in interface PortletContainer
Parameters:
portletWindow - the portlet window
servletRequest - the servlet request
servletResponse - the servlet response
Throws:
PortletContainerException - if the request can not be fullfilled.
PortletException
java.io.IOException

getName

public java.lang.String getName()
Description copied from interface: PortletContainer
Retrieve the unique container name

Specified by:
getName in interface PortletContainer
Returns:
the container name.

getRequiredContainerServices

public RequiredContainerServices getRequiredContainerServices()
Description copied from interface: PortletContainer
Retreive the required container services associated with this container.

Specified by:
getRequiredContainerServices in interface PortletContainer
Returns:
the required container services associated with this container.

getOptionalContainerServices

public OptionalContainerServices getOptionalContainerServices()
Retrieve the optional container services used by the container. If no implementation was provided during construction, the default instance will be returned.

Specified by:
getOptionalContainerServices in interface PortletContainer
Returns:
services used by the container.

getPortletApplicationDescriptor

public PortletAppDD getPortletApplicationDescriptor(java.lang.String context)
                                             throws PortletContainerException
Description copied from interface: PortletContainer
Retrieve the PortletAppDD for the portlet located at the supplied context. Must not return null.

Specified by:
getPortletApplicationDescriptor in interface PortletContainer
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

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface EventContainer
Specified by:
getServletContext in interface PortletContainer

fireEvent

public void fireEvent(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      PortletWindow window,
                      Event event)
               throws PortletException,
                      java.io.IOException
Fire Event for the portlet associated with the given portlet window and eventName

Specified by:
fireEvent in interface EventContainer
Parameters:
portletWindow - the portlet window.
request - the servlet request.
response - the servlet response.
eventName - the event name
Throws:
PortletException
java.io.IOException
PortletContainerException
See Also:
javax.portlet.EventPortlet#processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)


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