Apache Tomcat 6.0.41

org.apache.catalina.core
Class StandardEngine

java.lang.Object
  extended by org.apache.catalina.core.ContainerBase
      extended by org.apache.catalina.core.StandardEngine
All Implemented Interfaces:
java.io.Serializable, javax.management.MBeanRegistration, Container, Engine, Lifecycle, Pipeline

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.
You can set the jvmRoute direct or with the System.property jvmRoute.

Author:
Craig R. McClanahan
See Also:
Serialized Form

Nested Class Summary
protected static class StandardEngine.AccessLogListener
           
 
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
ContainerBase.ContainerBackgroundProcessor, ContainerBase.NoopAccessLog, ContainerBase.PrivilegedAddChild
 
Field Summary
 
Fields inherited from class org.apache.catalina.core.ContainerBase
accessLog, backgroundProcessorDelay, children, cluster, controller, domain, lifecycle, listeners, loader, logger, logName, manager, mserver, name, oname, parent, parentClassLoader, pipeline, realm, resources, sm, startChildren, started, suffix, support, type
 
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, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
StandardEngine()
          Create a new StandardEngine component with the default basic Valve.
 
Method Summary
 void addChild(Container child)
          Add a child Container, only if the proposed child is an implementation of Host.
 javax.management.ObjectName createObjectName(java.lang.String domain, javax.management.ObjectName parent)
           
 void destroy()
           
 java.lang.String getBaseDir()
           
 java.lang.String getDefaultHost()
          Return the default host.
 java.lang.String getDomain()
           
 java.lang.String getInfo()
          Return descriptive information about this Container implementation and the corresponding version number, in the format <description>/<version>.
 java.lang.String getJvmRoute()
          Retrieve the cluster-wide unique identifier for this Engine.
 java.lang.String getMbeansFile()
           
 javax.management.ObjectName getParentName()
           
 Realm getRealm()
          Provide a default in case no explicit configuration is set
 Service getService()
          Return the Service with which we are associated (if any).
 void init()
          Init method, part of the MBean lifecycle.
 void logAccess(Request request, Response response, long time, boolean useDefault)
          Override the default implementation.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setBaseDir(java.lang.String baseDir)
           
 void setDefaultHost(java.lang.String host)
          Set the default host.
 void setDomain(java.lang.String domain)
           
 void setJvmRoute(java.lang.String routeId)
          Set the cluster-wide unique identifier for this Engine.
 void setMbeansFile(java.lang.String mbeansFile)
           
 void setName(java.lang.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 the Service 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.
 java.lang.String toString()
          Return a String representation of this component.
 
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getBasic, getChildren, getCluster, getContainerSuffix, getFirst, getJmxName, getJSR77Suffix, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getResources, getStartChildren, getType, getValveObjectNames, getValves, invoke, logName, postDeregister, postRegister, preDeregister, removeChild, removeContainerListener, removeLifecycleListener, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCluster, setLoader, setManager, setParentClassLoader, setRealm, setResources, setStartChildren, 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, getAccessLog, getBackgroundProcessorDelay, getCluster, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getResources, invoke, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setParentClassLoader, setRealm, setResources
 

Constructor Detail

StandardEngine

public StandardEngine()
Create a new StandardEngine component with the default basic Valve.

Method Detail

getRealm

public Realm getRealm()
Provide a default in case no explicit configuration is set

Specified by:
getRealm in interface Container
Overrides:
getRealm in class ContainerBase
Returns:
configured realm, or a JAAS realm by default

getDefaultHost

public java.lang.String getDefaultHost()
Return the default host.

Specified by:
getDefaultHost in interface Engine

setDefaultHost

public void setDefaultHost(java.lang.String host)
Set the default host.

Specified by:
setDefaultHost in interface Engine
Parameters:
host - The new default host

setName

public void setName(java.lang.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 interface Container
Overrides:
setName in class ContainerBase
Parameters:
name - New name of this container

setJvmRoute

public void setJvmRoute(java.lang.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 interface Engine
Parameters:
routeId - the (new) JVM Route ID. Each Engine within a cluster must have a unique JVM Route ID.

getJvmRoute

public java.lang.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 interface Engine

getService

public Service getService()
Return the Service with which we are associated (if any).

Specified by:
getService in interface Engine

setService

public void setService(Service service)
Set the Service with which we are associated (if any).

Specified by:
setService in interface Engine
Parameters:
service - The service that owns this Engine

getMbeansFile

public java.lang.String getMbeansFile()

setMbeansFile

public void setMbeansFile(java.lang.String mbeansFile)

getBaseDir

public java.lang.String getBaseDir()

setBaseDir

public void setBaseDir(java.lang.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 interface Container
Overrides:
addChild in class ContainerBase
Parameters:
child - Child container to be added

getInfo

public java.lang.String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format <description>/<version>.

Specified by:
getInfo in interface Container
Overrides:
getInfo in class ContainerBase

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 interface Container
Overrides:
setParent in class ContainerBase
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 class ContainerBase

destroy

public void destroy()
             throws LifecycleException
Overrides:
destroy in class ContainerBase
Throws:
LifecycleException

start

public void start()
           throws LifecycleException
Start this Engine component.

Specified by:
start in interface Lifecycle
Overrides:
start in class ContainerBase
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 interface Lifecycle
Overrides:
stop in class ContainerBase
Throws:
LifecycleException - if this component detects a fatal error that needs to be reported

toString

public java.lang.String toString()
Return a String representation of this component.

Overrides:
toString in class java.lang.Object

logAccess

public void logAccess(Request request,
                      Response response,
                      long time,
                      boolean useDefault)
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 interface Container
Overrides:
logAccess in class ContainerBase
Parameters:
request - Request (associated with the response) to log
response - Response (associated with the request) to log
time - 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

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Overrides:
preRegister in class ContainerBase
Throws:
java.lang.Exception

getParentName

public javax.management.ObjectName getParentName()
                                          throws javax.management.MalformedObjectNameException
Overrides:
getParentName in class ContainerBase
Throws:
javax.management.MalformedObjectNameException

createObjectName

public javax.management.ObjectName createObjectName(java.lang.String domain,
                                                    javax.management.ObjectName parent)
                                             throws java.lang.Exception
Overrides:
createObjectName in class ContainerBase
Throws:
java.lang.Exception

getDomain

public java.lang.String getDomain()
Overrides:
getDomain in class ContainerBase

setDomain

public void setDomain(java.lang.String domain)
Overrides:
setDomain in class ContainerBase

Apache Tomcat 6.0.41

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.