com.caucho.server.host
Class Host

java.lang.Object
  extended by com.caucho.server.webapp.WebAppContainer
      extended by com.caucho.server.host.Host
All Implemented Interfaces:
SchemaBean, ClassLoaderListener, EnvironmentBean, EnvironmentListener, DeployInstance, EnvironmentDeployInstance, DispatchBuilder, Dependency, java.util.EventListener

public class Host
extends WebAppContainer
implements EnvironmentBean, Dependency, SchemaBean, EnvironmentDeployInstance

Resin's virtual host implementation.


Constructor Summary
Host(HostContainer parent, HostController controller, java.lang.String hostName)
          Creates the webApp with its environment loader.
 
Method Summary
 void addHostAlias(java.lang.String name)
          Adds an alias.
 void addHostAliasRegexp(java.lang.String name)
          Adds an alias.
 Invocation buildInvocation(Invocation invocation)
          Builds the invocation for the host.
 void clearCache()
          Clears the cache
 void destroy()
          Closes the host.
 HostMXBean getAdmin()
          Returns the admin.
 java.util.ArrayList<java.lang.String> getAliasList()
          Gets the alias list.
 BamBroker getBamBroker()
          Returns the bam broker.
 Cluster getCluster()
          Returns the current cluster.
 java.lang.String getConfigETag()
          Returns the config etag.
 java.lang.Throwable getConfigException()
          Gets the config exception.
 EnvironmentClassLoader getEnvironmentClassLoader()
          Gets the environment class loader.
 Host getHost()
          Returns the host (as an webApp container)
 java.lang.String getHostName()
          Returns the canonical host name.
static Host getLocal()
          Returns the local host.
 java.lang.String getName()
          Returns the entry name
 java.lang.String getSchema()
          Returns the relax schema.
 java.lang.String getSecureHostName()
          Returns the secure host name.
 Server getServer()
          Returns the owning server.
 java.lang.String getURL()
          Returns the URL for the container.
 boolean isDefaultHost()
          Returns true if matches the default host.
 boolean isDeployError()
          Returns true if the host deploy was an error
 boolean isDeployIdle()
          Returns true if the host is idle
 boolean isModified()
          Returns true if the host is modified.
 boolean isModifiedNow()
          Returns true if the host is modified.
 boolean logModified(java.util.logging.Logger log)
          Log the reason for modification.
 void setConfigETag(java.lang.String etag)
          Returns the config etag.
 void setConfigException(java.lang.Throwable e)
          Sets the config exception.
 void setDocumentDirectory(Path docDir)
          Sets the doc dir.
 void setRootDirectory(Path rootDir)
          Sets the root dir.
 void setSecureHostName(java.lang.String secureHostName)
          Sets the secure host name.
 void start()
          Starts the host.
 boolean stop()
          Stops the host.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.server.webapp.WebAppContainer
addApplication, addDeploy, addEarDefault, addEarDeploy, addErrorPage, addWarDeploy, addWebApp, addWebAppDefault, addWebAppDeploy, buildDispatchInvocation, buildErrorInvocation, buildForwardInvocation, buildIncludeInvocation, buildLoginInvocation, classLoaderDestroy, classLoaderInit, createAccessLog, createEarDeploy, createRewriteDispatch, createWarDeploy, createWebAppDeploy, environmentBind, environmentConfigure, environmentStart, environmentStop, expandEarDeploy, findByURI, findController, findSubWebAppByURI, findWebAppByURI, getClassLoader, getDispatchServer, getDocumentDirectory, getEarDefaultList, getEntAppList, getErrorPageManager, getErrorWebApp, getRequestDispatcher, getRootDirectory, getSessionManager, getWarDir, getWarExpandDir, getWebAppDefaultList, getWebAppGenerator, getWebAppList, init, isActive, isDestroyed, removeWebAppDeploy, setAccessLog, setDispatchServer, setDocDir, setEnvironmentClassLoader, setWarDir, setWarExpandDir, startEarDeploy, updateEarDeploy, updateWebAppDeploy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.loader.EnvironmentBean
getClassLoader
 
Methods inherited from interface com.caucho.server.deploy.EnvironmentDeployInstance
init
 
Methods inherited from interface com.caucho.server.deploy.DeployInstance
getClassLoader
 

Constructor Detail

Host

public Host(HostContainer parent,
            HostController controller,
            java.lang.String hostName)
Creates the webApp with its environment loader.

Method Detail

getLocal

public static Host getLocal()
Returns the local host.


getName

public java.lang.String getName()
Returns the entry name


getHostName

public java.lang.String getHostName()
Returns the canonical host name. The canonical host name may include the port.

Overrides:
getHostName in class WebAppContainer

getHost

public Host getHost()
Returns the host (as an webApp container)

Overrides:
getHost in class WebAppContainer

getSecureHostName

public java.lang.String getSecureHostName()
Returns the secure host name. Used for redirects.


setSecureHostName

public void setSecureHostName(java.lang.String secureHostName)
Sets the secure host name. Used for redirects.


getBamBroker

public BamBroker getBamBroker()
Returns the bam broker.


getSchema

public java.lang.String getSchema()
Returns the relax schema.

Specified by:
getSchema in interface SchemaBean

getURL

public java.lang.String getURL()
Returns the URL for the container.

Overrides:
getURL in class WebAppContainer

addHostAlias

public void addHostAlias(java.lang.String name)
Adds an alias.


getAliasList

public java.util.ArrayList<java.lang.String> getAliasList()
Gets the alias list.


addHostAliasRegexp

public void addHostAliasRegexp(java.lang.String name)
Adds an alias.


isDefaultHost

public boolean isDefaultHost()
Returns true if matches the default host.


getEnvironmentClassLoader

public EnvironmentClassLoader getEnvironmentClassLoader()
Gets the environment class loader.


setRootDirectory

public void setRootDirectory(Path rootDir)
Sets the root dir.

Specified by:
setRootDirectory in interface EnvironmentDeployInstance
Overrides:
setRootDirectory in class WebAppContainer

setDocumentDirectory

public void setDocumentDirectory(Path docDir)
Sets the doc dir.

Overrides:
setDocumentDirectory in class WebAppContainer

setConfigException

public void setConfigException(java.lang.Throwable e)
Sets the config exception.

Specified by:
setConfigException in interface DeployInstance
Overrides:
setConfigException in class WebAppContainer

getConfigException

public java.lang.Throwable getConfigException()
Gets the config exception.

Specified by:
getConfigException in interface DeployInstance

getServer

public Server getServer()
Returns the owning server.


getCluster

public Cluster getCluster()
Returns the current cluster.


getConfigETag

public java.lang.String getConfigETag()
Returns the config etag.


setConfigETag

public void setConfigETag(java.lang.String etag)
Returns the config etag.


getAdmin

public HostMXBean getAdmin()
Returns the admin.


start

public void start()
Starts the host.

Specified by:
start in interface DeployInstance
Overrides:
start in class WebAppContainer

clearCache

public void clearCache()
Clears the cache

Overrides:
clearCache in class WebAppContainer

buildInvocation

public Invocation buildInvocation(Invocation invocation)
                           throws java.lang.Exception
Builds the invocation for the host.

Specified by:
buildInvocation in interface DispatchBuilder
Overrides:
buildInvocation in class WebAppContainer
Throws:
java.lang.Exception

isModified

public boolean isModified()
Returns true if the host is modified.

Specified by:
isModified in interface DeployInstance
Specified by:
isModified in interface Dependency
Overrides:
isModified in class WebAppContainer

isModifiedNow

public boolean isModifiedNow()
Returns true if the host is modified.

Specified by:
isModifiedNow in interface DeployInstance

logModified

public boolean logModified(java.util.logging.Logger log)
Log the reason for modification.

Specified by:
logModified in interface DeployInstance
Specified by:
logModified in interface Dependency

isDeployError

public boolean isDeployError()
Returns true if the host deploy was an error

Specified by:
isDeployError in interface DeployInstance

isDeployIdle

public boolean isDeployIdle()
Returns true if the host is idle

Specified by:
isDeployIdle in interface DeployInstance

stop

public boolean stop()
Stops the host.

Overrides:
stop in class WebAppContainer

destroy

public void destroy()
Closes the host.

Specified by:
destroy in interface DeployInstance
Overrides:
destroy in class WebAppContainer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object