public class StandardHost extends ContainerBase implements Host
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild
Lifecycle.SingleUse
accessLog, backgroundProcessorDelay, children, cluster, listeners, logger, logName, name, parent, parentClassLoader, pipeline, sm, startChildren, startStopExecutor, support
mserver
ADD_ALIAS_EVENT, REMOVE_ALIAS_EVENT
ADD_CHILD_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_VALVE_EVENT
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
Constructor and Description |
---|
StandardHost()
Create a new StandardHost component with the default basic Valve.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlias(String alias)
Add an alias name that should be mapped to this same Host.
|
void |
addChild(Container child)
Add a child Container, only if the proposed child is an implementation
of Context.
|
String[] |
findAliases() |
String[] |
findReloadedContextMemoryLeaks()
Attempt to identify the contexts that have a class loader memory leak.
|
String[] |
getAliases() |
String |
getAppBase()
Return the application root for this Host.
|
File |
getAppBaseFile()
(
|
boolean |
getAutoDeploy() |
File |
getConfigBaseFile()
(
|
String |
getConfigClass() |
String |
getContextClass() |
boolean |
getCreateDirs()
Returns
true if the Host will attempt to create directories for appBase and xmlBase
unless they already exist. |
String |
getDeployIgnore() |
Pattern |
getDeployIgnorePattern() |
boolean |
getDeployOnStartup() |
String |
getErrorReportValveClass() |
String |
getName()
Return a name string (suitable for use by humans) that describes this
Container.
|
protected String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
ExecutorService |
getStartStopExecutor() |
boolean |
getUndeployOldVersions() |
String[] |
getValveNames() |
String |
getWorkDir() |
String |
getXmlBase()
Return the XML root for this Host.
|
boolean |
isCopyXML() |
boolean |
isDeployXML() |
boolean |
isFailCtxIfServletStartFails() |
boolean |
isUnpackWARs() |
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 |
setContextClass(String contextClass)
Set the Java class name of the Context implementation class
for new web applications.
|
void |
setCopyXML(boolean copyXML)
Set the copy XML config file flag for this component.
|
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
getAppBase() that will be ignored by the automatic
deployment process. |
void |
setDeployOnStartup(boolean deployOnStartup)
Set the deploy on startup flag value for this host.
|
void |
setDeployXML(boolean deployXML)
Deploy XML Context config files flag mutator.
|
void |
setErrorReportValveClass(String errorReportValveClass)
Set the Java class name of the error report valve class
for new web applications.
|
void |
setFailCtxIfServletStartFails(boolean failCtxIfServletStartFails)
Change the behavior of Servlet startup errors on web application starts.
|
void |
setName(String name)
Set the canonical, fully qualified, name of the virtual host
this Container represents.
|
void |
setUndeployOldVersions(boolean undeployOldVersions)
Set to
true if the Host should automatically undeploy old versions of
applications deployed using parallel deployment. |
void |
setUnpackWARs(boolean unpackWARs)
Unpack WARs flag mutator.
|
void |
setWorkDir(String workDir)
Set host work directory base.
|
void |
setXmlBase(String xmlBase)
Set the Xml root for this Host.
|
protected void |
startInternal()
Start this component and implement the requirements
of
LifecycleBase.startInternal() . |
addContainerListener, addPropertyChangeListener, addValve, backgroundProcess, destroyInternal, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getChildren, getCluster, getClusterInternal, getDomainInternal, getLogger, getLogName, getMBeanKeyProperties, getParent, getParentClassLoader, getPipeline, getRealm, getRealmInternal, getStartChildren, getStartStopThreads, initInternal, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setParent, setParentClassLoader, setRealm, setStartChildren, setStartStopThreads, stopInternal, threadStart, threadStop, toString
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getCluster, getDomain, getLogger, getLogName, getMBeanKeyProperties, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getStartStopThreads, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setParent, setParentClassLoader, setRealm, setStartStopThreads
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
public StandardHost()
public boolean getUndeployOldVersions()
getUndeployOldVersions
in interface Host
true
of the Host is configured to automatically undeploy old
versions of applications deployed using parallel deployment. This only
takes effect is Host.getAutoDeploy()
also returns true
.public void setUndeployOldVersions(boolean undeployOldVersions)
Host
true
if the Host should automatically undeploy old versions of
applications deployed using parallel deployment. This only takes effect
if Host.getAutoDeploy()
returns true
.setUndeployOldVersions
in interface Host
undeployOldVersions
- The new value for this flagpublic ExecutorService getStartStopExecutor()
getStartStopExecutor
in interface Host
public String getAppBase()
getAppBase
in interface Host
public File getAppBaseFile()
getAppBaseFile
in interface Host
File
for the appBase of this Host. The file
will be canonical if possible. There is no guarantee that that the
appBase exists.public void setAppBase(String appBase)
setAppBase
in interface Host
appBase
- The new application rootpublic String getXmlBase()
getXmlBase
in interface Host
public void setXmlBase(String xmlBase)
setXmlBase
in interface Host
xmlBase
- The new XML rootpublic File getConfigBaseFile()
getConfigBaseFile
in interface Host
public boolean getCreateDirs()
Host
true
if the Host will attempt to create directories for appBase and xmlBase
unless they already exist.getCreateDirs
in interface Host
true
if the Host will attempt to create directories for appBase and xmlBase
unless they already exist.public void setCreateDirs(boolean createDirs)
true
if the Host should attempt to create directories for xmlBase and appBase upon startupsetCreateDirs
in interface Host
createDirs
- the new flag valuepublic boolean getAutoDeploy()
getAutoDeploy
in interface Host
public void setAutoDeploy(boolean autoDeploy)
setAutoDeploy
in interface Host
autoDeploy
- The new auto deploy flagpublic String getConfigClass()
getConfigClass
in interface Host
public void setConfigClass(String configClass)
setConfigClass
in interface Host
configClass
- The new context configuration classpublic String getContextClass()
public void setContextClass(String contextClass)
contextClass
- The new context implementation classpublic boolean getDeployOnStartup()
getDeployOnStartup
in interface Host
true
, it indicates
that this host's child webapps should be discovered and automatically
deployed at startup time.public void setDeployOnStartup(boolean deployOnStartup)
setDeployOnStartup
in interface Host
deployOnStartup
- The new deploy on startup flagpublic boolean isDeployXML()
true
if XML context descriptors should be deployed.public void setDeployXML(boolean deployXML)
deployXML
- true
if context descriptors should be deployedpublic boolean isCopyXML()
public void setCopyXML(boolean copyXML)
copyXML
- The new copy XML flagpublic String getErrorReportValveClass()
public void setErrorReportValveClass(String errorReportValveClass)
errorReportValveClass
- The new error report valve classpublic String getName()
ContainerBase
getName
in interface Container
getName
in class ContainerBase
public void setName(String name)
setName
in interface Container
setName
in class ContainerBase
name
- Virtual host nameIllegalArgumentException
- if name is nullpublic boolean isUnpackWARs()
true
if WARs should be unpacked on deployment.public void setUnpackWARs(boolean unpackWARs)
unpackWARs
- true
to unpack WARs on deploymentpublic String getWorkDir()
public void setWorkDir(String workDir)
workDir
- the new base work folder for this hostpublic String getDeployIgnore()
getDeployIgnore
in interface Host
getAppBase()
that will be ignored by the automatic
deployment process.public Pattern getDeployIgnorePattern()
getDeployIgnorePattern
in interface Host
getAppBase()
that will be ignored by the
automatic deployment process.public void setDeployIgnore(String deployIgnore)
getAppBase()
that will be ignored by the automatic
deployment process.setDeployIgnore
in interface Host
deployIgnore
- the regexppublic boolean isFailCtxIfServletStartFails()
true
if a webapp start should fail if a Servlet startup failspublic void setFailCtxIfServletStartFails(boolean failCtxIfServletStartFails)
failCtxIfServletStartFails
- false
to ignore errors on Servlets which
are stated when the web application startspublic void addAlias(String alias)
public void addChild(Container child)
addChild
in interface Container
addChild
in class ContainerBase
child
- Child container to be addedpublic String[] findReloadedContextMemoryLeaks()
public String[] findAliases()
findAliases
in interface Host
public void removeAlias(String alias)
removeAlias
in interface Host
alias
- Alias name to be removedprotected void startInternal() throws LifecycleException
LifecycleBase.startInternal()
.startInternal
in class ContainerBase
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic String[] getValveNames() throws Exception
Exception
- if an MBean cannot be created or registeredpublic String[] getAliases()
protected String getObjectNameKeyProperties()
LifecycleMBeanBase
ObjectName
that will be used to register this component.getObjectNameKeyProperties
in class LifecycleMBeanBase
ObjectName
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.