org.apache.catalina.core

Class StandardEngine

Implemented Interfaces:
Container, Engine, Lifecycle, MBeanRegistration, Pipeline, Serializable

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.24 $ $Date: 2004/02/27 14:58:42 $

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, children, cluster, controller, debug, domain, initialized, lifecycle, listeners, loader, logger, manager, mserver, name, oname, parent, parentClassLoader, pipeline, realm, resources, sm, 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, 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.
void
addDefaultContext(DefaultContext defaultContext)
Set the DefaultContext for new web applications.
ObjectName
createObjectName(String domain, ObjectName parent)
void
destroy()
String
getBaseDir()
DefaultContext
getDefaultContext()
Retrieve the DefaultContext for new web applications.
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.
String
getMbeansFile()
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
importDefaultContext(Context context)
Import the DefaultContext config into a web application context.
void
init()
void
installDefaultContext(Context context)
Install the StandardContext portion of the DefaultContext configuration into current Context.
ObjectName
preRegister(MBeanServer server, ObjectName name)
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
setMbeansFile(String mbeansFile)
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 the Service with which we are associated (if any).
void
start()
Start this Engine component.
void
stop()
String
toString()
Return a String representation of this component.

Methods inherited from class org.apache.catalina.core.ContainerBase

addChild, addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, createObjectName, destroy, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getCluster, getContainerSuffix, getDebug, getDomain, getInfo, getJSR77Suffix, getJmxName, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getParentName, getPipeline, getRealm, getResources, getType, getValveObjectNames, getValves, init, invoke, log, log, logName, postDeregister, postRegister, preDeregister, preRegister, removeChild, removeContainerListener, removeLifecycleListener, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCluster, setDebug, setDomain, setLoader, setLogger, setManager, setName, setParent, setParentClassLoader, setRealm, setResources, start, stop, threadStart, threadStop

Constructor Details

StandardEngine

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

Method Details

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

Parameters:
child - Child container to be added


addDefaultContext

public void addDefaultContext(DefaultContext defaultContext)
Set the DefaultContext for new web applications.
Specified by:
addDefaultContext in interface Engine

Parameters:
defaultContext - The new DefaultContext


createObjectName

public ObjectName createObjectName(String domain,
                                   ObjectName parent)
            throws Exception
Overrides:
createObjectName in interface ContainerBase


destroy

public void destroy()
            throws LifecycleException
Overrides:
destroy in interface ContainerBase


getBaseDir

public String getBaseDir()


getDefaultContext

public DefaultContext getDefaultContext()
Retrieve the DefaultContext for new web applications.
Specified by:
getDefaultContext in interface Engine


getDefaultHost

public String getDefaultHost()
Return the default host.
Specified by:
getDefaultHost in interface Engine


getDomain

public String getDomain()
Overrides:
getDomain in interface ContainerBase


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


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


getMbeansFile

public String getMbeansFile()


getParentName

public ObjectName getParentName()
            throws MalformedObjectNameException
Overrides:
getParentName in interface ContainerBase


getRealm

public Realm getRealm()
Provide a default in case no explicit configuration is set
Specified by:
getRealm in interface Container
Overrides:
getRealm in interface ContainerBase

Returns:
configured realm, or a JAAS realm by default


getService

public Service getService()
Return the Service with which we are associated (if any).
Specified by:
getService in interface Engine


importDefaultContext

public void importDefaultContext(Context context)
Import the DefaultContext config into a web application context.
Specified by:
importDefaultContext in interface Engine

Parameters:
context - web application context to import default context


init

public void init()
Overrides:
init in interface ContainerBase


installDefaultContext

public void installDefaultContext(Context context)
Install the StandardContext portion of the DefaultContext configuration into current Context.

Parameters:
context - current web application context


preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
            throws Exception
Overrides:
preRegister in interface ContainerBase


setBaseDir

public void setBaseDir(String baseDir)


setDefaultHost

public void setDefaultHost(String host)
Set the default host.
Specified by:
setDefaultHost in interface Engine

Parameters:
host - The new default host


setDomain

public void setDomain(String domain)
Overrides:
setDomain in interface ContainerBase


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


setMbeansFile

public void setMbeansFile(String mbeansFile)


setName

public void setName(String name)
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 interface ContainerBase

Parameters:
name - New name of this container


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

Parameters:
container - Proposed parent Container


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


start

public void start()
            throws LifecycleException
Start this Engine component.
Specified by:
start in interface Lifecycle
Overrides:
start in interface ContainerBase

Throws:
LifecycleException - if a startup error occurs


stop

public void stop()
            throws LifecycleException
Specified by:
stop in interface Lifecycle
Overrides:
stop in interface ContainerBase


toString

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


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.