public class VirtualServer extends StandardHost implements VirtualServer
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild| Modifier and Type | Field and Description |
|---|---|
protected Logger |
_logger
The logger to use for logging this virtual server
|
protected static ResourceBundle |
rb
The resource bundle containing the message strings for _logger.
|
aliasesbackgroundProcessorDelay, checkIfRequestIsSecure, children, controller, debug, hasCustomPipeline, initialized, lifecycle, loader, log, logger, manager, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, 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 |
|---|
VirtualServer()
Default constructor that simply gets a handle to the web container
subsystem's logger.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContext(Context context,
String contextRoot)
Registers the given Context with this VirtualServer
at the given context root.
|
protected void |
addListener(String listenerName)
Adds the Catalina listener with the given class name to this
VirtualServer.
|
void |
addValve(GlassFishValve valve)
Adds the given valve to the currently active pipeline, keeping the
pipeline that is not currently active in sync.
|
protected void |
addValve(String valveName)
Adds the
Valve with the given class name to this
VirtualServer. |
void |
addValve(Valve valve)
Adds the given Tomcat-style valve to the currently active pipeline,
keeping the pipeline that is not currently active in sync.
|
void |
clearAliases()
Delete all aliases.
|
void |
configure(String vsID,
VirtualServer vsBean,
String vsDocroot,
String vsLogFile,
MimeMap vsMimeMap,
String logServiceFile,
String logLevel)
Configures this virtual server.
|
protected void |
configureCatalinaProperties()
Configures the valve_ and listener_ properties of this VirtualServer.
|
protected void |
configureRemoteAddressFilterValve(String allow,
String deny)
Configures the Remote Address Filter valve of this VirtualServer.
|
void |
configureSingleSignOnCookieHttpOnly(javax.servlet.http.Cookie ssoCookie)
Configures the HttpOnly attribute of the given SSO cookie.
|
void |
configureSingleSignOnCookieSecure(javax.servlet.http.Cookie ssoCookie,
javax.servlet.http.HttpServletRequest hreq)
Configures the Secure attribute of the given SSO cookie.
|
WebModuleConfig |
createSystemDefaultWebModuleIfNecessary(WebArchivist webArchivist)
If a default web module has not yet been configured and added to this
virtual server's list of web modules then return the configuration
information needed in order to create a default web module for this
virtual server.
|
Container |
findChild(String contextRoot)
Returns the context deployed at the given context root.
|
protected WebModuleConfig |
findWebModuleInJ2eeApp(Applications appsBean,
String id,
ApplicationRegistry appRegistry)
Finds and returns information about a web module embedded within a
J2EE application, which is identified by a string of the form
a:b or a#b, where a is the name
of the J2EE application and b is the name of the embedded
web module. |
boolean |
getAllowLinking()
Gets the value of the allowLinking property of this virtual server.
|
VirtualServer |
getBean()
Gets the config bean associated with this VirtualServer.
|
String[] |
getCacheControls()
Gets the Cache-Control configuration of this VirtualServer.
|
VirtualServerConfig |
getConfig()
Gets the current configuration of this VirtualServer.
|
Context |
getContext(String contextRoot)
Finds the Context registered at the given context root.
|
Collection<Context> |
getContexts()
Gets the collection of Context instances registered with
this VirtualServer.
|
protected String |
getDefaultContextPath(Domain domain,
ApplicationRegistry appRegistry)
Gets the context root of the web module that the user/configuration
has designated as the default-web-module for this virtual server.
|
protected WebModuleConfig |
getDefaultWebModule(Domain domain,
WebArchivist webArchivist,
ApplicationRegistry appRegistry) |
protected String |
getDefaultWebModuleID()
Returns the id of the default web module for this virtual server
as specified in the 'default-web-module' attribute of the
'virtual-server' element.
|
File |
getDocRoot()
Gets the docroot of this VirtualServer.
|
String |
getID()
Return the virtual server identifier.
|
String |
getInfo()
Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version>. |
MimeMap |
getMimeMap()
Gets the mime map associated with this VirtualServer.
|
Collection<WebListener> |
getWebListeners()
Gets the collection of WebListener instances from which
this VirtualServer receives requests.
|
protected Object |
loadInstance(String className) |
void |
removeContext(Context context)
Stops the given context and removes it from this
VirtualServer.
|
void |
removeValve(GlassFishValve valve)
Removes the given valve from the currently active pipeline, keeping the
valve that is not currently active in sync.
|
void |
setAllowLinking(boolean allowLinking)
Sets the allowLinking property of this virtual server, which determines
whether symblic links from this virtual server's docroot are followed.
|
void |
setBean(VirtualServer vsBean)
Sets the config bean for this VirtualServer
|
void |
setCacheControls(String[] cacheControls)
Sets the Cache-Control configuration for this VirtualServer
|
void |
setClassLoaderHierarchy(ClassLoaderHierarchy clh) |
void |
setConfig(VirtualServerConfig config)
Reconfigures this VirtualServer with the given
configuration.
|
void |
setDefaultContextPath(String defaultContextPath) |
void |
setDocRoot(File docRoot)
Sets the docroot of this VirtualServer.
|
void |
setDomain(Domain domain) |
void |
setFileLoggerHandlerFactory(FileLoggerHandlerFactory factory) |
void |
setID(String id)
Set the virtual server identifier string.
|
void |
setIsActive(boolean isActive)
Sets the state of this virtual server.
|
void |
setMimeMap(MimeMap mimeMap)
Sets the mime map for this VirtualServer
|
void |
setRealm(Realm realm)
Set the Realm with which this Container is associated.
|
void |
setServices(org.glassfish.hk2.api.ServiceLocator services) |
void |
setWebListeners(WebListener... webListeners)
Sets the collection of WebListener instances from which
this VirtualServer receives requests.
|
void |
stop()
Gracefully shut down active use of the public methods of this Component.
|
void |
updateWebXml(ContextFacade facade,
File file) |
addAlias, addChild, addErrorPage, createObjectName, findAliases, findDeployedApp, findDeployedApps, findErrorPage, findMappingObject, getAliases, getAppBase, getAutoDeploy, getConfigClass, getContextClass, getDefaultContextXmlLocation, getDefaultWebXmlLocation, getDeployer, getDeployOnStartup, getErrorReportValveClass, getName, getNetworkListenerNames, getNetworkListeners, getSingleSignOn, getValveNames, getWorkDir, getXmlNamespaceAware, getXmlValidation, init, install, install, isDeployXML, isSecurePagesWithPragma, isUnpackWARs, map, remove, remove, removeAlias, sendNotification, setAppBase, setAutoDeploy, setConfigClass, setContextClass, setDefaultContextXmlLocation, setDefaultWebXmlLocation, setDeployer, setDeployOnStartup, setDeployXML, setErrorReportValveClass, setName, setNetworkListenerNames, setPipeline, setSecurePagesWithPragma, setUnpackWARs, setWorkDir, setXmlNamespaceAware, setXmlValidation, start, start, stop, toStringaddContainerListener, addLifecycleListener, addPropertyChangeListener, 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, 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, setResourcesprotected static final ResourceBundle rb
protected Logger _logger
public VirtualServer()
public String getID()
getID in interface VirtualServerpublic void setID(String id)
setID in interface VirtualServerid - New identifier for this virtual serverpublic void setIsActive(boolean isActive)
isActive - true if this virtual server is active, false otherwisepublic boolean getAllowLinking()
public void setAllowLinking(boolean allowLinking)
allowLinking - Value of allowLinking propertypublic VirtualServer getBean()
public void setBean(VirtualServer vsBean)
vsBean - public MimeMap getMimeMap()
public void setMimeMap(MimeMap mimeMap)
mimeMap - public String[] getCacheControls()
public void setCacheControls(String[] cacheControls)
cacheControls - Cache-Control configuration settings for this
VirtualServerpublic void setServices(org.glassfish.hk2.api.ServiceLocator services)
public String getInfo()
StandardHost<description>/<version>.getInfo in interface ContainergetInfo in class StandardHostpublic void setDefaultContextPath(String defaultContextPath)
public void setFileLoggerHandlerFactory(FileLoggerHandlerFactory factory)
public void setClassLoaderHierarchy(ClassLoaderHierarchy clh)
public void setDomain(Domain domain)
public Container findChild(String contextRoot)
StandardHostfindChild in interface ContainerfindChild in class StandardHostcontextRoot - The context root whose associated context to returnpublic void configureSingleSignOnCookieSecure(javax.servlet.http.Cookie ssoCookie,
javax.servlet.http.HttpServletRequest hreq)
configureSingleSignOnCookieSecure in class StandardHostssoCookie - the SSO cookie to be configuredhreq - the HttpServletRequest that has initiated the SSO sessionpublic void configureSingleSignOnCookieHttpOnly(javax.servlet.http.Cookie ssoCookie)
StandardHostconfigureSingleSignOnCookieHttpOnly in class StandardHostssoCookie - the SSO ccokie to be configuredpublic void addValve(GlassFishValve valve)
addValve in interface PipelineaddValve in class StandardHostvalve - Valve to be addedpublic void addValve(Valve valve)
addValve in interface PipelineaddValve in class ContainerBasevalve - public void removeValve(GlassFishValve valve)
removeValve in interface PipelineremoveValve in class StandardHostvalve - Valve to be removedprotected String getDefaultContextPath(Domain domain, ApplicationRegistry appRegistry)
domain - appRegistry - protected WebModuleConfig getDefaultWebModule(Domain domain, WebArchivist webArchivist, ApplicationRegistry appRegistry)
public WebModuleConfig createSystemDefaultWebModuleIfNecessary(WebArchivist webArchivist)
webArchivist - protected String getDefaultWebModuleID()
protected WebModuleConfig findWebModuleInJ2eeApp(Applications appsBean, String id, ApplicationRegistry appRegistry)
a:b or a#b, where a is the name
of the J2EE application and b is the name of the embedded
web module.appsBean - id - id does not identify a web module embedded
within a J2EE application.public void clearAliases()
public void configure(String vsID, VirtualServer vsBean, String vsDocroot, String vsLogFile, MimeMap vsMimeMap, String logServiceFile, String logLevel)
vsID - vsBean - vsDocroot - vsLogFile - logServiceFile - logLevel - protected void configureCatalinaProperties()
protected void addValve(String valveName)
Valve with the given class name to this
VirtualServer.valveName - The valve's fully qualified class namprotected void addListener(String listenerName)
listenerName - The fully qualified class name of the listenerprotected Object loadInstance(String className) throws Exception
loadInstance in class StandardHostExceptionprotected void configureRemoteAddressFilterValve(String allow, String deny)
public void setRealm(Realm realm)
ContainerBasesetRealm in interface ContainersetRealm in class ContainerBaserealm - The newly associated Realmpublic void setDocRoot(File docRoot)
setDocRoot in interface VirtualServerdocRoot - the docroot of this VirtualServer.public File getDocRoot()
getDocRoot in interface VirtualServerpublic void setWebListeners(WebListener... webListeners)
webListeners - the collection of WebListener instances from which
this VirtualServer receives requests.public Collection<WebListener> getWebListeners()
getWebListeners in interface VirtualServerpublic void addContext(Context context, String contextRoot) throws ConfigException, GlassFishException
If this VirtualServer has already been started, the given context will be started as well.
addContext in interface VirtualServercontext - the Context to registercontextRoot - the context root at which to registerGlassFishExceptionConfigException - if a Context already exists
at the given context root on this VirtualServerpublic void removeContext(Context context) throws GlassFishException
removeContext in interface VirtualServercontext - the Context to be stopped and removedGlassFishExceptionpublic Context getContext(String contextRoot)
getContext in interface VirtualServercontextRoot - the context root whose Context to getpublic Collection<Context> getContexts()
getContexts in interface VirtualServerpublic void setConfig(VirtualServerConfig config) throws ConfigException
In order for the given configuration to take effect, this VirtualServer may be stopped and restarted.
setConfig in interface VirtualServerconfig - the configuration to be appliedConfigException - if the configuration requires a restart,
and this VirtualServer fails to be restartedpublic VirtualServerConfig getConfig()
getConfig in interface VirtualServerpublic void stop()
throws LifecycleException
ContainerBasestop in interface Lifecyclestop in class StandardHostLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void updateWebXml(ContextFacade facade, File file) throws Exception
ExceptionCopyright © 2017. All rights reserved.