org.apache.geronimo.jetty6
Class JettyWebAppContext

java.lang.Object
  extended by org.apache.geronimo.jetty6.JettyWebAppContext
All Implemented Interfaces:
GBeanLifecycle, JettyServletRegistration, J2EEDeployedObject, J2EEManagedObject, J2EEModule, WebModule

public class JettyWebAppContext
extends Object
implements GBeanLifecycle, JettyServletRegistration, WebModule

Wrapper for a WebApplicationContext that sets up its J2EE environment.


Nested Class Summary
 class JettyWebAppContext.StartCommand
           
 class JettyWebAppContext.StopCommand
           
 
Field Summary
static String GBEAN_ATTR_SESSION_TIMEOUT
           
static GBeanInfo GBEAN_INFO
           
static String GBEAN_REF_PRE_HANDLER_FACTORY
           
static String GBEAN_REF_SESSION_HANDLER_FACTORY
           
 
Constructor Summary
JettyWebAppContext(String objectName, String originalSpecDD, Map<String,Object> componentContext, ClassLoader classLoader, URL configurationBaseUrl, Set unshareableResources, Set applicationManagedSecurityResources, String displayName, Map contextParamMap, Collection<String> listenerClassNames, boolean distributable, Map mimeMap, String[] welcomeFiles, Map<String,String> localeEncodingMapping, Map errorPages, org.mortbay.jetty.security.Authenticator authenticator, String realmName, Map<String,String> tagLibMap, int sessionTimeoutSeconds, SessionHandlerFactory handlerFactory, PreHandlerFactory preHandlerFactory, String policyContextID, String securityRealmName, RunAsSource runAsSource, Holder holder, Host host, TransactionManager transactionManager, org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator trackedConnectionAssociator, JettyContainer jettyContainer, RuntimeCustomizer contextCustomizer, J2EEServer server, J2EEApplication application, Kernel kernel)
           
 
Method Summary
 void destroyInstance(Object o)
           
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
 String getApplication()
           
 WebContainer getContainer()
           
 String getContextPath()
           
 String getDeploymentDescriptor()
          The deploymentDescriptor string must contain the original XML deployment descriptor that was created for this module during the deployment process.
 String getDisplayName()
           
static GBeanInfo getGBeanInfo()
           
 String[] getJavaVMs()
          A list of JVMs this module is running on.
 AbstractImmutableHandler getLifecycleChain()
           
 String getObjectName()
          Gets the unique name of this object.
 String getServer()
          The J2EE server the application or module is deployed on.
 org.mortbay.jetty.servlet.ServletHandler getServletHandler()
           
 String[] getServlets()
          A list of Servlets included in this WAR
 Subject getSubjectForRole(String role)
           
 URL getWARDirectory()
           
 String getWARName()
           
 ClassLoader getWebClassLoader()
           
 boolean isEventProvider()
          Determines if this object implemnts the event provider type defined in the J2EE Management specification.
 boolean isStateManageable()
          Determines if this object implements the state manageable type defined in the J2EE Management specification.
 boolean isStatisticsProvider()
          Determines if this object implemnts the statistics provider type defined in the J2EE Management specification.
 Object newInstance(String className)
           
 void registerServletHolder(org.mortbay.jetty.servlet.ServletHolder servletHolder, String servletName, Set<String> servletMappings, String objectName)
           
 void setContextPath(String path)
           
 void setDisplayName(String displayName)
           
 void setErrorPages(Map errorPageMap)
           
 void setListenerClassNames(Collection<String> eventListeners)
           
 void setLocaleEncodingMapping(Map<String,String> localeEncodingMap)
           
 void setSessionTimeoutSeconds(int seconds)
           
 void setTagLibMap(Map<String,String> tagLibMap)
           
 void unregisterServletHolder(org.mortbay.jetty.servlet.ServletHolder servletHolder, String servletName, Set<String> servletMappings, String objectName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO

GBEAN_ATTR_SESSION_TIMEOUT

public static final String GBEAN_ATTR_SESSION_TIMEOUT
See Also:
Constant Field Values

GBEAN_REF_SESSION_HANDLER_FACTORY

public static final String GBEAN_REF_SESSION_HANDLER_FACTORY
See Also:
Constant Field Values

GBEAN_REF_PRE_HANDLER_FACTORY

public static final String GBEAN_REF_PRE_HANDLER_FACTORY
See Also:
Constant Field Values
Constructor Detail

JettyWebAppContext

public JettyWebAppContext(String objectName,
                          String originalSpecDD,
                          Map<String,Object> componentContext,
                          ClassLoader classLoader,
                          URL configurationBaseUrl,
                          Set unshareableResources,
                          Set applicationManagedSecurityResources,
                          String displayName,
                          Map contextParamMap,
                          Collection<String> listenerClassNames,
                          boolean distributable,
                          Map mimeMap,
                          String[] welcomeFiles,
                          Map<String,String> localeEncodingMapping,
                          Map errorPages,
                          org.mortbay.jetty.security.Authenticator authenticator,
                          String realmName,
                          Map<String,String> tagLibMap,
                          int sessionTimeoutSeconds,
                          SessionHandlerFactory handlerFactory,
                          PreHandlerFactory preHandlerFactory,
                          String policyContextID,
                          String securityRealmName,
                          RunAsSource runAsSource,
                          Holder holder,
                          Host host,
                          TransactionManager transactionManager,
                          org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator trackedConnectionAssociator,
                          JettyContainer jettyContainer,
                          RuntimeCustomizer contextCustomizer,
                          J2EEServer server,
                          J2EEApplication application,
                          Kernel kernel)
                   throws Exception
Throws:
Exception
Method Detail

getObjectName

public String getObjectName()
Description copied from interface: J2EEManagedObject
Gets the unique name of this object. The object name must comply with the ObjectName specification in the JMX specification and the restrictions in the J2EEManagementInterface.

Specified by:
getObjectName in interface J2EEManagedObject
Returns:
the unique name of this object within the server

isStateManageable

public boolean isStateManageable()
Description copied from interface: J2EEManagedObject
Determines if this object implements the state manageable type defined in the J2EE Management specification.

Specified by:
isStateManageable in interface J2EEManagedObject
Returns:
true if this class also implements the state manageable type; false otherwise

isStatisticsProvider

public boolean isStatisticsProvider()
Description copied from interface: J2EEManagedObject
Determines if this object implemnts the statistics provider type defined in the J2EE Management specification.

Specified by:
isStatisticsProvider in interface J2EEManagedObject
Returns:
true if this class also implements the statistics provider type; false otherwise

isEventProvider

public boolean isEventProvider()
Description copied from interface: J2EEManagedObject
Determines if this object implemnts the event provider type defined in the J2EE Management specification.

Specified by:
isEventProvider in interface J2EEManagedObject
Returns:
true if this class also implements the event manageable type; false otherwise

getWARDirectory

public URL getWARDirectory()

getWARName

public String getWARName()

getContainer

public WebContainer getContainer()

setContextPath

public void setContextPath(String path)

getContextPath

public String getContextPath()

getWebClassLoader

public ClassLoader getWebClassLoader()
Specified by:
getWebClassLoader in interface JettyServletRegistration

getLifecycleChain

public AbstractImmutableHandler getLifecycleChain()
Specified by:
getLifecycleChain in interface JettyServletRegistration

getSubjectForRole

public Subject getSubjectForRole(String role)
                          throws LoginException
Specified by:
getSubjectForRole in interface JettyServletRegistration
Throws:
LoginException

newInstance

public Object newInstance(String className)
                   throws InstantiationException,
                          IllegalAccessException
Specified by:
newInstance in interface JettyServletRegistration
Throws:
InstantiationException
IllegalAccessException

destroyInstance

public void destroyInstance(Object o)
                     throws Exception
Specified by:
destroyInstance in interface JettyServletRegistration
Throws:
Exception

doStart

public void doStart()
             throws Exception
Description copied from interface: GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface GBeanLifecycle
Throws:
Exception - if the target failed to start; this will cause a transition to the failed state

doStop

public void doStop()
            throws Exception
Description copied from interface: GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface GBeanLifecycle
Throws:
Exception - if the target failed to stop; this will cause a transition to the failed state

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle

setLocaleEncodingMapping

public void setLocaleEncodingMapping(Map<String,String> localeEncodingMap)

setListenerClassNames

public void setListenerClassNames(Collection<String> eventListeners)
                           throws ClassNotFoundException,
                                  IllegalAccessException,
                                  InstantiationException
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException

setErrorPages

public void setErrorPages(Map errorPageMap)

setTagLibMap

public void setTagLibMap(Map<String,String> tagLibMap)

setSessionTimeoutSeconds

public void setSessionTimeoutSeconds(int seconds)

getDisplayName

public String getDisplayName()

setDisplayName

public void setDisplayName(String displayName)

getDeploymentDescriptor

public String getDeploymentDescriptor()
Description copied from interface: J2EEDeployedObject
The deploymentDescriptor string must contain the original XML deployment descriptor that was created for this module during the deployment process.

Specified by:
getDeploymentDescriptor in interface J2EEDeployedObject
Returns:
this module's deployment descriptor
See Also:
"JSR77.3.5.0.1"

getServer

public String getServer()
Description copied from interface: J2EEDeployedObject
The J2EE server the application or module is deployed on.

Specified by:
getServer in interface J2EEDeployedObject
Returns:
the server this module is deployed on
See Also:
"JSR77.3.5.0.2"

getApplication

public String getApplication()

getJavaVMs

public String[] getJavaVMs()
Description copied from interface: J2EEModule
A list of JVMs this module is running on. Each JVM listed here must be present in the owning J2EEServer's list of JVMs.

Specified by:
getJavaVMs in interface J2EEModule
Returns:
the ObjectNames of the JVMs the module is running on
See Also:
"JSR77.3.7.1.1"

getServlets

public String[] getServlets()
Description copied from interface: WebModule
A list of Servlets included in this WAR

Specified by:
getServlets in interface WebModule
Returns:
the ObjectNames of the Servlets in this WAR
See Also:
"JSR77.3.16.1.1"

getServletHandler

public org.mortbay.jetty.servlet.ServletHandler getServletHandler()
Specified by:
getServletHandler in interface JettyServletRegistration

registerServletHolder

public void registerServletHolder(org.mortbay.jetty.servlet.ServletHolder servletHolder,
                                  String servletName,
                                  Set<String> servletMappings,
                                  String objectName)
                           throws Exception
Specified by:
registerServletHolder in interface JettyServletRegistration
Throws:
Exception

unregisterServletHolder

public void unregisterServletHolder(org.mortbay.jetty.servlet.ServletHolder servletHolder,
                                    String servletName,
                                    Set<String> servletMappings,
                                    String objectName)
                             throws Exception
Specified by:
unregisterServletHolder in interface JettyServletRegistration
Throws:
Exception

getGBeanInfo

public static GBeanInfo getGBeanInfo()


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