org.apache.catalina

Interface DefaultContext

Known Implementing Classes:
StandardDefaultContext

public interface DefaultContext

Used to store the default configuration a Host will use when creating a Context. A Context configured in server.xml can override these defaults by setting the Context attribute override="true".

Version:
$Revision: 1.6 $ $Date: 2004/05/26 15:26:06 $

Authors:
Glenn Nielsen
Remy Maucherat

Method Summary

void
addApplicationListener(String listener)
Add a new Listener class name to the set of Listeners configured for this application.
void
addApplicationParameter(ApplicationParameter parameter)
Add a new application parameter for this application.
void
addEjb(ContextEjb ejb)
Add an EJB resource reference for this web application.
void
addEnvironment(ContextEnvironment environment)
Add an environment entry for this web application.
void
addInstanceListener(String listener)
Add the classname of an InstanceListener to be added to each Wrapper appended to this Context.
void
addParameter(String name, String value)
Add a new context initialization parameter, replacing any existing value for the specified name.
void
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
void
addResource(ContextResource resource)
Add a resource reference for this web application.
void
addResourceEnvRef(String name, String type)
Add a resource environment reference for this web application.
void
addResourceLink(ContextResourceLink resourceLink)
Add a resource link for this web application.
void
addResourceParams(ResourceParams resourceParameters)
Add resource parameters for this web application.
void
addWrapperLifecycle(String listener)
Add the classname of a LifecycleListener to be added to each Wrapper appended to this Context.
void
addWrapperListener(String listener)
Add the classname of a ContainerListener to be added to each Wrapper appended to this Context.
String[]
findApplicationListeners()
Return the set of application listener class names configured for this application.
ApplicationParameter[]
findApplicationParameters()
Return the set of application parameters for this application.
ContextEjb
findEjb(String name)
Return the EJB resource reference with the specified name, if any; otherwise, return null.
ContextEjb[]
findEjbs()
Return the defined EJB resource references for this application.
ContextEnvironment
findEnvironment(String name)
Return the environment entry with the specified name, if any; otherwise, return null.
ContextEnvironment[]
findEnvironments()
Return the set of defined environment entries for this web application.
String[]
findInstanceListeners()
Return the set of InstanceListener classes that will be added to newly created Wrappers automatically.
String
findParameter(String name)
Return the value for the specified context initialization parameter name, if any; otherwise return null.
String[]
findParameters()
Return the names of all defined context initialization parameters for this Context.
ContextResource
findResource(String name)
Return the resource reference with the specified name, if any; otherwise return null.
String
findResourceEnvRef(String name)
Return the resource environment reference type for the specified name, if any; otherwise return null.
String[]
findResourceEnvRefs()
Return the set of resource environment reference names for this web application.
ContextResourceLink
findResourceLink(String name)
Return the resource link with the specified name, if any; otherwise return null.
ContextResourceLink[]
findResourceLinks()
Return the defined resource links for this application.
ResourceParams[]
findResourceParams()
Return the set of defined resource parameters for this web application.
ContextResource[]
findResources()
Return the defined resource references for this application.
String[]
findWrapperLifecycles()
Return the set of LifecycleListener classes that will be added to newly created Wrappers automatically.
String[]
findWrapperListeners()
Return the set of ContainerListener classes that will be added to newly created Wrappers automatically.
boolean
getCookies()
Return the "use cookies for session ids" flag.
boolean
getCrossContext()
Return the "allow crossing servlet contexts" flag.
String
getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format <description>/<version>.
Loader
getLoader()
Return the Loader with which this Container is associated.
Manager
getManager()
Return the Manager with which this Container is associated.
String
getName()
Return the name of this DefaultContext
NamingResources
getNamingResources()
Return the naming resources associated with this web application.
Container
getParent()
Return the Container for which this Container is a child, if there is one.
boolean
getReloadable()
Return the reloadable flag for this web application.
DirContext
getResources()
Get the resources DirContext object with which this Container is associated.
String
getWrapperClass()
Return the Java class name of the Wrapper implementation used for servlets registered in this Context.
void
importDefaultContext(Context context)
Import the configuration from the DefaultContext into current Context.
void
removeApplicationListener(String listener)
Remove the specified application listener class from the set of listeners for this application.
void
removeApplicationParameter(String name)
Remove the application parameter with the specified name from the set for this application.
void
removeEjb(String name)
Remove any EJB resource reference with the specified name.
void
removeEnvironment(String name)
Remove any environment entry with the specified name.
void
removeInstanceListener(String listener)
Remove a class name from the set of InstanceListener classes that will be added to newly created Wrappers.
void
removeParameter(String name)
Remove the context initialization parameter with the specified name, if it exists; otherwise, no action is taken.
void
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
void
removeResource(String name)
Remove any resource reference with the specified name.
void
removeResourceEnvRef(String name)
Remove any resource environment reference with the specified name.
void
removeResourceLink(String name)
Remove any resource link with the specified name.
void
removeWrapperLifecycle(String listener)
Remove a class name from the set of LifecycleListener classes that will be added to newly created Wrappers.
void
removeWrapperListener(String listener)
Remove a class name from the set of ContainerListener classes that will be added to newly created Wrappers.
void
setCookies(boolean cookies)
Set the "use cookies for session ids" flag.
void
setCrossContext(boolean crossContext)
Set the "allow crossing servlet contexts" flag.
void
setLoader(Loader loader)
Set the Loader with which this Context is associated.
void
setManager(Manager manager)
Set the Manager with which this Container is associated.
void
setName(String name)
Set the name of the default context.
void
setParent(Container container)
Set the parent Container to which this Container is being added as a child.
void
setReloadable(boolean reloadable)
Set the reloadable flag for this web application.
void
setResources(DirContext resources)
Set the resources DirContext object with which this Container is associated.
void
setWrapperClass(String wrapperClass)
Set the Java class name of the Wrapper implementation used for servlets registered in this Context.

Method Details

addApplicationListener

public void addApplicationListener(String listener)
Add a new Listener class name to the set of Listeners configured for this application.

Parameters:
listener - Java class name of a listener class


addApplicationParameter

public void addApplicationParameter(ApplicationParameter parameter)
Add a new application parameter for this application.

Parameters:
parameter - The new application parameter


addEjb

public void addEjb(ContextEjb ejb)
Add an EJB resource reference for this web application.

Parameters:
ejb - New EJB resource reference


addEnvironment

public void addEnvironment(ContextEnvironment environment)
Add an environment entry for this web application.

Parameters:
environment - New environment entry


addInstanceListener

public void addInstanceListener(String listener)
Add the classname of an InstanceListener to be added to each Wrapper appended to this Context.

Parameters:
listener - Java class name of an InstanceListener class


addParameter

public void addParameter(String name,
                         String value)
Add a new context initialization parameter, replacing any existing value for the specified name.

Parameters:
name - Name of the new parameter
value - Value of the new parameter


addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.

Parameters:
listener - The listener to add


addResource

public void addResource(ContextResource resource)
Add a resource reference for this web application.

Parameters:
resource - New resource reference


addResourceEnvRef

public void addResourceEnvRef(String name,
                              String type)
Add a resource environment reference for this web application.

Parameters:
name - The resource environment reference name
type - The resource environment reference type


addResourceLink

public void addResourceLink(ContextResourceLink resourceLink)
Add a resource link for this web application.

Parameters:
resourceLink - New resource link


addResourceParams

public void addResourceParams(ResourceParams resourceParameters)
Add resource parameters for this web application.

Parameters:
resourceParameters - New resource parameters


addWrapperLifecycle

public void addWrapperLifecycle(String listener)
Add the classname of a LifecycleListener to be added to each Wrapper appended to this Context.

Parameters:
listener - Java class name of a LifecycleListener class


addWrapperListener

public void addWrapperListener(String listener)
Add the classname of a ContainerListener to be added to each Wrapper appended to this Context.

Parameters:
listener - Java class name of a ContainerListener class


findApplicationListeners

public String[] findApplicationListeners()
Return the set of application listener class names configured for this application.


findApplicationParameters

public ApplicationParameter[] findApplicationParameters()
Return the set of application parameters for this application.


findEjb

public ContextEjb findEjb(String name)
Return the EJB resource reference with the specified name, if any; otherwise, return null.

Parameters:
name - Name of the desired EJB resource reference


findEjbs

public ContextEjb[] findEjbs()
Return the defined EJB resource references for this application. If there are none, a zero-length array is returned.


findEnvironment

public ContextEnvironment findEnvironment(String name)
Return the environment entry with the specified name, if any; otherwise, return null.

Parameters:
name - Name of the desired environment entry


findEnvironments

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.


findInstanceListeners

public String[] findInstanceListeners()
Return the set of InstanceListener classes that will be added to newly created Wrappers automatically.


findParameter

public String findParameter(String name)
Return the value for the specified context initialization parameter name, if any; otherwise return null.

Parameters:
name - Name of the parameter to return


findParameters

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.


findResource

public ContextResource findResource(String name)
Return the resource reference with the specified name, if any; otherwise return null.

Parameters:
name - Name of the desired resource reference


findResourceEnvRef

public String findResourceEnvRef(String name)
Return the resource environment reference type for the specified name, if any; otherwise return null.

Parameters:
name - Name of the desired resource environment reference


findResourceEnvRefs

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.


findResourceLink

public ContextResourceLink findResourceLink(String name)
Return the resource link with the specified name, if any; otherwise return null.

Parameters:
name - Name of the desired resource link


findResourceLinks

public ContextResourceLink[] findResourceLinks()
Return the defined resource links for this application. If none have been defined, a zero-length array is returned.


findResourceParams

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.


findResources

public ContextResource[] findResources()
Return the defined resource references for this application. If none have been defined, a zero-length array is returned.


findWrapperLifecycles

public String[] findWrapperLifecycles()
Return the set of LifecycleListener classes that will be added to newly created Wrappers automatically.


findWrapperListeners

public String[] findWrapperListeners()
Return the set of ContainerListener classes that will be added to newly created Wrappers automatically.


getCookies

public boolean getCookies()
Return the "use cookies for session ids" flag.


getCrossContext

public boolean getCrossContext()
Return the "allow crossing servlet contexts" flag.


getInfo

public String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format <description>/<version>.


getLoader

public Loader getLoader()
Return the Loader with which this Container is associated. If there is no associated Loader return null.


getManager

public Manager getManager()
Return the Manager with which this Container is associated. If there is no associated Manager return null.


getName

public String getName()
Return the name of this DefaultContext


getNamingResources

public NamingResources getNamingResources()
Return the naming resources associated with this web application.


getParent

public Container getParent()
Return the Container for which this Container is a child, if there is one. If there is no defined parent, return null.


getReloadable

public boolean getReloadable()
Return the reloadable flag for this web application.


getResources

public DirContext getResources()
Get the resources DirContext object with which this Container is associated.


getWrapperClass

public String getWrapperClass()
Return the Java class name of the Wrapper implementation used for servlets registered in this Context.


importDefaultContext

public void importDefaultContext(Context context)
Import the configuration from the DefaultContext into current Context.

Parameters:
context - current web application context


removeApplicationListener

public void removeApplicationListener(String listener)
Remove the specified application listener class from the set of listeners for this application.

Parameters:
listener - Java class name of the listener to be removed


removeApplicationParameter

public void removeApplicationParameter(String name)
Remove the application parameter with the specified name from the set for this application.

Parameters:
name - Name of the application parameter to remove


removeEjb

public void removeEjb(String name)
Remove any EJB resource reference with the specified name.

Parameters:
name - Name of the EJB resource reference to remove


removeEnvironment

public void removeEnvironment(String name)
Remove any environment entry with the specified name.

Parameters:
name - Name of the environment entry to remove


removeInstanceListener

public void removeInstanceListener(String listener)
Remove a class name from the set of InstanceListener classes that will be added to newly created Wrappers.

Parameters:
listener - Class name of an InstanceListener class to be removed


removeParameter

public void removeParameter(String name)
Remove the context initialization parameter with the specified name, if it exists; otherwise, no action is taken.

Parameters:
name - Name of the parameter to remove


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.

Parameters:
listener - The listener to remove


removeResource

public void removeResource(String name)
Remove any resource reference with the specified name.

Parameters:
name - Name of the resource reference to remove


removeResourceEnvRef

public void removeResourceEnvRef(String name)
Remove any resource environment reference with the specified name.

Parameters:
name - Name of the resource environment reference to remove


removeResourceLink

public void removeResourceLink(String name)
Remove any resource link with the specified name.

Parameters:
name - Name of the resource link to remove


removeWrapperLifecycle

public void removeWrapperLifecycle(String listener)
Remove a class name from the set of LifecycleListener classes that will be added to newly created Wrappers.

Parameters:
listener - Class name of a LifecycleListener class to be removed


removeWrapperListener

public void removeWrapperListener(String listener)
Remove a class name from the set of ContainerListener classes that will be added to newly created Wrappers.

Parameters:
listener - Class name of a ContainerListener class to be removed


setCookies

public void setCookies(boolean cookies)
Set the "use cookies for session ids" flag.

Parameters:
cookies - The new flag


setCrossContext

public void setCrossContext(boolean crossContext)
Set the "allow crossing servlet contexts" flag.

Parameters:
crossContext - The new cross contexts flag


setLoader

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

Parameters:
loader - The newly associated loader


setManager

public void setManager(Manager manager)
Set the Manager with which this Container is associated.

Parameters:
manager - The newly associated Manager


setName

public void setName(String name)
Set the name of the default context.

Parameters:
name - The new name


setParent

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.

Parameters:
container - Container to which this Container is being added as a child


setReloadable

public void setReloadable(boolean reloadable)
Set the reloadable flag for this web application.

Parameters:
reloadable - The new reloadable flag


setResources

public void setResources(DirContext resources)
Set the resources DirContext object with which this Container is associated.

Parameters:
resources - The newly associated DirContext


setWrapperClass

public void setWrapperClass(String wrapperClass)
Set the Java class name of the Wrapper implementation used for servlets registered in this Context.

Parameters:
wrapperClass - The new wrapper class


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.