Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 7.0.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.catalina
Interface Host

All Superinterfaces:
  Container, Lifecycle

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:

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

Version:
  $Id: Host.java 1200159 2011-11-10 05:33:31Z kkolinko $
Author:
  Craig R. McClanahan

Field Summary
`static String` | `ADD_ALIAS_EVENT` The ContainerEvent event type sent when a new alias is added by `addAlias()`.
`static 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`

Fields inherited from interface org.apache.catalina.Lifecycle
`AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

Method Summary
`void` | `addAlias(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.
`String` | `getAppBase()` Return the application root for this Host.
`boolean` | `getAutoDeploy()` Return the value of the auto deploy flag.
`String` | `getConfigClass()` Return the Java class name of the context configuration class for new web applications.
`boolean` | `getCreateDirs()` Returns true if the Host will attempt to create directories for appBase and xmlBase unless they already exist.
`String` | `getDeployIgnore()` Return the regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.
`Pattern` | `getDeployIgnorePattern()` Return the compiled regular expression that defines the files and directories in the host's appBase that will be ignored by the automatic deployment process.
`boolean` | `getDeployOnStartup()` Return the value of the deploy on startup flag.
`ExecutorService` | `getStartStopExecutor()` Return the executor that is used for starting and stopping contexts.
`String` | `getXmlBase()` Return the XML root for this Host.
`void` | `removeAlias(String alias)` Remove the specified alias name from the aliases for this Host.
`void` | `setAppBase(String appBase)` Set the application root for this Host.
`void` | `setAutoDeploy(boolean autoDeploy)` Set the auto deploy flag value for this host.
`void` | `setConfigClass(String configClass)` Set the Java class name of the context configuration class for new web applications.
`void` | `setCreateDirs(boolean createDirs)` Set to true if the Host should attempt to create directories for xmlBase and appBase upon startup
`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.
`void` | `setDeployOnStartup(boolean deployOnStartup)` Set the deploy on startup flag value for this host.
`void` | `setXmlBase(String xmlBase)` Set the Xml root for this Host.

Methods inherited from interface org.apache.catalina.Container
`addChild, addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCluster, getInfo, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, getStartStopThreads, invoke, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setName, setParent, setParentClassLoader, setRealm, setResources, setStartStopThreads`

Methods inherited from interface org.apache.catalina.Lifecycle
`addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop`

Field Detail

### ADD_ALIAS_EVENT

    static final 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 String REMOVE_ALIAS_EVENT

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

  See Also:
    Constant Field Values

Method Detail

### getXmlBase

    String getXmlBase()

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

### setXmlBase

    void setXmlBase(String xmlBase)

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

  Parameters:
    `xmlBase` - The new XML root

### getAppBase

    String getAppBase()

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

### setAppBase

    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

### getAutoDeploy

    boolean getAutoDeploy()

  Return the value of the auto deploy flag. If true, it indicates that this host's child webapps should be discovered 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

    String getConfigClass()

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

### setConfigClass

    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

### getDeployOnStartup

    boolean getDeployOnStartup()

  Return the value of the deploy on startup flag. If true, it indicates that this host's child webapps should be discovered 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

### getDeployIgnore

    String getDeployIgnore()

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

### getDeployIgnorePattern

    Pattern getDeployIgnorePattern()

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

### setDeployIgnore

    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.

### getStartStopExecutor

    ExecutorService getStartStopExecutor()

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

### addAlias

    void addAlias(String alias)

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

  Parameters:
    `alias` - The alias to be added

### findAliases

    String[] findAliases()

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

### removeAlias

    void removeAlias(String alias)

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

  Parameters:
    `alias` - Alias name to be removed

### getCreateDirs

    boolean getCreateDirs()

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

  Returns:
    true if the Host will attempt to create directories

### setCreateDirs

    void setCreateDirs(boolean createDirs)

  Set to true if the Host should attempt to create directories for xmlBase and appBase upon startup

  Parameters:
    `createDirs` -

Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache Tomcat 7.0.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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