FileDocCategorySizeDatePackage
Host.javaAPI DocGlassfish v2 API8184Fri May 04 22:31:52 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: 1.3 $ $Date: 2007/05/05 05:31:51 $

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 voidaddDefaultContext(DefaultContext defaultContext)
Set the DefaultContext for new web applications.

param
defaultContext The new DefaultContext

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 DefaultContextgetDefaultContext()
Retrieve the DefaultContext 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 int[]getPorts()
Gets the port numbers with which this Host is associated.

return
The port numbers with which this Host is associated, or null if this Host has not been associated with any ports

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 voidimportDefaultContext(Context context)
Import the DefaultContext config into a web application context.

param
context web application context to import default context

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 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 voidsetPorts(int[] ports)
Associates this Host with the given port numbers.

param
ports The port numbers with which to associate this Host

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