public class StandardHost extends ContainerBase implements Deployer, Host
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild| Modifier and Type | Field and Description |
|---|---|
protected String[] |
aliases
The set of aliases for this Host.
|
backgroundProcessorDelay, checkIfRequestIsSecure, children, controller, debug, domain, hasCustomPipeline, initialized, lifecycle, listeners, loader, log, logger, manager, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, rb, readLock, realm, resources, started, support, writeLockINSTALL_EVENT, PRE_INSTALL_EVENT, REMOVE_EVENTADD_ALIAS_EVENT, REMOVE_ALIAS_EVENTADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENTAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_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.
|
void |
addErrorPage(ErrorPage errorPage)
Adds the given error page to this StandardHost.
|
void |
addValve(GlassFishValve valve)
Add a new Valve to the end of the pipeline associated with this
Container.
|
void |
configureSingleSignOnCookieHttpOnly(javax.servlet.http.Cookie cookie)
Configures the HttpOnly attribute of the given SSO cookie.
|
void |
configureSingleSignOnCookieSecure(javax.servlet.http.Cookie cookie,
javax.servlet.http.HttpServletRequest hreq)
Configures the Secure attribute of the given SSO cookie.
|
ObjectName |
createObjectName(String domain,
ObjectName parent) |
String[] |
findAliases()
Return the set of alias names for this Host.
|
Container |
findChild(String contextRoot)
Returns the context deployed at the given context root.
|
Context |
findDeployedApp(String contextPath)
Return the Context for the deployed application that is associated
with the specified context path (if any); otherwise return
null. |
String[] |
findDeployedApps()
Return the context paths of all deployed web applications in this
Container.
|
ErrorPage |
findErrorPage(int errorCode)
Gets the error page for the specified HTTP error code.
|
Host |
findMappingObject() |
String[] |
getAliases() |
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.
|
String |
getContextClass()
Return the Java class name of the Context implementation class
for new web applications.
|
String |
getDefaultContextXmlLocation()
Gets the default-context.xml location of web modules deployed on this
virtual server.
|
String |
getDefaultWebXmlLocation()
Gets the default-web.xml location of web modules deployed on this
virtual server.
|
Deployer |
getDeployer() |
boolean |
getDeployOnStartup()
Return the value of the deploy on startup flag.
|
String |
getErrorReportValveClass()
Return the Java class name of the error report valve class
for new web applications.
|
String |
getInfo()
Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version>. |
String |
getName()
Return the canonical, fully qualified, name of the virtual host
this Container represents.
|
String[] |
getNetworkListenerNames()
Gets the network listener names with which this StandardHost is associated.
|
String |
getNetworkListeners() |
SingleSignOn |
getSingleSignOn() |
String[] |
getValveNames()
Return the MBean Names of the Valves associated with this Host
|
String |
getWorkDir()
Host work directory base.
|
boolean |
getXmlNamespaceAware()
Get the server.xml
|
boolean |
getXmlValidation()
Get the server.xml
|
void |
init()
Init method, part of the MBean lifecycle.
|
void |
install(String contextPath,
URL war)
Install a new web application, whose web application archive is at the
specified URL, into this container with the specified context path.
|
void |
install(URL config,
URL war)
Install a new web application, whose context configuration file
(consisting of a
<Context> element) and web
application archive are at the specified URLs. |
boolean |
isDeployXML()
Deploy XML Context config files flag accessor.
|
boolean |
isSecurePagesWithPragma()
Returns the value of the securePagesWithPragma property.
|
boolean |
isUnpackWARs()
Unpack WARs flag accessor.
|
protected Object |
loadInstance(String className) |
Context |
map(String uri)
Return the Context that would be used to process the specified
host-relative request URI, if any; otherwise return
null. |
void |
remove(String contextPath)
Remove an existing web application, attached to the specified context
path.
|
void |
remove(String contextPath,
boolean undeploy)
Remove an existing web application, attached to the specified context
path.
|
void |
removeAlias(String alias)
Remove the specified alias name from the aliases for this Host.
|
void |
removeValve(GlassFishValve valve)
Remove the specified Valve from the pipeline associated with this
Container, if it is found; otherwise, do nothing.
|
void |
sendNotification(Notification notification) |
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 |
setDefaultContextXmlLocation(String defaultContextXmlLocation)
Sets the default-context.xml location for web modules deployed on this
virtual server.
|
void |
setDefaultWebXmlLocation(String defaultWebXmlLocation)
Sets the default-web.xml location for web modules deployed on this
virtual server.
|
void |
setDeployer(Deployer d) |
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 |
setName(String name)
Set the canonical, fully qualified, name of the virtual host
this Container represents.
|
void |
setNetworkListenerNames(String[] networkListenerNames)
Associates this StandardHost with the given network listener names.
|
void |
setPipeline(Pipeline pl) |
void |
setSecurePagesWithPragma(boolean securePagesWithPragma)
Sets the securePagesWithPragma property of this Context.
|
void |
setUnpackWARs(boolean unpackWARs)
Unpack WARs flag mutator.
|
void |
setWorkDir(String workDir)
Host work directory base.
|
void |
setXmlNamespaceAware(boolean xmlNamespaceAware)
Set the namespace aware feature of the XML parser used when
parsing xml instances.
|
void |
setXmlValidation(boolean xmlValidation)
Set the validation feature of the XML parser used when
parsing xml instances.
|
void |
start()
Start this host.
|
void |
start(String contextPath)
Start an existing web application, attached to the specified context
path.
|
void |
stop()
Gracefully shut down active use of the public methods of this Component.
|
void |
stop(String contextPath)
Stop an existing web application, attached to the specified context
path.
|
String |
toString()
Return a String representation of this component.
|
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, destroy, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getContainerSuffix, getDebug, getDomain, getJmxName, getLoader, getLogger, getManager, getMappingObject, getObjectName, getParent, getParentClassLoader, getParentName, getPipeline, getRealm, getResources, getValveObjectNames, getValves, hasCustomPipeline, hasNonBasicValves, invoke, isCheckIfRequestIsSecure, log, log, logName, removeChild, removeContainerListener, removeLifecycleListener, removeLifecycleListeners, removePropertyChangeListener, setBackgroundProcessorDelay, setBasic, setCheckIfRequestIsSecure, setDebug, setDomain, setLoader, setLogger, setManager, setParent, setParentClassLoader, setRealm, setResources, startChildren, threadStart, threadStopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddContainerListener, addPropertyChangeListener, backgroundProcess, findChildren, findContainerListeners, fireContainerEvent, getBackgroundProcessorDelay, getLoader, getLogger, getManager, getMappingObject, getParent, getParentClassLoader, getPipeline, getRealm, getResources, hasCustomPipeline, invoke, isCheckIfRequestIsSecure, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCheckIfRequestIsSecure, setLoader, setLogger, setManager, setParent, setParentClassLoader, setRealm, setResourcesprotected String[] aliases
public StandardHost()
public void setPipeline(Pipeline pl)
public String getAppBase()
getAppBase in interface Hostpublic void setAppBase(String appBase)
setAppBase in interface HostappBase - The new application rootpublic boolean getAutoDeploy()
getAutoDeploy in interface Hostpublic void setAutoDeploy(boolean autoDeploy)
setAutoDeploy in interface HostautoDeploy - The new auto deploy flagpublic String getConfigClass()
public void setConfigClass(String configClass)
configClass - The new context configuration classpublic String getContextClass()
public void setContextClass(String contextClass)
contextClass - The new context implementation classpublic boolean getDeployOnStartup()
getDeployOnStartup in interface Hostpublic void setDeployOnStartup(boolean deployOnStartup)
setDeployOnStartup in interface HostdeployOnStartup - The new deploy on startup flagpublic boolean isDeployXML()
public void setDeployXML(boolean deployXML)
public String getErrorReportValveClass()
public void setErrorReportValveClass(String errorReportValveClass)
errorReportValveClass - The new error report valve classpublic String getName()
public void setName(String name)
setName in interface ContainersetName in interface HostsetName in class ContainerBasename - Virtual host nameIllegalArgumentException - if name is nullpublic boolean isUnpackWARs()
public void setUnpackWARs(boolean unpackWARs)
public void setXmlValidation(boolean xmlValidation)
setXmlValidation in interface HostxmlValidation - true to enable xml instance validationpublic boolean getXmlValidation()
getXmlValidation in interface Hostpublic boolean getXmlNamespaceAware()
getXmlNamespaceAware in interface Hostpublic void setXmlNamespaceAware(boolean xmlNamespaceAware)
setXmlNamespaceAware in interface HostxmlNamespaceAware - true to enable namespace awarenesspublic String getWorkDir()
public void setWorkDir(String workDir)
public void setNetworkListenerNames(String[] networkListenerNames)
setNetworkListenerNames in interface HostnetworkListenerNames - The network listener names with which to associate this StandardHostpublic String[] getNetworkListenerNames()
getNetworkListenerNames in interface Hostpublic String getNetworkListeners()
public String getDefaultContextXmlLocation()
public void setDefaultContextXmlLocation(String defaultContextXmlLocation)
defaultContextXmlLocation - default-context.xml location for web modules
deployed on this virtual serverpublic String getDefaultWebXmlLocation()
public void setDefaultWebXmlLocation(String defaultWebXmlLocation)
defaultWebXmlLocation - default-web.xml location for web modules
deployed on this virtual serverpublic void addAlias(String alias)
public void addChild(Container child)
addChild in interface ContaineraddChild in class ContainerBasechild - Child container to be addedpublic Container findChild(String contextRoot)
findChild in interface ContainerfindChild in class ContainerBasecontextRoot - The context root whose associated context to returnpublic String[] findAliases()
findAliases in interface Hostpublic Host findMappingObject()
public String getInfo()
<description>/<version>.getInfo in interface ContainergetInfo in class ContainerBasepublic Context map(String uri)
null.public void removeAlias(String alias)
removeAlias in interface Hostalias - Alias name to be removedpublic void addErrorPage(ErrorPage errorPage)
errorPage - The error page definition to be addedpublic ErrorPage findErrorPage(int errorCode)
errorCode - Error code to look uppublic void configureSingleSignOnCookieSecure(javax.servlet.http.Cookie cookie,
javax.servlet.http.HttpServletRequest hreq)
cookie - the SSO cookie to be configuredhreq - the HttpServletRequest that has initiated the SSO sessionpublic void configureSingleSignOnCookieHttpOnly(javax.servlet.http.Cookie cookie)
cookie - the SSO ccokie to be configuredpublic String toString()
public void start()
throws LifecycleException
start in interface Lifecyclestart in class ContainerBaseLifecycleException - if this component detects a fatal error
that prevents it from being startedpublic void stop()
throws LifecycleException
ContainerBasestop in interface Lifecyclestop in class ContainerBaseLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void sendNotification(Notification notification)
public void install(String contextPath, URL war) throws IOException
If this application is successfully installed, a ContainerEvent of type
INSTALL_EVENT will be sent to all registered listeners,
with the newly created Context as an argument.
install in interface DeployercontextPath - The context path to which this application should
be installed (must be unique)war - A URL of type "jar:" that points to a WAR file, or type
"file:" that points to an unpacked directory structure containing
the web application to be installedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalStateException - if the specified context path
is already attached to an existing web applicationIOException - if an input/output error was encountered
during installpublic void install(URL config, URL war) throws IOException
Install a new web application, whose context configuration file
(consisting of a <Context> element) and web
application archive are at the specified URLs.
If this application is successfully installed, a ContainerEvent
of type INSTALL_EVENT will be sent to all registered
listeners, with the newly created Context as an argument.
install in interface Deployerconfig - A URL that points to the context configuration file to
be used for configuring the new Contextwar - A URL of type "jar:" that points to a WAR file, or type
"file:" that points to an unpacked directory structure containing
the web application to be installedIllegalArgumentException - if one of the specified URLs is
nullIllegalStateException - if the context path specified in the
context configuration file is already attached to an existing web
applicationIOException - if an input/output error was encountered
during installationpublic Context findDeployedApp(String contextPath)
null.findDeployedApp in interface DeployercontextPath - The context path of the requested web applicationpublic String[] findDeployedApps()
findDeployedApps in interface Deployerpublic void remove(String contextPath) throws IOException
REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument.remove in interface DeployercontextPath - The context path of the application to be removedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
removalpublic void remove(String contextPath, boolean undeploy) throws IOException
REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument. Deletes the web application war file and/or directory
if they exist in the Host's appBase.remove in interface DeployercontextPath - The context path of the application to be removedundeploy - boolean flag to remove web application from serverIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
removalpublic void start(String contextPath) throws IOException
start in interface DeployercontextPath - The context path of the application to be startedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs during
startuppublic void stop(String contextPath) throws IOException
stop in interface DeployercontextPath - The context path of the application to be stoppedIllegalArgumentException - if the specified context path
is malformed (it must be "" or start with a slash)IllegalArgumentException - if the specified context path does
not identify a currently installed web applicationIOException - if an input/output error occurs while stopping
the web applicationpublic boolean isSecurePagesWithPragma()
public void setSecurePagesWithPragma(boolean securePagesWithPragma)
securePagesWithPragma - true if Pragma and Cache-Control headers
are to be set to "No-cache" if proxy caching has been disabled, false
otherwisepublic void addValve(GlassFishValve valve)
ContainerBasesetContainer method must be called, with this Container
as an argument. The method may throw an
IllegalArgumentException if this Valve chooses not to
be associated with this Container, or IllegalStateException
if it is already associated with a different Container.addValve in interface PipelineaddValve in class ContainerBasevalve - Valve to be addedpublic void removeValve(GlassFishValve valve)
ContainerBaseremoveValve in interface PipelineremoveValve in class ContainerBasevalve - Valve to be removedpublic SingleSignOn getSingleSignOn()
public Deployer getDeployer()
public void setDeployer(Deployer d)
public String[] getValveNames() throws Exception
Exception - if an MBean cannot be created or registeredpublic String[] getAliases()
public void init()
ContainerBaseinit in class ContainerBasepublic ObjectName createObjectName(String domain, ObjectName parent) throws Exception
createObjectName in class ContainerBaseExceptionCopyright © 2017. All rights reserved.