Package org.apache.catalina.core
Class StandardEngine
- java.lang.Object
-
- org.apache.catalina.core.ContainerBase
-
- org.apache.catalina.core.StandardEngine
-
public class StandardEngine extends ContainerBase implements Engine
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.- Version:
- $Revision: 1.5 $ $Date: 2006/03/12 01:27:01 $
- Author:
- Craig R. McClanahan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.core.ContainerBase
backgroundProcessorDelay, checkIfRequestIsSecure, children, controller, debug, domain, hasCustomPipeline, initialized, lifecycle, listeners, loader, log, logger, manager, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, rb, readLock, realm, resources, started, support, writeLock
-
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description StandardEngine()
Create a new StandardEngine component with the default basic Valve.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(Container child)
Add a child Container, only if the proposed child is an implementation of Host.ObjectName
createObjectName(String domain, ObjectName parent)
void
destroy()
Stops the component and any children and removes all listenersString
getBaseDir()
String
getDefaultHost()
Return the default host.String
getDomain()
String
getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>
.String
getJvmRoute()
Retrieve the cluster-wide unique identifier for this Engine.ObjectName
getParentName()
Gets the name of the parent containerRealm
getRealm()
Provide a default in case no explicit configuration is setService
getService()
Return theService
with which we are associated (if any).void
init()
Init method, part of the MBean lifecycle.void
setBaseDir(String baseDir)
void
setDefaultHost(String host)
Set the default host.void
setDomain(String domain)
void
setJvmRoute(String routeId)
Set the cluster-wide unique identifier for this Engine.void
setName(String name)
Set a name string (suitable for use by humans) that describes this Container.void
setParent(Container container)
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).void
start()
Start this Engine component.void
stop()
Gracefully shut down active use of the public methods of this Component.String
toString()
Return a String representation of this component.-
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, addValve, backgroundProcess, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getContainerSuffix, getDebug, getJmxName, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getResources, getValveObjectNames, getValves, hasCustomPipeline, hasNonBasicValves, invoke, isCheckIfRequestIsSecure, log, log, logName, removeChild, removeContainerListener, removeLifecycleListener, removeLifecycleListeners, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCheckIfRequestIsSecure, setDebug, setLoader, setLogger, setManager, setParentClassLoader, setRealm, setResources, startChildren, threadStart, threadStop
-
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, getBackgroundProcessorDelay, getLoader, getLogger, getManager, getMappingObject, getName, getParent, getParentClassLoader, getPipeline, getResources, hasCustomPipeline, invoke, isCheckIfRequestIsSecure, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCheckIfRequestIsSecure, setLoader, setLogger, setManager, setParentClassLoader, setRealm, setResources
-
-
-
-
Method Detail
-
getRealm
public Realm getRealm()
Provide a default in case no explicit configuration is set- Specified by:
getRealm
in interfaceContainer
- Overrides:
getRealm
in classContainerBase
- Returns:
- configured realm, or a JAAS realm by default
-
getDefaultHost
public String getDefaultHost()
Return the default host.- Specified by:
getDefaultHost
in interfaceEngine
-
setDefaultHost
public void setDefaultHost(String host)
Set the default host.- Specified by:
setDefaultHost
in interfaceEngine
- Parameters:
host
- The new default host
-
setName
public void setName(String name)
Description copied from class:ContainerBase
Set a name string (suitable for use by humans) that describes this Container. Within the set of child containers belonging to a particular parent, Container names must be unique.- Specified by:
setName
in interfaceContainer
- Overrides:
setName
in classContainerBase
- Parameters:
name
- New name of this container
-
setJvmRoute
public void setJvmRoute(String routeId)
Set the cluster-wide unique identifier for this Engine. This value is only useful in a load-balancing scenario.This property should not be changed once it is set.
- 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
public String getJvmRoute()
Retrieve the cluster-wide unique identifier for this Engine. This value is only useful in a load-balancing scenario.- Specified by:
getJvmRoute
in interfaceEngine
-
getService
public Service getService()
Return theService
with which we are associated (if any).- Specified by:
getService
in interfaceEngine
-
setService
public void setService(Service service)
Set theService
with which we are associated (if any).- Specified by:
setService
in interfaceEngine
- Parameters:
service
- The service that owns this Engine
-
getBaseDir
public String getBaseDir()
-
setBaseDir
public void setBaseDir(String baseDir)
-
addChild
public void addChild(Container child)
Add a child Container, only if the proposed child is an implementation of Host.- Specified by:
addChild
in interfaceContainer
- Overrides:
addChild
in classContainerBase
- Parameters:
child
- Child container to be added
-
getInfo
public String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>
.- Specified by:
getInfo
in interfaceContainer
- Overrides:
getInfo
in classContainerBase
-
setParent
public void setParent(Container container)
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
-
init
public void init()
Description copied from class:ContainerBase
Init method, part of the MBean lifecycle. If the container was added via JMX, it'll register itself with the parent, using the ObjectName conventions to locate the parent. If the container was added directly and it doesn't have an ObjectName, it'll create a name and register itself with the JMX console. On destroy(), the object will unregister.- Overrides:
init
in classContainerBase
-
destroy
public void destroy() throws Exception
Description copied from class:ContainerBase
Stops the component and any children and removes all listeners- Overrides:
destroy
in classContainerBase
- Throws:
Exception
-
start
public void start() throws LifecycleException
Start this Engine component.- Specified by:
start
in interfaceLifecycle
- Overrides:
start
in classContainerBase
- Throws:
LifecycleException
- if a startup error occurs
-
stop
public void stop() throws LifecycleException
Description copied from class:ContainerBase
Gracefully shut down active use of the public methods of this Component.- Specified by:
stop
in interfaceLifecycle
- Overrides:
stop
in classContainerBase
- Throws:
LifecycleException
- if this component detects a fatal error that needs to be reported
-
toString
public String toString()
Return a String representation of this component.
-
getParentName
public ObjectName getParentName() throws MalformedObjectNameException
Description copied from class:ContainerBase
Gets the name of the parent container- Overrides:
getParentName
in classContainerBase
- Returns:
- null if no parent
- Throws:
MalformedObjectNameException
-
createObjectName
public ObjectName createObjectName(String domain, ObjectName parent) throws Exception
- Overrides:
createObjectName
in classContainerBase
- Throws:
Exception
-
getDomain
public String getDomain()
- Overrides:
getDomain
in classContainerBase
-
setDomain
public void setDomain(String domain)
- Overrides:
setDomain
in classContainerBase
-
-