Package org.apache.catalina.core
Class StandardEngine
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.core.ContainerBase
org.apache.catalina.core.StandardEngine
- All Implemented Interfaces:
MBeanRegistration
,Container
,Engine
,JmxEnabled
,Lifecycle
Standard implementation of the Engine interface. Each child container must be a Host implementation to process
the specific fully qualified host name of that virtual host.
- Author:
- Craig R. McClanahan
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
protected static final class
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
ContainerBase.ContainerBackgroundProcessor, ContainerBase.ContainerBackgroundProcessorMonitor
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Fields inherited from class org.apache.catalina.core.ContainerBase
accessLog, backgroundProcessorDelay, backgroundProcessorFuture, children, cluster, listeners, logger, logName, monitorFuture, name, parent, parentClassLoader, pipeline, sm, startChildren, startStopExecutor, support
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_VALVE_EVENT
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
Constructor Summary
ConstructorDescriptionCreate a new StandardEngine component with the default basic Valve. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new child Container to those associated with this Container, if supported.Obtain the location of CATALINA_BASE.Obtain the location of CATALINA_HOME.protected String
Method implemented by sub-classes to identify the domain in which MBeans should be registered.protected String
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.Get the parent class loader.getRealm()
Obtain the Realm with which this Container is associated.protected void
Sub-classes implement this method to perform any instance initialisation required.void
Log a request/response that was destined for this container but has been handled earlier in the processing chain so that the request/response still appears in the correct access logs.void
setDefaultHost
(String host) Set the default hostname for this Engine.void
setJvmRoute
(String routeId) Set the JvmRouteId for this engine.void
Disallow any attempt to set a parent for this Container, since an Engine is supposed to be at the top of the Container hierarchy.void
setService
(Service service) Set theService
with which we are associated (if any).protected void
Start this component and implement the requirements ofLifecycleBase.startInternal()
.Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addPropertyChangeListener, addValve, backgroundProcess, destroyInternal, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getChildren, getCluster, getClusterInternal, getLogger, getLogName, getMBeanKeyProperties, getName, getParent, getPipeline, getRealmInternal, getStartChildren, getStartStopThreads, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartChildren, setStartStopThreads, stopInternal, threadStart, threadStop, toString
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.catalina.Container
addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCluster, getDomain, getLogger, getLogName, getMBeanKeyProperties, getName, getObjectName, getParent, getPipeline, getStartStopThreads, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartStopThreads
Methods inherited from interface org.apache.catalina.Lifecycle
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
-
Constructor Details
-
StandardEngine
public StandardEngine()Create a new StandardEngine component with the default basic Valve.
-
-
Method Details
-
getRealm
Description copied from interface:Container
Obtain the Realm with which this Container is associated.- Specified by:
getRealm
in interfaceContainer
- Overrides:
getRealm
in classContainerBase
- Returns:
- The associated Realm; if there is no associated Realm, the Realm associated with the parent Container (if
any); otherwise return
null
.
-
getDefaultHost
- Specified by:
getDefaultHost
in interfaceEngine
- Returns:
- the default host name for this Engine.
-
setDefaultHost
Description copied from interface:Engine
Set the default hostname for this Engine.- Specified by:
setDefaultHost
in interfaceEngine
- Parameters:
host
- The new default host
-
setJvmRoute
Description copied from interface:Engine
Set the JvmRouteId for this engine.- Specified by:
setJvmRoute
in interfaceEngine
- Parameters:
routeId
- the (new) JVM Route ID. Each Engine within a cluster must have a unique JVM Route ID.
-
getJvmRoute
- Specified by:
getJvmRoute
in interfaceEngine
- Returns:
- the JvmRouteId for this engine.
-
getService
- Specified by:
getService
in interfaceEngine
- Returns:
- the
Service
with which we are associated (if any).
-
setService
Description copied from interface:Engine
Set theService
with which we are associated (if any).- Specified by:
setService
in interfaceEngine
- Parameters:
service
- The service that owns this Engine
-
addChild
Add a new child Container to those associated with this Container, if supported. Prior to adding this Container to the set of children, the child'ssetParent()
method must be called, with this Container as an argument. This method may thrown anIllegalArgumentException
if this Container chooses not to be attached to the specified Container, in which case it is not addedThe child must be an implementation of
Host
.- Specified by:
addChild
in interfaceContainer
- Overrides:
addChild
in classContainerBase
- Parameters:
child
- New child Container to be added
-
setParent
Disallow any attempt to set a parent for this Container, since an Engine is supposed to be at the top of the Container hierarchy.- Specified by:
setParent
in interfaceContainer
- Overrides:
setParent
in classContainerBase
- Parameters:
container
- Proposed parent Container
-
initInternal
Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance initialisation required.- Overrides:
initInternal
in classLifecycleMBeanBase
- Throws:
LifecycleException
- If the initialisation fails
-
startInternal
Description copied from class:ContainerBase
Start this component and implement the requirements ofLifecycleBase.startInternal()
.- Overrides:
startInternal
in classContainerBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
logAccess
Log a request/response that was destined for this container but has been handled earlier in the processing chain so that the request/response still appears in the correct access logs.Override the default implementation. If no access log is defined for the Engine, look for one in the Engine's default host and then the default host's ROOT context. If still none is found, return the default NoOp access log.
- Specified by:
logAccess
in interfaceContainer
- Overrides:
logAccess
in classContainerBase
- Parameters:
request
- Request (associated with the response) to logresponse
- Response (associated with the request) to logtime
- Time taken to process the request/response in milliseconds (use 0 if not known)useDefault
- Flag that indicates that the request/response should be logged in the engine's default access log
-
getParentClassLoader
Description copied from interface:Container
Get the parent class loader.- Specified by:
getParentClassLoader
in interfaceContainer
- Overrides:
getParentClassLoader
in classContainerBase
- Returns:
- the parent class loader for this component. If not set, return
Container.getParent()
.Container.getParentClassLoader()
. If no parent has been set, return the system class loader.
-
getCatalinaBase
Description copied from interface:Container
Obtain the location of CATALINA_BASE.- Specified by:
getCatalinaBase
in interfaceContainer
- Overrides:
getCatalinaBase
in classContainerBase
- Returns:
- The location of CATALINA_BASE.
-
getCatalinaHome
Description copied from interface:Container
Obtain the location of CATALINA_HOME.- Specified by:
getCatalinaHome
in interfaceContainer
- Overrides:
getCatalinaHome
in classContainerBase
- Returns:
- The location of CATALINA_HOME.
-
getObjectNameKeyProperties
Description copied from class:LifecycleMBeanBase
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.- Specified by:
getObjectNameKeyProperties
in classLifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the desired
ObjectName
-
getDomainInternal
Description copied from class:LifecycleMBeanBase
Method implemented by sub-classes to identify the domain in which MBeans should be registered.- Overrides:
getDomainInternal
in classContainerBase
- Returns:
- The name of the domain to use to register MBeans.
-