Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.catalina.core.StandardDefaultContext
public class StandardDefaultContext
extends java.lang.Object
implements DefaultContext, LifecycleListener, MBeanRegistration
override="true"
.
Field Summary | |
protected boolean |
|
protected int |
|
protected int |
|
protected boolean |
|
protected boolean |
|
protected String | |
protected Vector |
|
protected Loader |
|
protected Manager |
|
protected int |
|
protected MBeanServer | |
protected String |
|
protected ObjectName | |
protected Container |
|
protected static StringManager |
|
protected String | |
protected PropertyChangeSupport |
|
protected String |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
void |
|
void |
|
String |
|
void |
|
void |
|
void |
|
void |
|
String[] |
|
ApplicationParameter[] |
|
ContextEjb |
|
ContextEjb[] |
|
ContextEnvironment |
|
ContextEnvironment[] |
|
String[] |
|
LifecycleListener[] |
|
String |
|
String[] |
|
ContextResource |
|
String |
|
String[] |
|
ContextResourceLink |
|
ContextResourceLink[] |
|
ResourceParams[] |
|
ContextResource[] |
|
String[] |
|
String[] |
|
int |
|
int |
|
boolean |
|
boolean |
|
String | |
String[] |
|
String |
|
protected String | |
Loader |
|
Manager |
|
int |
|
String |
|
NamingResources |
|
ObjectName | |
Container |
|
boolean |
|
String[] |
|
String[] |
|
DirContext |
|
boolean |
|
String |
|
String |
|
void |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void | |
void |
|
void | |
ObjectName |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
protected boolean allowLinking
Allow linking.
protected int cacheMaxSize
Cache max size in KB.
protected int cacheTTL
Cache TTL in ms.
protected boolean cachingAllowed
CachingAllowed.
protected boolean caseSensitive
Case sensitivity.
protected String domain
protected Vector lifecycle
The Context LifecycleListener's
protected Manager manager
The Manager implementation with which this Container is associated.
protected int managerChecksFrequency
Frequency of manager checks.
protected MBeanServer mserver
protected String name
The human-readable name of this Container.
protected ObjectName oname
protected String suffix
protected PropertyChangeSupport support
The property change support for this component.
protected String type
public void addApplicationListener(String listener)
Add a new Listener class name to the set of Listeners configured for this application.
- Specified by:
- addApplicationListener in interface DefaultContext
- Parameters:
listener
- Java class name of a listener class
public void addApplicationParameter(ApplicationParameter parameter)
Add a new application parameter for this application.
- Specified by:
- addApplicationParameter in interface DefaultContext
- Parameters:
parameter
- The new application parameter
public void addEjb(ContextEjb ejb)
Add an EJB resource reference for this web application.
- Specified by:
- addEjb in interface DefaultContext
- Parameters:
ejb
- New EJB resource reference
public String addEnvironment(String envName, String type) throws MalformedObjectNameException
Add an environment entry for this web application.
- Parameters:
envName
- New environment entry name
public void addEnvironment(ContextEnvironment environment)
Add an environment entry for this web application.
- Specified by:
- addEnvironment in interface DefaultContext
- Parameters:
environment
- New environment entry
public void addInstanceListener(String listener)
Add the classname of an InstanceListener to be added to each Wrapper appended to this Context.
- Specified by:
- addInstanceListener in interface DefaultContext
- Parameters:
listener
- Java class name of an InstanceListener class
public void addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
- Parameters:
listener
- The listener to add
public void addParameter(String name, String value)
Add a new context initialization parameter, replacing any existing value for the specified name.
- Specified by:
- addParameter in interface DefaultContext
- Parameters:
name
- Name of the new parametervalue
- Value of the new parameter
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
- Specified by:
- addPropertyChangeListener in interface DefaultContext
- Parameters:
listener
- The listener to add
public String addResource(String resourceName, String type) throws MalformedObjectNameException
Add a resource reference for this web application.
- Parameters:
resourceName
- New resource reference name
public void addResource(ContextResource resource)
Add a resource reference for this web application.
- Specified by:
- addResource in interface DefaultContext
- Parameters:
resource
- New resource reference
public void addResourceEnvRef(String name, String type)
Add a resource environment reference for this web application.
- Specified by:
- addResourceEnvRef in interface DefaultContext
- Parameters:
name
- The resource environment reference nametype
- The resource environment reference type
public String addResourceLink(String resourceLinkName, String global, String name, String type) throws MalformedObjectNameException
Add a resource link for this web application.
- Parameters:
resourceLinkName
- New resource link name
public void addResourceLink(ContextResourceLink resourceLink)
Add a resource link for this web application.
- Specified by:
- addResourceLink in interface DefaultContext
- Parameters:
resourceLink
- New resource link
public void addResourceParams(ResourceParams resourceParameters)
Add resource parameters for this web application.
- Specified by:
- addResourceParams in interface DefaultContext
- Parameters:
resourceParameters
- New resource parameters
public void addWrapperLifecycle(String listener)
Add the classname of a LifecycleListener to be added to each Wrapper appended to this Context.
- Specified by:
- addWrapperLifecycle in interface DefaultContext
- Parameters:
listener
- Java class name of a LifecycleListener class
public void addWrapperListener(String listener)
Add the classname of a ContainerListener to be added to each Wrapper appended to this Context.
- Specified by:
- addWrapperListener in interface DefaultContext
- Parameters:
listener
- Java class name of a ContainerListener class
public String[] findApplicationListeners()
Return the set of application listener class names configured for this application.
- Specified by:
- findApplicationListeners in interface DefaultContext
public ApplicationParameter[] findApplicationParameters()
Return the set of application parameters for this application.
- Specified by:
- findApplicationParameters in interface DefaultContext
public ContextEjb findEjb(String name)
Return the EJB resource reference with the specified name, if any; otherwise, returnnull
.
- Specified by:
- findEjb in interface DefaultContext
- Parameters:
name
- Name of the desired EJB resource reference
public ContextEjb[] findEjbs()
Return the defined EJB resource references for this application. If there are none, a zero-length array is returned.
- Specified by:
- findEjbs in interface DefaultContext
public ContextEnvironment findEnvironment(String name)
Return the environment entry with the specified name, if any; otherwise, returnnull
.
- Specified by:
- findEnvironment in interface DefaultContext
- Parameters:
name
- Name of the desired environment entry
public ContextEnvironment[] findEnvironments()
Return the set of defined environment entries for this web application. If none have been defined, a zero-length array is returned.
- Specified by:
- findEnvironments in interface DefaultContext
public String[] findInstanceListeners()
Return the set of InstanceListener classes that will be added to newly created Wrappers automatically.
- Specified by:
- findInstanceListeners in interface DefaultContext
public LifecycleListener[] findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.
public String findParameter(String name)
Return the value for the specified context initialization parameter name, if any; otherwise returnnull
.
- Specified by:
- findParameter in interface DefaultContext
- Parameters:
name
- Name of the parameter to return
public String[] findParameters()
Return the names of all defined context initialization parameters for this Context. If no parameters are defined, a zero-length array is returned.
- Specified by:
- findParameters in interface DefaultContext
public ContextResource findResource(String name)
Return the resource reference with the specified name, if any; otherwise returnnull
.
- Specified by:
- findResource in interface DefaultContext
- Parameters:
name
- Name of the desired resource reference
public String findResourceEnvRef(String name)
Return the resource environment reference type for the specified name, if any; otherwise returnnull
.
- Specified by:
- findResourceEnvRef in interface DefaultContext
- Parameters:
name
- Name of the desired resource environment reference
public String[] findResourceEnvRefs()
Return the set of resource environment reference names for this web application. If none have been specified, a zero-length array is returned.
- Specified by:
- findResourceEnvRefs in interface DefaultContext
public ContextResourceLink findResourceLink(String name)
Return the resource link with the specified name, if any; otherwise returnnull
.
- Specified by:
- findResourceLink in interface DefaultContext
- Parameters:
name
- Name of the desired resource link
public ContextResourceLink[] findResourceLinks()
Return the defined resource links for this application. If none have been defined, a zero-length array is returned.
- Specified by:
- findResourceLinks in interface DefaultContext
public ResourceParams[] findResourceParams()
Return the set of defined resource parameters for this web application. If none have been defined, a zero-length array is returned.
- Specified by:
- findResourceParams in interface DefaultContext
public ContextResource[] findResources()
Return the defined resource references for this application. If none have been defined, a zero-length array is returned.
- Specified by:
- findResources in interface DefaultContext
public String[] findWrapperLifecycles()
Return the set of LifecycleListener classes that will be added to newly created Wrappers automatically.
- Specified by:
- findWrapperLifecycles in interface DefaultContext
public String[] findWrapperListeners()
Return the set of ContainerListener classes that will be added to newly created Wrappers automatically.
- Specified by:
- findWrapperListeners in interface DefaultContext
public int getCacheMaxSize()
Return the maximum size of the cache in KB.
public int getCacheTTL()
Get cache TTL.
public boolean getCookies()
Return the "use cookies for session ids" flag.
- Specified by:
- getCookies in interface DefaultContext
public boolean getCrossContext()
Return the "allow crossing servlet contexts" flag.
- Specified by:
- getCrossContext in interface DefaultContext
public String getDomain()
public String[] getEnvironments()
Return the MBean Names of the set of defined environment entries for this web application
public String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>
.
- Specified by:
- getInfo in interface DefaultContext
protected String getJSR77Suffix()
public Loader getLoader()
Return the Loader with which this Container is associated. If there is no associated Loader returnnull
.
- Specified by:
- getLoader in interface DefaultContext
public Manager getManager()
Return the Manager with which this Container is associated. If there is no associated Manager returnnull
.
- Specified by:
- getManager in interface DefaultContext
public int getManagerChecksFrequency()
Get manager checks frquency.
public String getName()
The name of this DefaultContext
- Specified by:
- getName in interface DefaultContext
public NamingResources getNamingResources()
Return the naming resources associated with this web application.
- Specified by:
- getNamingResources in interface DefaultContext
public ObjectName getObjectName()
public Container getParent()
Return the Container for which this Container is a child, if there is one. If there is no defined parent, returnnull
.
- Specified by:
- getParent in interface DefaultContext
public boolean getReloadable()
Return the reloadable flag for this web application.
- Specified by:
- getReloadable in interface DefaultContext
public String[] getResourceLinks()
Return the MBean Names of all the defined resource links for this application
public String[] getResourceNames()
Return the MBean Names of all the defined resource references for this application. XXX This changed - due to conflict
public DirContext getResources()
Get the resources DirContext object with which this Container is associated.
- Specified by:
- getResources in interface DefaultContext
- Returns:
- The associated DirContext
public boolean getSwallowOutput()
Return the swallowOutput flag for this web application.
public String getType()
public String getWrapperClass()
Return the Java class name of the Wrapper implementation used for servlets registered in this Context.
- Specified by:
- getWrapperClass in interface DefaultContext
public void importDefaultContext(Context context)
Import the configuration from the DefaultContext into current Context.
- Specified by:
- importDefaultContext in interface DefaultContext
- Parameters:
context
- current web application context
public void installDefaultContext(Context context)
Install the StandardContext portion of the DefaultContext configuration into current Context.
- Parameters:
context
- current web application context
public boolean isAllowLinking()
Is linking allowed.
public boolean isCachingAllowed()
Is cachingAllowed ?
public boolean isCaseSensitive()
Is case sensitive ?
public boolean isUseNaming()
Returns true if the internal naming support is used.
public void lifecycleEvent(LifecycleEvent event)
Process the START event for an associated Context.
- Specified by:
- lifecycleEvent in interface LifecycleListener
- Parameters:
event
- The lifecycle event that has occurred
public void postDeregister()
public void postRegister(Boolean registrationDone)
public void preDeregister() throws Exception
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
public void removeApplicationListener(String listener)
Remove the specified application listener class from the set of listeners for this application.
- Specified by:
- removeApplicationListener in interface DefaultContext
- Parameters:
listener
- Java class name of the listener to be removed
public void removeApplicationParameter(String name)
Remove the application parameter with the specified name from the set for this application.
- Specified by:
- removeApplicationParameter in interface DefaultContext
- Parameters:
name
- Name of the application parameter to remove
public void removeEjb(String name)
Remove any EJB resource reference with the specified name.
- Specified by:
- removeEjb in interface DefaultContext
- Parameters:
name
- Name of the EJB resource reference to remove
public void removeEnvironment(String envName)
Remove any environment entry with the specified name.
- Specified by:
- removeEnvironment in interface DefaultContext
- Parameters:
envName
- Name of the environment entry to remove
public void removeInstanceListener(String listener)
Remove a class name from the set of InstanceListener classes that will be added to newly created Wrappers.
- Specified by:
- removeInstanceListener in interface DefaultContext
- Parameters:
listener
- Class name of an InstanceListener class to be removed
public void removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
- Parameters:
listener
- The listener to remove
public void removeParameter(String name)
Remove the context initialization parameter with the specified name, if it exists; otherwise, no action is taken.
- Specified by:
- removeParameter in interface DefaultContext
- Parameters:
name
- Name of the parameter to remove
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
- Specified by:
- removePropertyChangeListener in interface DefaultContext
- Parameters:
listener
- The listener to remove
public void removeResource(String resourceName)
Remove any resource reference with the specified name.
- Specified by:
- removeResource in interface DefaultContext
- Parameters:
resourceName
- Name of the resource reference to remove
public void removeResourceEnvRef(String name)
Remove any resource environment reference with the specified name.
- Specified by:
- removeResourceEnvRef in interface DefaultContext
- Parameters:
name
- Name of the resource environment reference to remove
public void removeResourceLink(String resourceLinkName)
Remove any resource link with the specified name.
- Specified by:
- removeResourceLink in interface DefaultContext
- Parameters:
resourceLinkName
- Name of the resource reference to remove
public void removeWrapperLifecycle(String listener)
Remove a class name from the set of LifecycleListener classes that will be added to newly created Wrappers.
- Specified by:
- removeWrapperLifecycle in interface DefaultContext
- Parameters:
listener
- Class name of a LifecycleListener class to be removed
public void removeWrapperListener(String listener)
Remove a class name from the set of ContainerListener classes that will be added to newly created Wrappers.
- Specified by:
- removeWrapperListener in interface DefaultContext
- Parameters:
listener
- Class name of a ContainerListener class to be removed
public void setAllowLinking(boolean allowLinking)
Set allow linking.
public void setCacheMaxSize(int cacheMaxSize)
Set the maximum size of the cache in KB.
public void setCacheTTL(int cacheTTL)
Set cache TTL.
public void setCachingAllowed(boolean cachingAllowed)
Set cachingAllowed.
public void setCaseSensitive(boolean caseSensitive)
Set case sensitivity.
public void setCookies(boolean cookies)
Set the "use cookies for session ids" flag.
- Specified by:
- setCookies in interface DefaultContext
- Parameters:
cookies
- The new flag
public void setCrossContext(boolean crossContext)
Set the "allow crossing servlet contexts" flag.
- Specified by:
- setCrossContext in interface DefaultContext
- Parameters:
crossContext
- The new cross contexts flag
public void setLoader(Loader loader)
Set the Loader with which this Context is associated.
- Specified by:
- setLoader in interface DefaultContext
- Parameters:
loader
- The newly associated loader
public void setManager(Manager manager)
Set the Manager with which this Container is associated.
- Specified by:
- setManager in interface DefaultContext
- Parameters:
manager
- The newly associated Manager
public void setManagerChecksFrequency(int managerChecksFrequency)
Set the manager checks frequency.
public void setParent(Container container)
Set the parent Container to which this Container is being added as a child. This Container may refuse to become attached to the specified Container by throwing an exception.
- Specified by:
- setParent in interface DefaultContext
- Parameters:
container
- Container to which this Container is being added as a child
public void setReloadable(boolean reloadable)
Set the reloadable flag for this web application.
- Specified by:
- setReloadable in interface DefaultContext
- Parameters:
reloadable
- The new reloadable flag
public void setResources(DirContext resources)
Set the resources DirContext object with which this Container is associated.
- Specified by:
- setResources in interface DefaultContext
- Parameters:
resources
- The newly associated DirContext
public void setSwallowOutput(boolean swallowOutput)
Set the swallowOutput flag for this web application.
- Parameters:
swallowOutput
- The new swallowOutput flag
public void setUseNaming(boolean useNaming)
Enables or disables naming.
public void setWrapperClass(String wrapperClass)
Set the Java class name of the Wrapper implementation used for servlets registered in this Context.
- Specified by:
- setWrapperClass in interface DefaultContext
- Parameters:
wrapperClass
- The new wrapper class
public String toString()
Return a String representation of this component.