Apache Tomcat 6.0.53

org.apache.catalina
Interface Host

All Superinterfaces:
Container
All Known Implementing Classes:
StandardHost

public interface Host
extends Container

A Host is a Container that represents a virtual host in the Catalina servlet engine. It is useful in the following types of scenarios:

In general, you would not use a Host when deploying Catalina connected to a web server (such as Apache), because the Connector will have utilized the web server's facilities to determine which Context (or perhaps even which Wrapper) should be utilized to process this request.

The parent Container attached to a Host is generally an Engine, but may be some other implementation, or may be omitted if it is not necessary.

The child containers attached to a Host are generally implementations of Context (representing an individual servlet context).

Author:
Craig R. McClanahan

Field Summary
static java.lang.String ADD_ALIAS_EVENT
          The ContainerEvent event type sent when a new alias is added by addAlias().
static java.lang.String REMOVE_ALIAS_EVENT
          The ContainerEvent event type sent when an old alias is removed by removeAlias().
 
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
 
Method Summary
 void addAlias(java.lang.String alias)
          Add an alias name that should be mapped to this same Host.
 java.lang.String[] findAliases()
          Return the set of alias names for this Host.
 java.lang.String getAppBase()
          Return the application root for this Host.
 boolean getAutoDeploy()
          Return the value of the auto deploy flag.
 java.lang.String getConfigClass()
          Return the Java class name of the context configuration class for new web applications.
 java.lang.String getDeployIgnore()
          Return the regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.
 java.util.regex.Pattern getDeployIgnorePattern()
          Return the compiled regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.
 boolean getDeployOnStartup()
          Return the value of the deploy on startup flag.
 java.lang.String getName()
          Return the canonical, fully qualified, name of the virtual host this Container represents.
 boolean getXmlNamespaceAware()
          Will the parsing of the web.xml file for Contexts of this Host be performed by a namespace aware parser?
 boolean getXmlValidation()
          Will the parsing of the web.xml file and *.tld files for Contexts of this Host be performed by a validating parser?
 Context map(java.lang.String uri)
          Return the Context that would be used to process the specified host-relative request URI, if any; otherwise return null.
 void removeAlias(java.lang.String alias)
          Remove the specified alias name from the aliases for this Host.
 void setAppBase(java.lang.String appBase)
          Set the application root for this Host.
 void setAutoDeploy(boolean autoDeploy)
          Set the auto deploy flag value for this host.
 void setConfigClass(java.lang.String configClass)
          Set the Java class name of the context configuration class for new web applications.
 void setDeployIgnore(java.lang.String deployIgnore)
          Set the regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.
 void setDeployOnStartup(boolean deployOnStartup)
          Set the deploy on startup flag value for this host.
 void setName(java.lang.String name)
          Set the canonical, fully qualified, name of the virtual host this Container represents.
 void setXmlNamespaceAware(boolean xmlNamespaceAware)
          Controls whether the parsing of the web.xml file for Contexts of this Host will be performed by a namespace aware parser.
 void setXmlValidation(boolean xmlValidation)
          Controls whether the parsing of the web.xml file and *.tld files for Contexts of this Host will be performed by a validating parser.
 
Methods inherited from interface org.apache.catalina.Container
addChild, addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, getAccessLog, getBackgroundProcessorDelay, getCluster, getInfo, getLoader, getLogger, getManager, getMappingObject, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, invoke, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setParent, setParentClassLoader, setRealm, setResources
 

Field Detail

ADD_ALIAS_EVENT

static final java.lang.String ADD_ALIAS_EVENT
The ContainerEvent event type sent when a new alias is added by addAlias().

See Also:
Constant Field Values

REMOVE_ALIAS_EVENT

static final java.lang.String REMOVE_ALIAS_EVENT
The ContainerEvent event type sent when an old alias is removed by removeAlias().

See Also:
Constant Field Values
Method Detail

getAppBase

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


setAppBase

void setAppBase(java.lang.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

getAutoDeploy

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


setAutoDeploy

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

Parameters:
autoDeploy - The new auto deploy flag

getConfigClass

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


setConfigClass

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

Parameters:
configClass - The new context configuration class

getDeployOnStartup

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.


setDeployOnStartup

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

Parameters:
deployOnStartup - The new deploy on startup flag

getName

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

Specified by:
getName in interface Container

setName

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

Specified by:
setName in interface Container
Parameters:
name - Virtual host name
Throws:
java.lang.IllegalArgumentException - if name is null

getXmlNamespaceAware

boolean getXmlNamespaceAware()
Will the parsing of the web.xml file for Contexts of this Host be performed by a namespace aware parser? If false it may still be enabled per Context using Context.setXmlNamespaceAware(boolean).

Returns:
true if namespace awareness is enabled.

getXmlValidation

boolean getXmlValidation()
Will the parsing of the web.xml file and *.tld files for Contexts of this Host be performed by a validating parser? If false it may still be enabled per Context using Context.setXmlValidation(boolean).

Returns:
true if validation is enabled.

setXmlValidation

void setXmlValidation(boolean xmlValidation)
Controls whether the parsing of the web.xml file and *.tld files for Contexts of this Host will be performed by a validating parser. If false it may still be enabled per Context using Context.setXmlValidation(boolean).

Parameters:
xmlValidation - true to enable xml validation

setXmlNamespaceAware

void setXmlNamespaceAware(boolean xmlNamespaceAware)
Controls whether the parsing of the web.xml file for Contexts of this Host will be performed by a namespace aware parser. If false it may still be enabled per Context using Context.setXmlNamespaceAware(boolean).

Parameters:
xmlNamespaceAware - true to enable namespace awareness

getDeployIgnore

java.lang.String getDeployIgnore()
Return the regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.


getDeployIgnorePattern

java.util.regex.Pattern getDeployIgnorePattern()
Return the compiled regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.


setDeployIgnore

void setDeployIgnore(java.lang.String deployIgnore)
Set the regular expression that defines the files and directories in the host's getAppBase() that will be ignored by the automatic deployment process.


addAlias

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

Parameters:
alias - The alias to be added

findAliases

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


map

Context map(java.lang.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

removeAlias

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

Parameters:
alias - Alias name to be removed

Apache Tomcat 6.0.53

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