org.objectweb.jonas.web.catalina55
Class JOnASStandardContext

java.lang.Object
  extended by org.apache.catalina.core.ContainerBase
      extended by org.apache.catalina.core.StandardContext
          extended by org.objectweb.jonas.web.catalina55.JOnASStandardContext
All Implemented Interfaces:
java.io.Serializable, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.apache.catalina.Container, org.apache.catalina.Context, org.apache.catalina.Lifecycle, org.apache.catalina.Pipeline

public final class JOnASStandardContext
extends org.apache.catalina.core.StandardContext

Define a JOnAS context. It is used to check if a context has been defined in server.xml and to use this context while deploying the war instead of creating a new one

Author:
Florent Benoit, Philippe Coq (Tomcat 4.0)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
org.apache.catalina.core.ContainerBase.ContainerBackgroundProcessor, org.apache.catalina.core.ContainerBase.PrivilegedAddChild
 
Field Summary
 
Fields inherited from class org.apache.catalina.core.StandardContext
allowLinking, cacheMaxSize, cacheTTL, caseSensitive, context, urlEncoder
 
Fields inherited from class org.apache.catalina.core.ContainerBase
backgroundProcessorDelay, children, cluster, controller, domain, initialized, lifecycle, listeners, loader, logName, manager, mserver, name, oname, parent, parentClassLoader, pipeline, realm, resources, sm, started, suffix, support, type
 
Fields inherited from interface org.apache.catalina.Context
RELOAD_EVENT
 
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
JOnASStandardContext()
          Constructor of the Context
JOnASStandardContext(boolean inServerXml, boolean java2DelegationModel, boolean inEarCase)
          Constructor of the Context
 
Method Summary
 void addEnvironment(org.apache.catalina.deploy.ContextEnvironment environment)
          Add an environment entry for this web application.
 void addResource(org.apache.catalina.deploy.ContextResource resource)
          Add a resource reference for this web application.
 java.lang.String getEarON()
           
 java.net.URL getEarURL()
           
 java.lang.String getJonasDeploymentDescriptor()
          Gets the deployment descriptor content of jonas-web.xml file
 java.net.URL getWarURL()
           
 boolean isInEarCase()
           
 boolean isInServerXml()
          This context was defined in server.xml ?
 boolean isJava2DelegationModel()
           
protected  void setEarURL(java.net.URL earURL)
           
protected  void setInEarCase(boolean inEarCase)
           
protected  void setJava2DelegationModel(boolean java2DelegationModel)
           
 void setJonasDeploymentDescriptor(java.lang.String jonasDeploymentDescriptor)
          Set the deployment descriptor content of jonas-web.xml file
 void setParentClassLoader(java.lang.ClassLoader parent)
          Set the parent class loader for this web application.
protected  void setWarURL(java.net.URL warURL)
           
 void start()
          Start the JOnAS context if catalina is started
 void stop()
          Stop this Context component.
 
Methods inherited from class org.apache.catalina.core.StandardContext
addApplicationListener, addApplicationParameter, addChild, addConstraint, addErrorPage, addFilterDef, addFilterMap, addInstanceListener, addJspMapping, addLocaleEncodingMappingParameter, addMessageDestination, addMessageDestinationRef, addMimeMapping, addNotificationListener, addParameter, addRoleMapping, addSecurityRole, addServletMapping, addServletMapping, addTaglib, addWatchedResource, addWelcomeFile, addWrapperLifecycle, addWrapperListener, adjustURLPattern, create, createObjectName, createWrapper, destroy, engineBase, filterStart, filterStop, findApplicationListeners, findApplicationParameters, findConstraints, findErrorPage, findErrorPage, findErrorPages, findFilterConfig, findFilterDef, findFilterDefs, findFilterMaps, findInstanceListeners, findMappingObject, findMessageDestination, findMessageDestinationRef, findMessageDestinationRefs, findMessageDestinations, findMimeMapping, findMimeMappings, findParameter, findParameters, findRoleMapping, findSecurityRole, findSecurityRoles, findServletMapping, findServletMappings, findStaticResources, findStatusPage, findStatusPages, findTaglib, findTaglibs, findWatchedResources, findWelcomeFile, findWelcomeFiles, findWrapperLifecycles, findWrapperListeners, getAltDDName, getAntiJARLocking, getAntiResourceLocking, getApplicationEventListeners, getApplicationLifecycleListeners, getAvailable, getBasePath, getCacheMaxSize, getCacheTTL, getCharsetMapper, getCharsetMapperClass, getCompilerClasspath, getConfigBase, getConfigFile, getConfigured, getCookies, getCrossContext, getDefaultConfigFile, getDefaultContextXml, getDefaultWebXml, getDelegate, getDeploymentDescriptor, getDisplayName, getDistributable, getDocBase, getEncodedPath, getEngineName, getHostname, getInfo, getJ2EEApplication, getJ2EEServer, getJavaVMs, getLoginConfig, getMapper, getNamingResources, getNotificationInfo, getOriginalDocBase, getOverride, getParentClassLoader, getParentName, getPath, getPaused, getPrivileged, getProcessingTime, getProcessTlds, getPublicId, getReloadable, getServer, getServletContext, getServlets, getSessionTimeout, getStartTime, getStartupTime, getState, getStaticResources, getSwallowOutput, getTldNamespaceAware, getTldScanTime, getTldValidation, getUnloadDelay, getUnpackWAR, getWelcomeFiles, getWorkDir, getWorkPath, getWrapperClass, getXmlNamespaceAware, getXmlValidation, init, isAllowLinking, isCachingAllowed, isCaseSensitive, isEventProvider, isFilesystemBased, isLazy, isReplaceWelcomeFiles, isSaveConfig, isServlet22, isStateManageable, isStatisticsProvider, isUseNaming, listenerStart, listenerStop, loadOnStartup, preDeregister, preRegister, processTlds, reload, removeApplicationListener, removeApplicationParameter, removeChild, removeConstraint, removeErrorPage, removeFilterDef, removeFilterMap, removeInstanceListener, removeMessageDestination, removeMessageDestinationRef, removeMimeMapping, removeNotificationListener, removeNotificationListener, removeParameter, removeRoleMapping, removeSecurityRole, removeServletMapping, removeTaglib, removeWatchedResource, removeWelcomeFile, removeWrapperLifecycle, removeWrapperListener, resourcesStart, resourcesStop, setAllowLinking, setAltDDName, setAntiJARLocking, setAntiResourceLocking, setApplicationEventListeners, setApplicationLifecycleListeners, setAvailable, setCacheMaxSize, setCacheTTL, setCachingAllowed, setCaseSensitive, setCharsetMapper, setCharsetMapperClass, setCompilerClasspath, setConfigFile, setConfigured, setCookies, setCrossContext, setDefaultContextXml, setDefaultWebXml, setDelegate, setDisplayName, setDistributable, setDocBase, setEngineName, setJ2EEApplication, setJ2EEServer, setJavaVMs, setLazy, setLoader, setLoginConfig, setName, setNamingResources, setOriginalDocBase, setOverride, setPath, setPrivileged, setProcessTlds, setPublicId, setReloadable, setReplaceWelcomeFiles, setResources, setSaveConfig, setServer, setSessionTimeout, setStartupTime, setSwallowOutput, setTldNamespaceAware, setTldScanTime, setTldValidation, setUnloadDelay, setUnpackWAR, setUseNaming, setWorkDir, setWrapperClass, setXmlNamespaceAware, setXmlValidation, startRecursive, toString
 
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getCluster, getContainerSuffix, getDomain, getFirst, getJmxName, getJSR77Suffix, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getPipeline, getRealm, getResources, getType, getValveObjectNames, getValves, invoke, logName, postDeregister, postRegister, removeContainerListener, removeLifecycleListener, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCluster, setDomain, setManager, setParent, setRealm, threadStart, threadStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.catalina.Container
addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, getBackgroundProcessorDelay, getCluster, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getPipeline, getRealm, getResources, invoke, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setManager, setParent, setRealm
 

Constructor Detail

JOnASStandardContext

public JOnASStandardContext()
Constructor of the Context


JOnASStandardContext

public JOnASStandardContext(boolean inServerXml,
                            boolean java2DelegationModel,
                            boolean inEarCase)
Constructor of the Context

Parameters:
inServerXml - this context was defined in server.xml
java2DelegationModel - delegation model for classloader is true ?
inEarCase - if we are or not in EAR case
Method Detail

getEarURL

public java.net.URL getEarURL()
Returns:
Returns the earURL.

getJonasDeploymentDescriptor

public java.lang.String getJonasDeploymentDescriptor()
Gets the deployment descriptor content of jonas-web.xml file

Returns:
the content of jonas-web.xml file

getWarURL

public java.net.URL getWarURL()
Returns:
Returns the warURL.

isInEarCase

public boolean isInEarCase()
Returns:
true if this web module is a part of a EAR

isInServerXml

public boolean isInServerXml()
This context was defined in server.xml ?

Returns:
true if this context was defined in server.xml

isJava2DelegationModel

public boolean isJava2DelegationModel()
Returns:
true if the Java2 delegation model is used

setEarURL

protected void setEarURL(java.net.URL earURL)
Parameters:
earURL - The earURL to set.

setInEarCase

protected void setInEarCase(boolean inEarCase)
Parameters:
inEarCase - The inEarCase to set.

setJava2DelegationModel

protected void setJava2DelegationModel(boolean java2DelegationModel)
Parameters:
java2DelegationModel - The java2DelegationModel to set.

setJonasDeploymentDescriptor

public void setJonasDeploymentDescriptor(java.lang.String jonasDeploymentDescriptor)
Set the deployment descriptor content of jonas-web.xml file

Parameters:
jonasDeploymentDescriptor - the content of jonas-web.xml

setWarURL

protected void setWarURL(java.net.URL warURL)
Parameters:
warURL - The warURL to set.

start

public void start()
           throws org.apache.catalina.LifecycleException
Start the JOnAS context if catalina is started

Specified by:
start in interface org.apache.catalina.Lifecycle
Overrides:
start in class org.apache.catalina.core.StandardContext
Throws:
org.apache.catalina.LifecycleException - if the context can't be started

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Stop this Context component.

Specified by:
stop in interface org.apache.catalina.Lifecycle
Overrides:
stop in class org.apache.catalina.core.StandardContext
Throws:
org.apache.catalina.LifecycleException - if a shutdown error occurs

addResource

public void addResource(org.apache.catalina.deploy.ContextResource resource)
Add a resource reference for this web application. Do nothing when running inside JOnAS. Resources are managed by JOnAS

Parameters:
resource - New resource reference

addEnvironment

public void addEnvironment(org.apache.catalina.deploy.ContextEnvironment environment)
Add an environment entry for this web application. Do nothing when running inside JOnAS. ENC environment is managed by JOnAS

Parameters:
environment - New environment entry

setParentClassLoader

public void setParentClassLoader(java.lang.ClassLoader parent)
Set the parent class loader for this web application. Do it only if it is not started.

Specified by:
setParentClassLoader in interface org.apache.catalina.Container
Overrides:
setParentClassLoader in class org.apache.catalina.core.ContainerBase
Parameters:
parent - The new parent class loader

getEarON

public java.lang.String getEarON()
Returns:
OBJECT_NAME of the parent J2EEApplication MBean