org.apache.pluto.core
Class PortletContextManager

java.lang.Object
  extended by org.apache.pluto.core.PortletContextManager
All Implemented Interfaces:
PortletRegistryService

public class PortletContextManager
extends Object
implements PortletRegistryService

Manager used to cache the portlet configurations which have been previously parsed.

Since:
Sep 20, 2004
Version:
1.0

Method Summary
 void addPortletRegistryListener(PortletRegistryListener listener)
          Add a listener which will recieve notifications of newly registered applications.
protected static String computeContextPath(javax.servlet.ServletContext context)
           
protected static String getContextPath(javax.servlet.ServletContext context)
           
static PortletContextManager getManager()
          Returns the singleton manager instance.
 PortletAppDD getPortletApplicationDescriptor(String applicationId)
          Retrieve the portlet descriptor for the specified portlet application.
 PortletConfig getPortletConfig(String applicationId, String portletName)
          Retrieve the portlet configuration for the specified portlet
static javax.servlet.ServletContext getPortletContext(javax.servlet.ServletContext portalContext, String portletContextPath)
           
 PortletContext getPortletContext(String applicationId)
          Retrieve the PortletContext for the specified applicationId
 PortletDD getPortletDescriptor(String applicationId, String portletName)
          Retreive the portlet descriptor for the given portlet.
 Iterator getRegisteredPortletApplicationIds()
          Retrieve the ids of all registered applications.
 Iterator getRegisteredPortletApplications()
          Retrieve an iterator of all PortletContext instances which exist within this application.
 String register(javax.servlet.ServletConfig config)
          Retrieves the PortletContext associated with the given ServletContext.
 InternalPortletContext register(javax.servlet.ServletContext servletContext)
          Deprecated. Use register(ServletConfig)
 void remove(InternalPortletContext context)
           
 void removePortletRegistryListener(PortletRegistryListener listener)
          Remove a previously registered listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static PortletContextManager getManager()
Returns the singleton manager instance.

Returns:
the singleton manager instance.

register

public String register(javax.servlet.ServletConfig config)
                throws PortletContainerException
Retrieves the PortletContext associated with the given ServletContext. If one does not exist, it is created.

Parameters:
config - the servlet config.
Returns:
the InternalPortletContext associated with the ServletContext.
Throws:
PortletContainerException

register

public InternalPortletContext register(javax.servlet.ServletContext servletContext)
                                throws PortletContainerException
Deprecated. Use register(ServletConfig)

Parameters:
servletContext -
Returns:
Throws:
PortletContainerException

remove

public void remove(InternalPortletContext context)

getRegisteredPortletApplicationIds

public Iterator getRegisteredPortletApplicationIds()
Description copied from interface: PortletRegistryService
Retrieve the ids of all registered applications. This list will only contain those applications which have been registered with the container. Others may or may not be available within the servers.

Specified by:
getRegisteredPortletApplicationIds in interface PortletRegistryService
Returns:
iterator of all ids (strings).

getRegisteredPortletApplications

public Iterator getRegisteredPortletApplications()
Retrieve an iterator of all PortletContext instances which exist within this application.

Specified by:
getRegisteredPortletApplications in interface PortletRegistryService
Returns:

getPortletContext

public PortletContext getPortletContext(String applicationId)
                                 throws PortletContainerException
Description copied from interface: PortletRegistryService
Retrieve the PortletContext for the specified applicationId

Specified by:
getPortletContext in interface PortletRegistryService
Parameters:
applicationId - context identifier
Returns:
portlet context
Throws:
PortletContainerException - if internal error occurs

getPortletConfig

public PortletConfig getPortletConfig(String applicationId,
                                      String portletName)
Description copied from interface: PortletRegistryService
Retrieve the portlet configuration for the specified portlet

Specified by:
getPortletConfig in interface PortletRegistryService
Parameters:
applicationId - context identifier
portletName - portlet name
Returns:
portletconfig

getPortletDescriptor

public PortletDD getPortletDescriptor(String applicationId,
                                      String portletName)
Description copied from interface: PortletRegistryService
Retreive the portlet descriptor for the given portlet.

Specified by:
getPortletDescriptor in interface PortletRegistryService
Parameters:
applicationId - context identifier
portletName - portlet name
Returns:
descriptor

getPortletApplicationDescriptor

public PortletAppDD getPortletApplicationDescriptor(String applicationId)
                                             throws PortletContainerException
Description copied from interface: PortletRegistryService
Retrieve the portlet descriptor for the specified portlet application. If the name does not match the name of a contextPath registered with the container the portlet application name must be checked.

Specified by:
getPortletApplicationDescriptor in interface PortletRegistryService
Parameters:
applicationId - the name of the portlet application.
Returns:
the named portlet application descriptor.
Throws:
PortletContainerException - if the descriptor can not be found or if the portlet.xml can not be parsed.

addPortletRegistryListener

public void addPortletRegistryListener(PortletRegistryListener listener)
Description copied from interface: PortletRegistryService
Add a listener which will recieve notifications of newly registered applications.

Specified by:
addPortletRegistryListener in interface PortletRegistryService
Parameters:
listener - the listener to add

removePortletRegistryListener

public void removePortletRegistryListener(PortletRegistryListener listener)
Description copied from interface: PortletRegistryService
Remove a previously registered listener.

Specified by:
removePortletRegistryListener in interface PortletRegistryService
Parameters:
listener - the listener to remove

getPortletContext

public static javax.servlet.ServletContext getPortletContext(javax.servlet.ServletContext portalContext,
                                                             String portletContextPath)

getContextPath

protected static String getContextPath(javax.servlet.ServletContext context)

computeContextPath

protected static String computeContextPath(javax.servlet.ServletContext context)


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