@Service(name="com.sun.enterprise.web.WebContainer") @Singleton public class WebContainer extends Object implements Container, org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, EventListener
EventListener.Event<T>
Modifier and Type | Field and Description |
---|---|
protected int |
_debug
Controls the verbosity of the web container subsystem's debug messages.
|
protected File |
_modulesRoot
Absolute path for location where all the deployed standalone modules are stored for this Server Instance.
|
protected boolean |
_started
Has this component been started yet?
|
protected WebConfigListener |
configListener |
protected int |
defaultRedirectPort
The default-redirect port
|
static String |
DISPATCHER_MAX_DEPTH |
protected String |
globalAccessLogBufferSize
AccessLog buffer size for storing logs.
|
protected boolean |
globalAccessLoggingEnabled
Allow disabling accessLog mechanism
|
protected String |
globalAccessLogWriteInterval
AccessLog interval before the valve flush its buffer to the disk.
|
protected boolean |
globalSSOEnabled
The global (at the http-service level) ssoEnabled property.
|
protected HttpServiceStatsProviderBootstrap |
httpStatsProviderBootstrap |
protected ServerEnvironment |
instance
false when the Grizzly File Cache is enabled.
|
protected JspProbeProvider |
jspProbeProvider |
static String |
JWS_APPCLIENT_EAR_NAME |
static String |
JWS_APPCLIENT_WAR_NAME |
protected RequestProbeProvider |
requestProbeProvider |
protected ServletProbeProvider |
servletProbeProvider |
protected SessionProbeProvider |
sessionProbeProvider |
protected WebContainerFeatureFactory |
webContainerFeatureFactory |
protected WebModuleProbeProvider |
webModuleProbeProvider |
Constructor and Description |
---|
WebContainer() |
Modifier and Type | Method and Description |
---|---|
WebConnector |
addConnector(NetworkListener httpListener,
HttpService httpService,
boolean start) |
protected void |
configureHost(VirtualServer virtualServer,
SecurityService securityService)
Configures the given virtual server.
|
protected void |
configureHostPortNumbers(VirtualServer virtualServer,
HashSet<NetworkListener> listeners)
Configures the given virtual server with the port numbers of its associated http listeners.
|
void |
configureHttpServiceProperties(HttpService httpService,
PECoyoteConnector connector)
Deprecated.
most of these properties are handled elsewhere. validate and remove outdated properties checks
|
VirtualServer |
createHost(String virtualServerId,
VirtualServer virtualServerBean,
String docroot,
MimeMap mimeMap)
Create a virtual server/host.
|
VirtualServer |
createHost(VirtualServer vsBean,
HttpService httpService,
SecurityService securityService)
Creates a Host from a virtual-server config bean.
|
protected void |
createHosts(HttpService httpService,
SecurityService securityService)
Enumerates the virtual-server subelements of the given http-service element, and creates a corresponding Host for
each.
|
protected WebConnector |
createHttpListener(NetworkListener listener,
HttpService httpService)
Use an network-listener subelements and creates a corresponding Tomcat Connector for each.
|
protected WebConnector |
createHttpListener(NetworkListener listener,
HttpService httpService,
org.glassfish.grizzly.http.server.util.Mapper mapper) |
protected WebConnector |
createJKConnector(NetworkListener listener,
HttpService httpService)
Starts the AJP connector that will listen to call from Apache using mod_jk, mod_jk2 or mod_ajp.
|
<T extends javax.servlet.jsp.tagext.JspTag> |
createTagHandlerInstance(WebModule module,
Class<T> clazz)
Instantiates and injects the given tag handler class for the given WebModule
|
void |
deleteConnector(NetworkListener httpListener)
Stops and deletes the specified http listener.
|
void |
deleteConnector(WebConnector connector)
Stops and deletes the specified http listener.
|
void |
deleteHost(HttpService httpService)
Delete virtual-server.
|
void |
event(EventListener.Event<?> event)
Process a Glassfish/Payara event
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
String |
getApplicationId(WebModule webModule)
The application id for this web module HERCULES:add
|
Map<String,WebConnector> |
getConnectorMap() |
Class<? extends WebDeployer> |
getDeployer()
Returns the Deployer implementation capable of deploying applications to this
container.
|
Engine |
getEngine()
Return the parent/top-level container in _embedded for virtual servers.
|
HttpService |
getHttpService() |
WebConnector |
getJkConnector() |
JspProbeProvider |
getJspProbeProvider()
Gets the probe provider for jsp related events.
|
File |
getModulesRoot()
Return the Absolute path for location where all the deployed standalone modules are stored for this Server Instance.
|
String |
getName()
Returns a human redeable name for this container, this name is not used for
identifying the container but can be used to display messages belonging to
the container.
|
RequestProbeProvider |
getRequestProbeProvider()
Gets the probe provider for request/response related events.
|
ServerContext |
getServerContext()
Utility Method to access the ServerContext
|
ServletProbeProvider |
getServletProbeProvider()
Gets the probe provider for servlet related events.
|
SessionProbeProvider |
getSessionProbeProvider()
Gets the probe provider for session related events.
|
WebModuleProbeProvider |
getWebModuleProbeProvider()
Gets the probe provider for web module related events.
|
protected boolean |
isEnabled(String moduleName)
Whether or not a component (either an application or a module) should be enabled is defined by the "enable" attribute
on both the application/module element and the application-ref element.
|
boolean |
isShutdown()
Returns true if the container has been shut down.
|
protected boolean |
isTomcatUsingDefaultDomain()
is Tomcat using default domain name as its domain
|
Class<?> |
loadCommonClass(String className) |
void |
loadDefaultWebModule(VirtualServer vsBean)
Load a default-web-module on the specified virtual server.
|
void |
loadDefaultWebModule(VirtualServer virtualServer)
Load a default-web-module on the specified virtual server.
|
void |
loadDefaultWebModulesAfterAllAppsProcessed()
Configures a default web module for each virtual server if default-web-module is defined.
|
protected void |
loadStandaloneWebModule(VirtualServer virtualServer,
WebModuleConfig webModuleConfig)
Load the specified web module as a standalone module on the specified virtual server.
|
void |
loadSystemDefaultWebModules()
Configures a default web module for each virtual server based on the virtual server's docroot if a virtual server
does not specify any default-web-module, and none of its web modules are loaded at "/"
Needed in postConstruct before Deployment.ALL_APPLICATIONS_PROCESSED for "jsp from docroot before web container
start" scenario
|
List<Result<WebModule>> |
loadWebModule(WebModuleConfig webModuleConfig,
String j2eeApplication,
Properties deploymentProperties)
Creates and configures a web module for each virtual server that the web module is hosted under.
|
void |
postConstruct() |
void |
preDestroy() |
void |
registerAdHocPath(String path,
String ctxtRoot,
String appName,
AdHocServletInfo servletInfo)
Registers the given ad-hoc path at the given context root.
|
void |
registerAdHocPathAndSubtree(String path,
String subtree,
String ctxtRoot,
String appName,
AdHocServletInfo servletInfo)
Registers the given ad-hoc path and subtree at the given context root.
|
void |
stop()
Gracefully terminate the active use of the public methods of this component.
|
boolean |
suspendWebModule(String contextRoot,
String appName,
String hosts)
Suspends the web application with the given appName that has been deployed at the given contextRoot on the given
virtual servers.
|
void |
unloadWebModule(String contextRoot,
String appName,
String virtualServers,
boolean dummy,
Properties props)
Undeploy a web application.
|
void |
unloadWebModule(String contextRoot,
String appName,
String virtualServers,
Properties props)
Undeploy a web application.
|
void |
unregisterAdHocPath(String path,
String ctxtRoot)
Unregisters the given ad-hoc path from the given context root.
|
void |
unregisterAdHocPathAndSubtree(String path,
String subtree,
String ctxtRoot)
Unregisters the given ad-hoc path and subtree from the given context root.
|
void |
updateAccessLog(HttpService httpService)
Reconfigures the access log valve of each virtual server with the updated attributes of the
|
void |
updateConnector(NetworkListener networkListener,
HttpService httpService)
Update an network-listener
|
void |
updateConnectorProperty(NetworkListener listener,
String propName,
String propValue)
Update an http-listener property
|
protected void |
updateDefaultWebModule(VirtualServer virtualServer,
String[] listenerNames,
WebModuleConfig webModuleConfig) |
void |
updateHost(VirtualServer vsBean)
Updates a virtual-server element.
|
void |
updateHostProperties(VirtualServer vsBean,
String name,
String value,
SecurityService securityService,
VirtualServer virtualServer)
Update virtual-server properties.
|
void |
updateHttpService(HttpService httpService)
Processes an update to the http-service element
|
void |
updateJvmRoute(HttpService httpService,
String jvmOption) |
void |
updateMapper(HttpService httpService,
NetworkListener httpListener,
org.glassfish.grizzly.http.server.util.Mapper mapper)
Method gets called, when GrizzlyService changes HTTP Mapper, associated with specific port.
|
protected void |
validateDocroot(String docroot,
String virtualServerId,
String defaultWebModule)
Validate the docroot properties of a virtual-server.
|
public static final String DISPATCHER_MAX_DEPTH
public static final String JWS_APPCLIENT_EAR_NAME
public static final String JWS_APPCLIENT_WAR_NAME
protected boolean globalAccessLoggingEnabled
protected String globalAccessLogBufferSize
protected String globalAccessLogWriteInterval
protected int defaultRedirectPort
@Inject protected ServerEnvironment instance
protected int _debug
protected File _modulesRoot
protected boolean _started
protected boolean globalSSOEnabled
protected volatile WebContainerFeatureFactory webContainerFeatureFactory
protected JspProbeProvider jspProbeProvider
protected RequestProbeProvider requestProbeProvider
protected ServletProbeProvider servletProbeProvider
protected SessionProbeProvider sessionProbeProvider
protected WebModuleProbeProvider webModuleProbeProvider
protected WebConfigListener configListener
protected HttpServiceStatsProviderBootstrap httpStatsProviderBootstrap
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public void event(EventListener.Event<?> event)
EventListener
event
in interface EventListener
public void preDestroy()
preDestroy
in interface org.glassfish.hk2.api.PreDestroy
public boolean isShutdown()
public ServletProbeProvider getServletProbeProvider()
public JspProbeProvider getJspProbeProvider()
public SessionProbeProvider getSessionProbeProvider()
public RequestProbeProvider getRequestProbeProvider()
public WebModuleProbeProvider getWebModuleProbeProvider()
public String getName()
Container
public Class<? extends WebDeployer> getDeployer()
Container
getDeployer
in interface Container
public WebConnector getJkConnector()
public Map<String,WebConnector> getConnectorMap()
public <T extends javax.servlet.jsp.tagext.JspTag> T createTagHandlerInstance(WebModule module, Class<T> clazz) throws Exception
T
- module
- clazz
- Exception
protected WebConnector createHttpListener(NetworkListener listener, HttpService httpService)
listener
- the NetworkListener config object.httpService
- the http-service element.protected WebConnector createHttpListener(NetworkListener listener, HttpService httpService, org.glassfish.grizzly.http.server.util.Mapper mapper)
protected WebConnector createJKConnector(NetworkListener listener, HttpService httpService)
listener
- httpService
- public void configureHttpServiceProperties(HttpService httpService, PECoyoteConnector connector)
httpService
- connector
- protected void createHosts(HttpService httpService, SecurityService securityService)
httpService
- The http-service elementsecurityService
- The security-service elementpublic VirtualServer createHost(VirtualServer vsBean, HttpService httpService, SecurityService securityService)
vsBean
- The virtual-server configuration beanhttpService
- The http-service element.securityService
- The security-service elementprotected void validateDocroot(String docroot, String virtualServerId, String defaultWebModule)
docroot
- virtualServerId
- defaultWebModule
- protected void configureHost(VirtualServer virtualServer, SecurityService securityService)
virtualServer
- The virtual server to be configuredsecurityService
- The security-service elementprotected void configureHostPortNumbers(VirtualServer virtualServer, HashSet<NetworkListener> listeners)
virtualServer
- The virtual server to configurelisteners
- The http listeners with which the given virtual server is associatedpublic VirtualServer createHost(String virtualServerId, VirtualServer virtualServerBean, String docroot, MimeMap mimeMap)
virtualServerId
- virtualServerBean
- docroot
- mimeMap
- public void stop() throws LifecycleException
IllegalStateException
- if this component has not been startedLifecycleException
- if this component detects a fatal error that needs to be reportedpublic void loadSystemDefaultWebModules()
public void loadDefaultWebModulesAfterAllAppsProcessed()
public void loadDefaultWebModule(VirtualServer vsBean)
vsBean
- public void loadDefaultWebModule(VirtualServer virtualServer)
virtualServer
- protected void loadStandaloneWebModule(VirtualServer virtualServer, WebModuleConfig webModuleConfig)
virtualServer
- webModuleConfig
- protected boolean isEnabled(String moduleName)
moduleName
- The name of the component (application or module)public List<Result<WebModule>> loadWebModule(WebModuleConfig webModuleConfig, String j2eeApplication, Properties deploymentProperties)
webModuleConfig
- j2eeApplication
- deploymentProperties
- protected void updateDefaultWebModule(VirtualServer virtualServer, String[] listenerNames, WebModuleConfig webModuleConfig) throws LifecycleException
LifecycleException
public ServerContext getServerContext()
public String getApplicationId(WebModule webModule)
webModule
- public File getModulesRoot()
public void unloadWebModule(String contextRoot, String appName, String virtualServers, Properties props)
contextRoot
- the context's name to undeployappName
- the J2EE appname used at deployment timevirtualServers
- List of current virtual-server object.props
- public void unloadWebModule(String contextRoot, String appName, String virtualServers, boolean dummy, Properties props)
contextRoot
- the context's name to undeployappName
- the J2EE appname used at deployment timevirtualServers
- List of current virtual-server object.dummy
- true if the web module to be undeployed is a dummy web module, that is, a web module created off of a
virtual server's docrootprops
- public boolean suspendWebModule(String contextRoot, String appName, String hosts)
contextRoot
- the context rootappName
- the J2EE appname used at deployment timehosts
- the list of virtual serverspublic LifecycleListener[] findLifecycleListeners()
public Engine getEngine()
public HttpService getHttpService()
public void registerAdHocPath(String path, String ctxtRoot, String appName, AdHocServletInfo servletInfo)
path
- The ad-hoc path to registerctxtRoot
- The context root at which to registerappName
- The name of the application with which the ad-hoc path is associatedservletInfo
- Info about the ad-hoc servlet that will service requests on the given pathpublic void registerAdHocPathAndSubtree(String path, String subtree, String ctxtRoot, String appName, AdHocServletInfo servletInfo)
path
- The ad-hoc path to registersubtree
- The ad-hoc subtree path to registerctxtRoot
- The context root at which to registerappName
- The name of the application with which the ad-hoc path and subtree are associatedservletInfo
- Info about the ad-hoc servlet that will service requests on the given ad-hoc path and subtreepublic void unregisterAdHocPath(String path, String ctxtRoot)
path
- The ad-hoc path to unregisterctxtRoot
- The context root from which to unregisterpublic void unregisterAdHocPathAndSubtree(String path, String subtree, String ctxtRoot)
path
- The ad-hoc path to unregistersubtree
- The ad-hoc subtree to unregisterctxtRoot
- The context root from which to unregisterpublic void deleteHost(HttpService httpService) throws LifecycleException
httpService
- element which contains the configuration info.LifecycleException
public void updateHost(VirtualServer vsBean) throws LifecycleException
vsBean
- the virtual-server config bean.LifecycleException
public void updateHostProperties(VirtualServer vsBean, String name, String value, SecurityService securityService, VirtualServer virtualServer)
vsBean
- name
- value
- virtualServer
- securityService
- public void updateHttpService(HttpService httpService) throws LifecycleException
httpService
- LifecycleException
public void updateConnectorProperty(NetworkListener listener, String propName, String propValue) throws LifecycleException
listener
- the configuration bean.propName
- the property namepropValue
- the property valueLifecycleException
public void updateConnector(NetworkListener networkListener, HttpService httpService) throws LifecycleException
networkListener
- httpService
- the configuration bean.LifecycleException
public void updateMapper(HttpService httpService, NetworkListener httpListener, org.glassfish.grizzly.http.server.util.Mapper mapper)
httpService
- HttpService
httpListener
- NetworkListener
, which Mapper
was changedmapper
- new Mapper
valuepublic WebConnector addConnector(NetworkListener httpListener, HttpService httpService, boolean start) throws LifecycleException
LifecycleException
public void deleteConnector(WebConnector connector) throws LifecycleException
connector
- LifecycleException
public void deleteConnector(NetworkListener httpListener) throws LifecycleException
httpListener
- LifecycleException
public void updateAccessLog(HttpService httpService)
httpService
- public void updateJvmRoute(HttpService httpService, String jvmOption)
protected boolean isTomcatUsingDefaultDomain()
Copyright © 2019. All rights reserved.