Top Description Fields Methods
org.apache.catalina

public Interface Host

extends Container
Known Direct Implementers
org.apache.catalina.core.StandardHost
Imports
java.io.File, java.util.concurrent.ExecutorService, java.util.regex.Pattern

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

Modifier and TypeField and Description
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().

Inherited from org.apache.catalina.Container:
ADD_CHILD_EVENTADD_VALVE_EVENTREMOVE_CHILD_EVENTREMOVE_VALVE_EVENT

Method Summary

Modifier and TypeMethod and Description
public void
addAlias(String
The alias to be added
alias
)

Add an alias name that should be mapped to this same Host.

public String[]

Returns:

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

public String

Returns:

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

public File

Returns:

an absolute File for the appBase of this Host. The file will be canonical if possible. There is no guarantee that that the appBase exists.
getAppBaseFile
()

public boolean

Returns:

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

public File

Returns:

a default configuration path of this Host. The file will be canonical if possible.
getConfigBaseFile
()

public String

Returns:

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

public boolean

Returns:

true if the Host will attempt to create directories
getCreateDirs
()

Returns true if the Host will attempt to create directories for appBase and xmlBase unless they already exist.

public String

Returns:

the regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.
getDeployIgnore
()

public Pattern

Returns:

the compiled regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.
getDeployIgnorePattern
()

public boolean

Returns:

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

public String

Returns:

the legacy (Java EE) application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.
getLegacyAppBase
()

public File

Returns:

an absolute File for the legacy (Java EE) appBase of this Host. The file will be canonical if possible. There is no guarantee that that the appBase exists.
getLegacyAppBaseFile
()

public ExecutorService

Returns:

the executor that is used for starting and stopping contexts. This is primarily for use by components deploying contexts that want to do this in a multi-threaded manner.
getStartStopExecutor
()

public boolean

Returns:

true of the Host is configured to automatically undeploy old versions of applications deployed using parallel deployment. This only takes effect is getAutoDeploy() also returns true.
getUndeployOldVersions
()

public String

Returns:

the XML root for this Host. This can be an absolute pathname or a relative pathname. If null, the base path defaults to ${catalina.base}/conf/<engine name>/<host name> directory
getXmlBase
()

public void
removeAlias(String
Alias name to be removed
alias
)

Remove the specified alias name from the aliases for this Host.

public void
setAppBase(String
The new application root
appBase
)

Set the application root for this Host.

public void
setAutoDeploy(boolean
The new auto deploy flag
autoDeploy
)

Set the auto deploy flag value for this host.

public void
setConfigClass(String
The new context configuration class
configClass
)

Set the Java class name of the context configuration class for new web applications.

public void
setCreateDirs(boolean
The new value for this flag
createDirs
)

Should the Host attempt to create directories for xmlBase and appBase upon startup.

public void
setDeployIgnore(String
A regular expression matching file names
deployIgnore
)

Set the regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.

public void
setDeployOnStartup(boolean
The new deploy on startup flag
deployOnStartup
)

Set the deploy on startup flag value for this host.

public void
setLegacyAppBase(String
The new legacy application root
legacyAppBase
)

Set the legacy (Java EE) application root for this Host.

public void
setUndeployOldVersions(boolean
The new value for this flag
undeployOldVersions
)

Set to true if the Host should automatically undeploy old versions of applications deployed using parallel deployment.

public void
setXmlBase(String
The new XML root
xmlBase
)

Set the Xml root for this Host.

Inherited from org.apache.catalina.Container:
addChildaddContainerListeneraddPropertyChangeListenerbackgroundProcessfindChildfindChildrenfindContainerListenersfireContainerEventgetAccessLoggetBackgroundProcessorDelaygetCatalinaBasegetCatalinaHomegetClustergetConfigPathgetDomaingetLoggergetLogNamegetMBeanKeyPropertiesgetNamegetObjectNamegetParentgetParentClassLoadergetPipelinegetRealmgetServicegetStartStopThreadslogAccessremoveChildremoveContainerListenerremovePropertyChangeListenersetBackgroundProcessorDelaysetClustersetNamesetParentsetParentClassLoadersetRealmsetStartStopThreads

Field Detail

ADD_ALIAS_EVENTback to summary
public static final String ADD_ALIAS_EVENT

The ContainerEvent event type sent when a new alias is added by addAlias().

REMOVE_ALIAS_EVENTback to summary
public static final String REMOVE_ALIAS_EVENT

The ContainerEvent event type sent when an old alias is removed by removeAlias().

Method Detail

addAliasback to summary
public void addAlias(String alias)

Add an alias name that should be mapped to this same Host.

Parameters
alias:String

The alias to be added

findAliasesback to summary
public String[] findAliases()
Returns:String[]

the set of alias names for this Host. If none are defined, a zero length array is returned.

getAppBaseback to summary
public String getAppBase()
Returns:String

the application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.

getAppBaseFileback to summary
public File getAppBaseFile()
Returns:File

an absolute File for the appBase of this Host. The file will be canonical if possible. There is no guarantee that that the appBase exists.

getAutoDeployback to summary
public boolean getAutoDeploy()
Returns:boolean

the value of the auto deploy flag. If true, it indicates that this host's child webapps should be discovered and automatically deployed dynamically.

getConfigBaseFileback to summary
public File getConfigBaseFile()
Returns:File

a default configuration path of this Host. The file will be canonical if possible.

getConfigClassback to summary
public String getConfigClass()
Returns:String

the Java class name of the context configuration class for new web applications.

getCreateDirsback to summary
public boolean getCreateDirs()

Returns true if the Host will attempt to create directories for appBase and xmlBase unless they already exist.

Returns:boolean

true if the Host will attempt to create directories

getDeployIgnoreback to summary
public String getDeployIgnore()
Returns:String

the regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.

getDeployIgnorePatternback to summary
public Pattern getDeployIgnorePattern()
Returns:Pattern

the compiled regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.

getDeployOnStartupback to summary
public boolean getDeployOnStartup()
Returns:boolean

the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be discovered and automatically deployed.

getLegacyAppBaseback to summary
public String getLegacyAppBase()
Returns:String

the legacy (Java EE) application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.

getLegacyAppBaseFileback to summary
public File getLegacyAppBaseFile()
Returns:File

an absolute File for the legacy (Java EE) appBase of this Host. The file will be canonical if possible. There is no guarantee that that the appBase exists.

getStartStopExecutorback to summary
public ExecutorService getStartStopExecutor()
Returns:ExecutorService

the executor that is used for starting and stopping contexts. This is primarily for use by components deploying contexts that want to do this in a multi-threaded manner.

getUndeployOldVersionsback to summary
public boolean getUndeployOldVersions()
Returns:boolean

true of the Host is configured to automatically undeploy old versions of applications deployed using parallel deployment. This only takes effect is getAutoDeploy() also returns true.

getXmlBaseback to summary
public String getXmlBase()
Returns:String

the XML root for this Host. This can be an absolute pathname or a relative pathname. If null, the base path defaults to ${catalina.base}/conf/<engine name>/<host name> directory

removeAliasback to summary
public void removeAlias(String alias)

Remove the specified alias name from the aliases for this Host.

Parameters
alias:String

Alias name to be removed

setAppBaseback to summary
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:String

The new application root

setAutoDeployback to summary
public void setAutoDeploy(boolean autoDeploy)

Set the auto deploy flag value for this host.

Parameters
autoDeploy:boolean

The new auto deploy flag

setConfigClassback to summary
public void setConfigClass(String configClass)

Set the Java class name of the context configuration class for new web applications.

Parameters
configClass:String

The new context configuration class

setCreateDirsback to summary
public void setCreateDirs(boolean createDirs)

Should the Host attempt to create directories for xmlBase and appBase upon startup.

Parameters
createDirs:boolean

The new value for this flag

setDeployIgnoreback to summary
public void setDeployIgnore(String deployIgnore)

Set the regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.

Parameters
deployIgnore:String

A regular expression matching file names

setDeployOnStartupback to summary
public void setDeployOnStartup(boolean deployOnStartup)

Set the deploy on startup flag value for this host.

Parameters
deployOnStartup:boolean

The new deploy on startup flag

setLegacyAppBaseback to summary
public void setLegacyAppBase(String legacyAppBase)

Set the legacy (Java EE) application root for this Host. This can be an absolute pathname, a relative pathname, or a URL.

Parameters
legacyAppBase:String

The new legacy application root

setUndeployOldVersionsback to summary
public void setUndeployOldVersions(boolean undeployOldVersions)

Set to true if the Host should automatically undeploy old versions of applications deployed using parallel deployment. This only takes effect if getAutoDeploy() returns true.

Parameters
undeployOldVersions:boolean

The new value for this flag

setXmlBaseback to summary
public void setXmlBase(String xmlBase)

Set the Xml root for this Host. This can be an absolute pathname or a relative pathname. If null, the base path defaults to ${catalina.base}/conf/<engine name>/<host name> directory

Parameters
xmlBase:String

The new XML root