org.ow2.jonas.web.tomcat6
Class JOnASStandardContext

java.lang.Object
  extended by org.apache.catalina.core.ContainerBase
      extended by org.apache.catalina.core.StandardContext
          extended by org.ow2.jonas.web.tomcat6.JOnASStandardContext
All Implemented Interfaces:
Serializable, MBeanRegistration, NotificationBroadcaster, 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
static String USE_SYSTEM_CLASS_LOADER
          System Property controlling activation/deactivation of the JDK 6 WebClassLoader fix.
 
Fields inherited from class org.apache.catalina.core.StandardContext
allowLinking, cacheMaxSize, cacheObjectMaxSize, 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, startChildren, 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 addMessageDestinationRef(org.apache.catalina.deploy.MessageDestinationRef mdr)
          Add a message destination reference for this web application.
 void addResource(org.apache.catalina.deploy.ContextResource resource)
          Add a resource reference for this web application.
 String getEarON()
           
 URL getEarURL()
           
 String getJonasDeploymentDescriptor()
          Gets the deployment descriptor content of jonas-web.xml file.
 URL getWarURL()
           
 WebContainerDeploymentDesc getWebDeploymentDescriptor()
          Gets the web deployment descriptor content.
 boolean isInEarCase()
           
 boolean isInServerXml()
          This context was defined in server.xml ?
 boolean isJava2DelegationModel()
           
protected  void setEarURL(URL earURL)
           
protected  void setInEarCase(boolean inEarCase)
           
protected  void setJava2DelegationModel(boolean java2DelegationModel)
           
 void setJonasDeploymentDescriptor(String jonasDeploymentDescriptor)
          Set the deployment descriptor content of jonas-web.xml file.
 void setLoader(org.apache.catalina.Loader loader)
          Set the Loader with which this Context is associated.
 void setParentClassLoader(ClassLoader parent)
          Set the parent class loader for this web application.
 void setTomcatService(Tomcat6Service tomcat)
          Assign the parent Tomcat6 WebContainerService.
protected  void setWarURL(URL warURL)
           
 void setWebDeploymentDescriptor(WebContainerDeploymentDesc webDeploymentDescriptor)
          Set the web deployment descriptor content.
 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, 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, getAnnotationProcessor, getAntiJARLocking, getAntiResourceLocking, getAppBase, getApplicationEventListeners, getApplicationLifecycleListeners, getAvailable, getBasePath, getCacheMaxSize, getCacheObjectMaxSize, getCacheTTL, getCharsetMapper, getCharsetMapperClass, getClearReferencesStopThreads, getClearReferencesStopTimerThreads, getClearReferencesThreadLocals, getCompilerClasspath, getConfigBase, getConfigFile, getConfigured, getCookies, getCrossContext, getDefaultConfigFile, getDefaultContextXml, getDefaultWebXml, getDelegate, getDeploymentDescriptor, getDisplayName, getDistributable, getDocBase, getEncodedPath, getEngineName, getHostname, getIgnoreAnnotations, getInfo, getJ2EEApplication, getJ2EEServer, getJavaVMs, getLoginConfig, getMapper, getNamingContextListener, getNamingResources, getNotificationInfo, getOriginalDocBase, getOverride, getParentClassLoader, getParentName, getPath, getPaused, getPrivileged, getProcessingTime, getProcessTlds, getPublicId, getReloadable, getServer, getServletContext, getServlets, getSessionCookieDomain, getSessionCookieName, getSessionCookiePath, getSessionTimeout, getStartTime, getStartupTime, getState, getStaticResources, getSwallowOutput, getTldNamespaceAware, getTldScanTime, getTldValidation, getUnloadDelay, getUnpackWAR, getUseHttpOnly, getWelcomeFiles, getWorkDir, getWorkPath, getWrapperClass, getXmlNamespaceAware, getXmlValidation, init, isAllowLinking, isCachingAllowed, isCaseSensitive, isEventProvider, isFilesystemBased, isLazy, isReplaceWelcomeFiles, isSaveConfig, isServlet22, isStateManageable, isStatisticsProvider, isUseNaming, listenerStart, listenerStop, loadOnStartup, preDeregister, preRegister, 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, setAnnotationProcessor, setAntiJARLocking, setAntiResourceLocking, setApplicationEventListeners, setApplicationLifecycleListeners, setAvailable, setCacheMaxSize, setCacheObjectMaxSize, setCacheTTL, setCachingAllowed, setCaseSensitive, setCharsetMapper, setCharsetMapperClass, setClearReferencesStopThreads, setClearReferencesStopTimerThreads, setClearReferencesThreadLocals, setCompilerClasspath, setConfigFile, setConfigured, setCookies, setCrossContext, setDefaultContextXml, setDefaultWebXml, setDelegate, setDisplayName, setDistributable, setDocBase, setEngineName, setIgnoreAnnotations, setJ2EEApplication, setJ2EEServer, setJavaVMs, setLazy, setLoginConfig, setName, setNamingContextListener, setNamingResources, setOriginalDocBase, setOverride, setPath, setPrivileged, setProcessTlds, setPublicId, setReloadable, setReplaceWelcomeFiles, setResources, setSaveConfig, setServer, setSessionCookieDomain, setSessionCookieName, setSessionCookiePath, setSessionTimeout, setStartupTime, setSwallowOutput, setTldNamespaceAware, setTldScanTime, setTldValidation, setUnloadDelay, setUnpackWAR, setUseHttpOnly, 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, getStartChildren, getType, getValveObjectNames, getValves, invoke, logName, postDeregister, postRegister, removeContainerListener, removeLifecycleListener, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCluster, setDomain, setManager, setParent, setRealm, setStartChildren, 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
 

Field Detail

USE_SYSTEM_CLASS_LOADER

public static final String USE_SYSTEM_CLASS_LOADER
System Property controlling activation/deactivation of the JDK 6 WebClassLoader fix.

See Also:
Constant Field Values
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

setTomcatService

public void setTomcatService(Tomcat6Service tomcat)
Assign the parent Tomcat6 WebContainerService.

Parameters:
tomcat - Tomcat6Service instance.

getEarURL

public URL getEarURL()
Returns:
Returns the earURL.

getWebDeploymentDescriptor

public WebContainerDeploymentDesc getWebDeploymentDescriptor()
Gets the web deployment descriptor content.

Returns:
the content of the web deployment descriptor

getJonasDeploymentDescriptor

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

Returns:
the content of jonas-web.xml file

getWarURL

public 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(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.

setWebDeploymentDescriptor

public void setWebDeploymentDescriptor(WebContainerDeploymentDesc webDeploymentDescriptor)
Set the web deployment descriptor content.

Parameters:
webDeploymentDescriptor - the content of the web deployment descriptor

setJonasDeploymentDescriptor

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

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

setWarURL

protected void setWarURL(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

addMessageDestinationRef

public void addMessageDestinationRef(org.apache.catalina.deploy.MessageDestinationRef mdr)
Add a message destination reference for this web application. Do nothing when running inside JOnAS. Resources are managed by JOnAS

Overrides:
addMessageDestinationRef in class org.apache.catalina.core.StandardContext
Parameters:
mdr - New message destination reference

setParentClassLoader

public void setParentClassLoader(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 String getEarON()
Returns:
OBJECT_NAME of the parent J2EEApplication MBean

setLoader

public void setLoader(org.apache.catalina.Loader loader)
Set the Loader with which this Context is associated.

Specified by:
setLoader in interface org.apache.catalina.Container
Overrides:
setLoader in class org.apache.catalina.core.StandardContext
Parameters:
loader - The newly associated loader


Copyright © 2010 OW2 Consortium. All Rights Reserved.