FileDocCategorySizeDatePackage
Host.javaAPI DocApache Tomcat 6.0.146551Fri Jul 20 04:20:34 BST 2007org.apache.catalina

Host

public interface Host implements 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:
  • You wish to use Interceptors that see every single request processed by this particular virtual host.
  • You wish to run Catalina in with a standalone HTTP connector, but still want support for multiple virtual hosts.
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
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static final String
ADD_ALIAS_EVENT
The ContainerEvent event type sent when a new alias is added by addAlias().
public static final String
REMOVE_ALIAS_EVENT
The ContainerEvent event type sent when an old alias is removed by removeAlias().
Constructors Summary
Methods Summary
public voidaddAlias(java.lang.String alias)
Add an alias name that should be mapped to this same Host.

param
alias The alias to be added

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

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

public booleangetAutoDeploy()
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.

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

public booleangetDeployOnStartup()
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.

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

public booleangetXmlNamespaceAware()
Get the server.xml attribute's xmlNamespaceAware.

return
true if namespace awarenes is enabled.

public booleangetXmlValidation()
Get the server.xml attribute's xmlValidation.

return
true if validation is enabled.

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

param
uri Request URI to be mapped

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

param
alias Alias name to be removed

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

param
appBase The new application root

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

param
autoDeploy The new auto deploy flag

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

param
configClass The new context configuration class

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

param
deployOnStartup The new deploy on startup flag

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

param
name Virtual host name
exception
IllegalArgumentException if name is null

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

param
xmlNamespaceAware true to enable namespace awareness

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

param
xmlValidation true to enable xml instance validation