public interface Container
Containers will exist at several conceptual levels within Catalina. The following examples represent common cases:
A Container may also be associated with a number of support components that provide functionality which might be shared (by attaching it to a parent Container) or individually customized. The following support components are currently recognized:
log()
method
signatures of the ServletContext
interface.
Modifier and Type | Field and Description |
---|---|
static String |
ADD_CHILD_EVENT
The ContainerEvent event type sent when a child container is added
by
addChild() . |
static String |
ADD_MAPPER_EVENT
The ContainerEvent event type sent when a Mapper is added
by
addMapper() . |
static String |
ADD_VALVE_EVENT
The ContainerEvent event type sent when a valve is added
by
addValve() , if this Container supports pipelines. |
static String |
REMOVE_CHILD_EVENT
The ContainerEvent event type sent when a child container is removed
by
removeChild() . |
static String |
REMOVE_MAPPER_EVENT
The ContainerEvent event type sent when a Mapper is removed
by
removeMapper() . |
static String |
REMOVE_VALVE_EVENT
The ContainerEvent event type sent when a valve is removed
by
removeValve() , if this Container supports pipelines. |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Container child)
Add a new child Container to those associated with this Container,
if supported.
|
void |
addContainerListener(ContainerListener listener)
Add a container event listener to this component.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
backgroundProcess()
Execute a periodic task, such as reloading, etc.
|
Container |
findChild(String name)
Return the child Container, associated with this Container, with
the specified name (if any); otherwise, return
null |
Container[] |
findChildren()
Return the set of children Containers associated with this Container.
|
ContainerListener[] |
findContainerListeners()
Return the set of container listeners associated with this Container.
|
void |
fireContainerEvent(String type,
Object data)
Notifies all event listeners of this Container of the given event.
|
int |
getBackgroundProcessorDelay()
Get the delay between the invocation of the backgroundProcess method on
this container and its children.
|
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.
|
Logger |
getLogger()
Return the Logger with which this Container is associated.
|
Manager |
getManager()
Return the Manager with which this Container is associated.
|
Object |
getMappingObject()
Return an object which may be utilized for mapping to this component.
|
String |
getName()
Return a name string (suitable for use by humans) that describes this
Container.
|
Container |
getParent()
Return the Container for which this Container is a child, if there is
one.
|
ClassLoader |
getParentClassLoader()
Return the parent class loader (if any) for web applications.
|
Pipeline |
getPipeline()
Return the Pipeline object that manages the Valves associated with
this Container.
|
Realm |
getRealm()
Return the Realm with which this Container is associated.
|
DirContext |
getResources()
Return the Resources with which this Container is associated.
|
boolean |
hasCustomPipeline() |
void |
invoke(Request request,
Response response)
Process the specified Request, and generate the corresponding Response,
according to the design of this particular Container.
|
boolean |
isCheckIfRequestIsSecure()
Indicates whether the request will be checked to see if it is secure
before adding Pragma and Cache-control headers when proxy caching has
been disabled.
|
void |
removeChild(Container child)
Remove an existing child Container from association with this parent
Container.
|
void |
removeContainerListener(ContainerListener listener)
Remove a container event listener from this component.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
setBackgroundProcessorDelay(int delay)
Set the delay between the invocation of the execute method on this
container and its children.
|
void |
setCheckIfRequestIsSecure(boolean checkIfRequestIsSecure)
Sets the checkIfRequestIsSecure property of this Container.
|
void |
setLoader(Loader loader)
Set the Loader with which this Container is associated.
|
void |
setLogger(Logger logger)
Set the Logger with which this Container is associated.
|
void |
setManager(Manager manager)
Set the Manager with which this Container is associated.
|
void |
setName(String name)
Set a name string (suitable for use by humans) that describes this
Container.
|
void |
setParent(Container container)
Set the parent Container to which this Container is being added as a
child.
|
void |
setParentClassLoader(ClassLoader parent)
Set the parent class loader (if any) for web applications.
|
void |
setRealm(Realm realm)
Set the Realm with which this Container is associated.
|
void |
setResources(DirContext resources)
Set the Resources object with which this Container is associated.
|
static final String ADD_CHILD_EVENT
addChild()
.static final String ADD_MAPPER_EVENT
addMapper()
.static final String ADD_VALVE_EVENT
addValve()
, if this Container supports pipelines.static final String REMOVE_CHILD_EVENT
removeChild()
.static final String REMOVE_MAPPER_EVENT
removeMapper()
.static final String REMOVE_VALVE_EVENT
removeValve()
, if this Container supports pipelines.String getInfo()
<description>/<version>
.Loader getLoader()
null
.void setLoader(Loader loader)
loader
- The newly associated loaderLogger getLogger()
null
.void setLogger(Logger logger)
logger
- The newly associated LoggerManager getManager()
null
.void setManager(Manager manager)
manager
- The newly associated ManagerObject getMappingObject()
Pipeline getPipeline()
boolean hasCustomPipeline()
int getBackgroundProcessorDelay()
void setBackgroundProcessorDelay(int delay)
delay
- The delay in seconds between the invocation of
backgroundProcess methodsString getName()
void setName(String name)
name
- New name of this containerIllegalStateException
- if this Container has already been
added to the children of a parent Container (after which the name
may not be changed)Container getParent()
null
.void setParent(Container container)
container
- Container to which this Container is being added
as a childIllegalArgumentException
- if this Container refuses to become
attached to the specified ContainerClassLoader getParentClassLoader()
void setParentClassLoader(ClassLoader parent)
parent
- The new parent class loaderRealm getRealm()
null
.void setRealm(Realm realm)
realm
- The newly associated RealmDirContext getResources()
null
.void setResources(DirContext resources) throws Exception
resources
- The newly associated ResourcesException
void backgroundProcess()
void addChild(Container child)
setParent()
method must be called, with this
Container as an argument. This method may thrown an
IllegalArgumentException
if this Container chooses not
to be attached to the specified Container, in which case it is not addedchild
- New child Container to be addedIllegalArgumentException
- if this exception is thrown by
the setParent()
method of the child ContainerIllegalArgumentException
- if the new child does not have
a name unique from that of existing children of this ContainerIllegalStateException
- if this Container does not support
child Containersvoid addContainerListener(ContainerListener listener)
listener
- The listener to addvoid fireContainerEvent(String type, Object data)
type
- Event typedata
- Event datavoid addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to addContainer findChild(String name)
null
name
- Name of the child Container to be retrievedContainer[] findChildren()
ContainerListener[] findContainerListeners()
void invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
request
- Request to be processedresponse
- Response to be producedIOException
- if an input/output error occurred while
processingjavax.servlet.ServletException
- if a ServletException was thrown
while processing this requestvoid removeChild(Container child)
child
- Existing child Container to be removedvoid removeContainerListener(ContainerListener listener)
listener
- The listener to removevoid removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to removeboolean isCheckIfRequestIsSecure()
void setCheckIfRequestIsSecure(boolean checkIfRequestIsSecure)
checkIfRequestIsSecure
- true if check is required, false
otherwiseCopyright © 2020. All rights reserved.