Container (Catalina Internal API Documentation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Container is an object that can execute requests received from a client, and return responses based on those requests. A Container may optionally support a pipeline of Valves that process the request in an order configured at runtime, by implementing the Pipeline interface as well.
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.
Field Summary | |
static java.lang.String |
ADD_CHILD_EVENT
The ContainerEvent event type sent when a child container is added by addChild() . |
static java.lang.String |
ADD_MAPPER_EVENT
The ContainerEvent event type sent when a Mapper is added by addMapper() . |
static java.lang.String |
ADD_VALVE_EVENT
The ContainerEvent event type sent when a valve is added by addValve() , if this Container supports pipelines. |
static java.lang.String |
REMOVE_CHILD_EVENT
The ContainerEvent event type sent when a child container is removed by removeChild() . |
static java.lang.String |
REMOVE_MAPPER_EVENT
The ContainerEvent event type sent when a Mapper is removed by removeMapper() . |
static java.lang.String |
REMOVE_VALVE_EVENT
The ContainerEvent event type sent when a valve is removed by removeValve() , if this Container supports pipelines. |
Method Summary | |
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 |
addMapper(Mapper mapper)
Add the specified Mapper associated with this Container. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
Container |
findChild(java.lang.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. |
Mapper |
findMapper(java.lang.String protocol)
Return the Mapper associated with the specified protocol, if there is one. |
Mapper[] |
findMappers()
Return the set of Mappers associated with this Container. |
Cluster |
getCluster()
Return the Cluster with which this Container is associated. |
java.lang.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. |
java.lang.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. |
java.lang.ClassLoader |
getParentClassLoader()
Return the parent class loader (if any) for web applications. |
Realm |
getRealm()
Return the Realm with which this Container is associated. |
javax.naming.directory.DirContext |
getResources()
Return the Resources with which this Container is associated. |
void |
invoke(Request request,
Response response)
Process the specified Request, and generate the corresponding Response, according to the design of this particular Container. |
Container |
map(Request request,
boolean update)
Return the child Container that should be used to process this Request, based upon its characteristics. |
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 |
removeMapper(Mapper mapper)
Remove a Mapper associated with this Container, if any. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setCluster(Cluster cluster)
Set the Cluster with which this Container is associated. |
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(java.lang.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(java.lang.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(javax.naming.directory.DirContext resources)
Set the Resources object with which this Container is associated. |
Field Detail |
public static final java.lang.String ADD_CHILD_EVENT
addChild()
.
public static final java.lang.String ADD_MAPPER_EVENT
addMapper()
.
public static final java.lang.String ADD_VALVE_EVENT
addValve()
, if this Container supports pipelines.
public static final java.lang.String REMOVE_CHILD_EVENT
removeChild()
.
public static final java.lang.String REMOVE_MAPPER_EVENT
removeMapper()
.
public static final java.lang.String REMOVE_VALVE_EVENT
removeValve()
, if this Container supports pipelines.
Method Detail |
public java.lang.String getInfo()
<description>/<version>
.
public Loader getLoader()
null
.
public void setLoader(Loader loader)
loader
- The newly associated loaderpublic Logger getLogger()
null
.
public void setLogger(Logger logger)
logger
- The newly associated Loggerpublic Manager getManager()
null
.
public void setManager(Manager manager)
manager
- The newly associated Managerpublic Cluster getCluster()
null
.
public void setCluster(Cluster cluster)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- New name of this container
java.lang.IllegalStateException
- if this Container has already been
added to the children of a parent Container (after which the name
may not be changed)public Container getParent()
null
.
public void setParent(Container container)
container
- Container to which this Container is being added
as a child
java.lang.IllegalArgumentException
- if this Container refuses to become
attached to the specified Containerpublic java.lang.ClassLoader getParentClassLoader()
public void setParentClassLoader(java.lang.ClassLoader parent)
parent
- The new parent class loaderpublic Realm getRealm()
null
.
public void setRealm(Realm realm)
realm
- The newly associated Realmpublic javax.naming.directory.DirContext getResources()
null
.
public void setResources(javax.naming.directory.DirContext resources)
resources
- The newly associated Resourcespublic 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 added
child
- New child Container to be added
java.lang.IllegalArgumentException
- if this exception is thrown by
the setParent()
method of the child Container
java.lang.IllegalArgumentException
- if the new child does not have
a name unique from that of existing children of this Container
java.lang.IllegalStateException
- if this Container does not support
child Containerspublic void addContainerListener(ContainerListener listener)
listener
- The listener to addpublic void addMapper(Mapper mapper)
mapper
- The corresponding Mapper implementation
java.lang.IllegalArgumentException
- if this exception is thrown by
the setContainer()
method of the Mapperpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to addpublic Container findChild(java.lang.String name)
null
name
- Name of the child Container to be retrievedpublic Container[] findChildren()
public Mapper findMapper(java.lang.String protocol)
null
.
protocol
- Protocol for which to find a Mapperpublic Mapper[] findMappers()
public void invoke(Request request, Response response) throws java.io.IOException, javax.servlet.ServletException
request
- Request to be processedresponse
- Response to be produced
java.io.IOException
- if an input/output error occurred while
processing
javax.servlet.ServletException
- if a ServletException was thrown
while processing this requestpublic Container map(Request request, boolean update)
null
instead.
request
- Request being processedupdate
- Update the Request to reflect the mapping selection?public void removeChild(Container child)
child
- Existing child Container to be removedpublic void removeContainerListener(ContainerListener listener)
listener
- The listener to removepublic void removeMapper(Mapper mapper)
mapper
- The Mapper to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |