org.apache.catalina

Interface Host

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).

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

Author: Craig R. McClanahan

Field Summary
static StringADD_ALIAS_EVENT
The ContainerEvent event type sent when a new alias is added by addAlias().
static StringREMOVE_ALIAS_EVENT
The ContainerEvent event type sent when an old alias is removed by removeAlias().
Method Summary
voidaddAlias(String alias)
Add an alias name that should be mapped to this same Host.
String[]findAliases()
Return the set of alias names for this Host.
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.
booleangetDeployOnStartup()
Return the value of the deploy on startup flag.
StringgetName()
Return the canonical, fully qualified, name of the virtual host this Container represents.
booleangetXmlNamespaceAware()
Get the server.xml <host> attribute's xmlNamespaceAware.
booleangetXmlValidation()
Get the server.xml <host> attribute's xmlValidation.
Contextmap(String uri)
Return the Context that would be used to process the specified host-relative request URI, if any; otherwise return null.
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.
voidsetDeployOnStartup(boolean deployOnStartup)
Set the deploy on startup flag value for this host.
voidsetName(String name)
Set the canonical, fully qualified, name of the virtual host this Container represents.
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.

Field Detail

ADD_ALIAS_EVENT

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

REMOVE_ALIAS_EVENT

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

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

findAliases

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

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 should be discovred and automatically deployed dynamically.

getConfigClass

public String getConfigClass()
Return the Java class name of the context configuration 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.

getName

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

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.

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

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

setDeployOnStartup

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

Parameters: deployOnStartup The new deploy on startup 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

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

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