Apache Tomcat 7.0.0

org.apache.catalina.core
Class StandardEngine

java.lang.Object
  extended by org.apache.catalina.util.LifecycleBase
      extended by org.apache.catalina.util.LifecycleMBeanBase
          extended by org.apache.catalina.core.ContainerBase
              extended by org.apache.catalina.core.StandardEngine
All Implemented Interfaces:
MBeanRegistration, Container, Engine, Lifecycle

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.

Version:
$Id: StandardEngine.java 952295 2010-06-07 16:03:38Z markt $
Author:
Craig R. McClanahan

Nested Class Summary
 
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, listeners, loader, logger, logName, manager, name, parent, parentClassLoader, pipeline, realm, resources, sm, startChildren, support
 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase
mserver
 
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, CONFIGURE_START_EVENT, CONFIGURE_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.
 String getBaseDir()
           
 String getDefaultHost()
          Return the default host.
 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.
protected  String getObjectNameKeyProperties()
          Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.
 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 logAccess(Request request, Response response, long time, boolean useDefault)
          Override the default implementation.
 void setBaseDir(String baseDir)
           
 void setDefaultHost(String host)
          Set the default host.
 void setJvmRoute(String routeId)
          Set the cluster-wide unique identifier for this Engine.
 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).
protected  void startInternal()
          Start this component and implement the requirements of LifecycleBase.startInternal().
 String toString()
          Return a String representation of this component.
 
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addPropertyChangeListener, addValve, backgroundProcess, destroyInternal, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getChildren, getCluster, getDomainInternal, getLoader, getLogger, getManager, getMappingObject, getName, getParent, getParentClassLoader, getPipeline, getResources, getStartChildren, invoke, logName, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setName, setParentClassLoader, setRealm, setResources, setStartChildren, stopInternal, threadStart, threadStop
 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
getDomain, getObjectName, initInternal, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, init, removeLifecycleListener, setState, setState, 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, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getResources, invoke, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setName, setParentClassLoader, setRealm, setResources
 
Methods inherited from interface org.apache.catalina.Lifecycle
addLifecycleListener, destroy, findLifecycleListeners, getState, init, removeLifecycleListener, start, stop
 

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 String getDefaultHost()
Return the default host.

Specified by:
getDefaultHost in interface Engine

setDefaultHost

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

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

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 interface Engine
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 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

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

startInternal

protected void startInternal()
                      throws LifecycleException
Start this component and implement the requirements of LifecycleBase.startInternal().

Overrides:
startInternal in class ContainerBase
Throws:
LifecycleException - if this component detects a fatal error that prevents this component from being used

toString

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

Overrides:
toString in class 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

getObjectNameKeyProperties

protected String getObjectNameKeyProperties()
Description copied from class: LifecycleMBeanBase
Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

Specified by:
getObjectNameKeyProperties in class LifecycleMBeanBase
Returns:
The string representation of the key properties component of the desired

Apache Tomcat 7.0.0

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