|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--org.apache.catalina.core.ContainerBase
Abstract implementation of the Container interface, providing common
functionality required by nearly every implementation. Classes extending
this base class must implement getInfo()
, and may implement
a replacement for invoke()
.
All subclasses of this abstract base class will include support for a
Pipeline object that defines the processing to be performed for each request
received by the invoke()
method of this class, utilizig the
"Chain of Responsibility" design pattern. A subclass should encapsulate its
own processing functionality as a Valve
, and configure this
Valve into the pipeline by calling setBasic()
.
This implementation fires property change events, per the JavaBeans design
pattern, for changes in singleton properties. In addition, it fires the
following ContainerEvent
events to listeners who register
themselves with addContainerListener()
:
Type | Data | Description |
---|---|---|
addChild |
Container |
Child container added to this Container. |
addValve |
Valve |
Valve added to this Container. |
removeChild |
Container |
Child container removed from this Container. |
removeValve |
Valve |
Valve removed from this Container. |
start |
null |
Container was started. |
stop |
null |
Container was stopped. |
フィールドの概要 | |
protected java.util.HashMap |
children
The child Containers belonging to this Container, keyed by name. |
protected Cluster |
cluster
The cluster with which this Container is associated. |
protected int |
debug
The debugging detail level for this component. |
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component. |
protected java.util.ArrayList |
listeners
The container event listeners for this Container. |
protected Loader |
loader
The Loader implementation with which this Container is associated. |
protected Logger |
logger
The Logger implementation with which this Container is associated. |
protected Manager |
manager
The Manager implementation with which this Container is associated. |
protected Mapper |
mapper
The one and only Mapper associated with this Container, if any. |
protected java.lang.String |
mapperClass
The Java class name of the default Mapper class for this Container. |
protected java.util.HashMap |
mappers
The set of Mappers associated with this Container, keyed by protocol. |
protected java.lang.String |
name
The human-readable name of this Container. |
protected Container |
parent
The parent Container to which this Container is a child. |
protected java.lang.ClassLoader |
parentClassLoader
The parent class loader to be configured when we install a Loader. |
protected Pipeline |
pipeline
The Pipeline object with which this Container is associated. |
protected Realm |
realm
The Realm with which this Container is associated. |
protected javax.naming.directory.DirContext |
resources
The resources DirContext object with which this Container is associated. |
protected static StringManager |
sm
The string manager for this package. |
protected boolean |
started
Has this component been started? |
protected java.beans.PropertyChangeSupport |
support
The property change support for this component. |
インタフェース org.apache.catalina.Container から継承したフィールド |
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT |
インタフェース org.apache.catalina.Lifecycle から継承したフィールド |
START_EVENT, STOP_EVENT |
コンストラクタの概要 | |
ContainerBase()
|
メソッドの概要 | |
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. |
protected void |
addDefaultMapper(java.lang.String mapperClass)
Add a default Mapper implementation if none have been configured explicitly. |
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle 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. |
void |
addValve(Valve valve)
Add a new Valve to the end of the pipeline associated with this Container. |
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. |
void |
fireContainerEvent(java.lang.String type,
java.lang.Object data)
Notify all container event listeners that a particular event has occurred for this Container. |
Valve |
getBasic()
Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any). |
Cluster |
getCluster()
Return the Cluster with which this Container is associated. |
int |
getDebug()
Return the debugging detail level for this component. |
abstract 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 this web application. |
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. |
javax.naming.directory.DirContext |
getResources()
Return the resources DirContext object with which this Container is associated. |
Valve[] |
getValves()
Return the set of Valves in the pipeline associated with this Container, including the basic Valve (if any). |
void |
invoke(Request request,
Response response)
Process the specified Request, to produce the corresponding Response, by invoking the first Valve in our pipeline (if any), or the basic Valve otherwise. |
protected void |
log(java.lang.String message)
Log the specified message to our current Logger (if any). |
protected void |
log(java.lang.String message,
java.lang.Throwable throwable)
Log the specified message and exception to our current Logger (if any). |
protected java.lang.String |
logName()
Return the abbreviated name of this container for logging messsages |
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 |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle 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 |
removeValve(Valve valve)
Remove the specified Valve from the pipeline associated with this Container, if it is found; otherwise, do nothing. |
void |
setBasic(Valve valve)
Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any). |
void |
setCluster(Cluster cluster)
Set the Cluster with which this Container is associated. |
void |
setDebug(int debug)
Set the debugging detail level for this component. |
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 this web application. |
void |
setRealm(Realm realm)
Set the Realm with which this Container is associated. |
void |
setResources(javax.naming.directory.DirContext resources)
Set the resources DirContext object with which this Container is associated. |
void |
start()
Prepare for active use of the public methods of this Component. |
void |
stop()
Gracefully shut down active use of the public methods of this Component. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
protected java.util.HashMap children
protected int debug
protected LifecycleSupport lifecycle
protected java.util.ArrayList listeners
protected Loader loader
protected Logger logger
protected Manager manager
protected Cluster cluster
protected Mapper mapper
protected java.util.HashMap mappers
protected java.lang.String mapperClass
protected java.lang.String name
protected Container parent
protected java.lang.ClassLoader parentClassLoader
protected Pipeline pipeline
protected Realm realm
protected javax.naming.directory.DirContext resources
protected static StringManager sm
protected boolean started
protected java.beans.PropertyChangeSupport support
コンストラクタの詳細 |
public ContainerBase()
メソッドの詳細 |
public int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic abstract java.lang.String getInfo()
<description>/<version>
.Container
内の getInfo
public Loader getLoader()
null
.Container
内の getLoader
public void setLoader(Loader loader)
Container
内の setLoader
loader
- The newly associated loaderpublic Logger getLogger()
null
.Container
内の getLogger
public void setLogger(Logger logger)
Container
内の setLogger
logger
- The newly associated Loggerpublic Manager getManager()
null
.Container
内の getManager
public void setManager(Manager manager)
Container
内の setManager
manager
- The newly associated Managerpublic Cluster getCluster()
null
.Container
内の getCluster
public void setCluster(Cluster cluster)
Container
内の setCluster
manager
- The newly associated Clusterpublic java.lang.String getName()
Container
内の getName
public void setName(java.lang.String name)
Container
内の setName
name
- New name of this containerjava.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
.Container
内の getParent
public void setParent(Container container)
Container
内の setParent
container
- Container to which this Container is being added
as a childjava.lang.IllegalArgumentException
- if this Container refuses to become
attached to the specified Containerpublic java.lang.ClassLoader getParentClassLoader()
Container
内の getParentClassLoader
public void setParentClassLoader(java.lang.ClassLoader parent)
Container
内の setParentClassLoader
parent
- The new parent class loaderpublic Pipeline getPipeline()
public Realm getRealm()
null
.Container
内の getRealm
public void setRealm(Realm realm)
Container
内の setRealm
realm
- The newly associated Realmpublic javax.naming.directory.DirContext getResources()
null
.Container
内の getResources
public void setResources(javax.naming.directory.DirContext resources)
Container
内の setResources
resources
- The newly associated DirContextpublic 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 addedContainer
内の addChild
child
- New child Container to be addedjava.lang.IllegalArgumentException
- if this exception is thrown by
the setParent()
method of the child Containerjava.lang.IllegalArgumentException
- if the new child does not have
a name unique from that of existing children of this Containerjava.lang.IllegalStateException
- if this Container does not support
child Containerspublic void addContainerListener(ContainerListener listener)
Container
内の addContainerListener
listener
- The listener to addpublic void addMapper(Mapper mapper)
Container
内の addMapper
mapper
- The corresponding Mapper implementationjava.lang.IllegalArgumentException
- if this exception is thrown by
the setContainer()
method of the Mapperpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Container
内の addPropertyChangeListener
listener
- The listener to addpublic Container findChild(java.lang.String name)
null
Container
内の findChild
name
- Name of the child Container to be retrievedpublic Container[] findChildren()
Container
内の findChildren
public Mapper findMapper(java.lang.String protocol)
null
.Container
内の findMapper
protocol
- Protocol for which to find a Mapperpublic Mapper[] findMappers()
Container
内の findMappers
public void invoke(Request request, Response response) throws java.io.IOException, javax.servlet.ServletException
Container
内の invoke
request
- Request to be processedresponse
- Response to be producedjava.lang.IllegalStateException
- if neither a pipeline or a basic
Valve have been configured for this Containerjava.io.IOException
- if an input/output error occurred while
processingjavax.servlet.ServletException
- if a ServletException was thrown
while processing this requestpublic Container map(Request request, boolean update)
null
instead.Container
内の map
request
- Request being processedupdate
- Update the Request to reflect the mapping selection?public void removeChild(Container child)
Container
内の removeChild
child
- Existing child Container to be removedpublic void removeContainerListener(ContainerListener listener)
Container
内の removeContainerListener
listener
- The listener to removepublic void removeMapper(Mapper mapper)
Container
内の removeMapper
mapper
- The Mapper to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Container
内の removePropertyChangeListener
listener
- The listener to removepublic void addLifecycleListener(LifecycleListener listener)
Lifecycle
内の addLifecycleListener
listener
- The listener to addpublic void removeLifecycleListener(LifecycleListener listener)
Lifecycle
内の removeLifecycleListener
listener
- The listener to removepublic void start() throws LifecycleException
Lifecycle
内の start
java.lang.IllegalStateException
- if this component has already been
startedLifecycleException
- if this component detects a fatal error
that prevents it from being startedpublic void stop() throws LifecycleException
Lifecycle
内の stop
java.lang.IllegalStateException
- if this component has not been startedLifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void addValve(Valve valve)
setContainer
method must be called, with this Container
as an argument. The method may throw an
IllegalArgumentException
if this Valve chooses not to
be associated with this Container, or IllegalStateException
if it is already associated with a different Container.Pipeline
内の addValve
valve
- Valve to be addedjava.lang.IllegalArgumentException
- if this Container refused to
accept the specified Valvejava.lang.IllegalArgumentException
- if the specifie Valve refuses to be
associated with this Containerjava.lang.IllegalStateException
- if the specified Valve is already
associated with a different Containerpublic Valve getBasic()
Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).
Pipeline
内の getBasic
public Valve[] getValves()
Pipeline
内の getValves
public void removeValve(Valve valve)
Pipeline
内の removeValve
valve
- Valve to be removedpublic void setBasic(Valve valve)
Set the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any). Prioer to setting the basic Valve,
the Valve's setContainer()
will be called, if it
implements Contained
, with the owning Container as an
argument. The method may throw an IllegalArgumentException
if this Valve chooses not to be associated with this Container, or
IllegalStateException
if it is already associated with
a different Container.
Pipeline
内の setBasic
valve
- Valve to be distinguished as the basic Valveprotected void addDefaultMapper(java.lang.String mapperClass)
mapperClass
- Java class name of the default Mapperpublic void fireContainerEvent(java.lang.String type, java.lang.Object data)
type
- Event typedata
- Event dataprotected void log(java.lang.String message)
message
- Message to be loggedprotected void log(java.lang.String message, java.lang.Throwable throwable)
message
- Message to be loggedthrowable
- Related exceptionprotected java.lang.String logName()
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |