org.apache.catalina.core

Class StandardHost

public class StandardHost extends ContainerBase implements Host

Standard implementation of the Host interface. Each child container must be a Context implementation to process the requests directed to a particular web application.

Version: $Revision: 784615 $ $Date: 2009-06-14 22:39:30 +0200 (Sun, 14 Jun 2009) $

Author: Craig R. McClanahan Remy Maucherat

Constructor Summary
StandardHost()
Create a new StandardHost component with the default basic Valve.
Method Summary
voidaddAlias(String alias)
Add an alias name that should be mapped to this same Host.
voidaddChild(Container child)
Add a child Container, only if the proposed child is an implementation of Context.
ObjectNamecreateObjectName(String domain, ObjectName parent)
voiddestroy()
String[]findAliases()
Return the set of alias names for this Host.
String[]getAliases()
StringgetAppBase()
Return the application root for this Host.
booleangetAutoDeploy()
Return the value of the auto deploy flag.
StringgetConfigClass()
Return the Java class name of the context configuration class for new web applications.
StringgetContextClass()
Return the Java class name of the Context implementation class for new web applications.
booleangetDeployOnStartup()
Return the value of the deploy on startup flag.
StringgetErrorReportValveClass()
Return the Java class name of the error report valve class for new web applications.
StringgetInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format <description>/<version>.
booleangetLiveDeploy()
Return the value of the live deploy flag.
StringgetName()
Return the canonical, fully qualified, name of the virtual host this Container represents.
String[]getValveNames()
Return the MBean Names of the Valves assoicated with this Host
StringgetWorkDir()
Host work directory base.
booleangetXmlNamespaceAware()
Get the server.xml <host> attribute's xmlNamespaceAware.
booleangetXmlValidation()
Get the server.xml <host> attribute's xmlValidation.
voidinit()
booleanisDeployXML()
Deploy XML Context config files flag accessor.
booleanisUnpackWARs()
Unpack WARs flag accessor.
Contextmap(String uri)
Return the Context that would be used to process the specified host-relative request URI, if any; otherwise return null.
ObjectNamepreRegister(MBeanServer server, ObjectName oname)
voidremoveAlias(String alias)
Remove the specified alias name from the aliases for this Host.
voidsetAppBase(String appBase)
Set the application root for this Host.
voidsetAutoDeploy(boolean autoDeploy)
Set the auto deploy flag value for this host.
voidsetConfigClass(String configClass)
Set the Java class name of the context configuration class for new web applications.
voidsetContextClass(String contextClass)
Set the Java class name of the Context implementation class for new web applications.
voidsetDeployOnStartup(boolean deployOnStartup)
Set the deploy on startup flag value for this host.
voidsetDeployXML(boolean deployXML)
Deploy XML Context config files flag mutator.
voidsetErrorReportValveClass(String errorReportValveClass)
Set the Java class name of the error report valve class for new web applications.
voidsetLiveDeploy(boolean liveDeploy)
Set the live deploy flag value for this host.
voidsetName(String name)
Set the canonical, fully qualified, name of the virtual host this Container represents.
voidsetUnpackWARs(boolean unpackWARs)
Unpack WARs flag mutator.
voidsetWorkDir(String workDir)
Host work directory base.
voidsetXmlNamespaceAware(boolean xmlNamespaceAware)
Set the namespace aware feature of the XML parser used when parsing xml instances.
voidsetXmlValidation(boolean xmlValidation)
Set the validation feature of the XML parser used when parsing xml instances.
voidstart()
Start this host.
StringtoString()
Return a String representation of this component.

Constructor Detail

StandardHost

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

Method Detail

addAlias

public void addAlias(String alias)
Add an alias name that should be mapped to this same Host.

Parameters: alias The alias to be added

addChild

public void addChild(Container child)
Add a child Container, only if the proposed child is an implementation of Context.

Parameters: child Child container to be added

createObjectName

public ObjectName createObjectName(String domain, ObjectName parent)

destroy

public void destroy()

findAliases

public String[] findAliases()
Return the set of alias names for this Host. If none are defined, a zero length array is returned.

getAliases

public String[] getAliases()

getAppBase

public String getAppBase()
Return the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.

getAutoDeploy

public boolean getAutoDeploy()
Return the value of the auto deploy flag. If true, it indicates that this host's child webapps will be dynamically deployed.

getConfigClass

public String getConfigClass()
Return the Java class name of the context configuration class for new web applications.

getContextClass

public String getContextClass()
Return the Java class name of the Context implementation class for new web applications.

getDeployOnStartup

public boolean getDeployOnStartup()
Return the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be discovred and automatically deployed at startup time.

getErrorReportValveClass

public String getErrorReportValveClass()
Return the Java class name of the error report valve class for new web applications.

getInfo

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

getLiveDeploy

public boolean getLiveDeploy()
Return the value of the live deploy flag. If true, it indicates that a background thread should be started that looks for web application context files, WAR files, or unpacked directories being dropped in to the appBase directory, and deploys new ones as they are encountered.

getName

public String getName()
Return the canonical, fully qualified, name of the virtual host this Container represents.

getValveNames

public String[] getValveNames()
Return the MBean Names of the Valves assoicated with this Host

Throws: Exception if an MBean cannot be created or registered

getWorkDir

public String getWorkDir()
Host work directory base.

getXmlNamespaceAware

public boolean getXmlNamespaceAware()
Get the server.xml <host> attribute's xmlNamespaceAware.

Returns: true if namespace awarenes is enabled.

getXmlValidation

public boolean getXmlValidation()
Get the server.xml <host> attribute's xmlValidation.

Returns: true if validation is enabled.

init

public void init()

isDeployXML

public boolean isDeployXML()
Deploy XML Context config files flag accessor.

isUnpackWARs

public boolean isUnpackWARs()
Unpack WARs flag accessor.

map

public Context map(String uri)
Return the Context that would be used to process the specified host-relative request URI, if any; otherwise return null.

Parameters: uri Request URI to be mapped

preRegister

public ObjectName preRegister(MBeanServer server, ObjectName oname)

removeAlias

public void removeAlias(String alias)
Remove the specified alias name from the aliases for this Host.

Parameters: alias Alias name to be removed

setAppBase

public void setAppBase(String appBase)
Set the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.

Parameters: appBase The new application root

setAutoDeploy

public void setAutoDeploy(boolean autoDeploy)
Set the auto deploy flag value for this host.

Parameters: autoDeploy The new auto deploy flag

setConfigClass

public void setConfigClass(String configClass)
Set the Java class name of the context configuration class for new web applications.

Parameters: configClass The new context configuration class

setContextClass

public void setContextClass(String contextClass)
Set the Java class name of the Context implementation class for new web applications.

Parameters: contextClass The new context implementation class

setDeployOnStartup

public void setDeployOnStartup(boolean deployOnStartup)
Set the deploy on startup flag value for this host.

Parameters: deployOnStartup The new deploy on startup flag

setDeployXML

public void setDeployXML(boolean deployXML)
Deploy XML Context config files flag mutator.

setErrorReportValveClass

public void setErrorReportValveClass(String errorReportValveClass)
Set the Java class name of the error report valve class for new web applications.

Parameters: errorReportValveClass The new error report valve class

setLiveDeploy

public void setLiveDeploy(boolean liveDeploy)
Set the live deploy flag value for this host.

Parameters: liveDeploy The new live deploy flag

setName

public void setName(String name)
Set the canonical, fully qualified, name of the virtual host this Container represents.

Parameters: name Virtual host name

Throws: IllegalArgumentException if name is null

setUnpackWARs

public void setUnpackWARs(boolean unpackWARs)
Unpack WARs flag mutator.

setWorkDir

public void setWorkDir(String workDir)
Host work directory base.

setXmlNamespaceAware

public void setXmlNamespaceAware(boolean xmlNamespaceAware)
Set the namespace aware feature of the XML parser used when parsing xml instances.

Parameters: xmlNamespaceAware true to enable namespace awareness

setXmlValidation

public void setXmlValidation(boolean xmlValidation)
Set the validation feature of the XML parser used when parsing xml instances.

Parameters: xmlValidation true to enable xml instance validation

start

public void start()
Start this host.

Throws: LifecycleException if this component detects a fatal error that prevents it from being started

toString

public String toString()
Return a String representation of this component.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.