javax.servlet.ServletContainerInitializerpublic class WebSocketServerContainerInitializer
extends java.lang.Object
implements javax.servlet.ServletContainerInitializer
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
WebSocketServerContainerInitializer.Configurator |
|
static class |
WebSocketServerContainerInitializer.ContextDestroyListener |
DestroyListener
|
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ADD_DYNAMIC_FILTER_KEY |
|
static java.lang.String |
ATTR_JAVAX_SERVER_CONTAINER |
The ServletContext attribute key name for the
ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment
|
static java.lang.String |
ENABLE_KEY |
|
static java.lang.String |
HTTPCLIENT_ATTRIBUTE |
| Constructor | Description |
|---|---|
WebSocketServerContainerInitializer() |
| Modifier and Type | Method | Description |
|---|---|---|
static void |
configure(org.eclipse.jetty.servlet.ServletContextHandler context,
WebSocketServerContainerInitializer.Configurator configurator) |
Configure the
ServletContextHandler to call onStartup(Set, ServletContext)
during the ServletContext initialization phase. |
static ServerContainer |
configureContext(javax.servlet.ServletContext context,
org.eclipse.jetty.servlet.ServletContextHandler jettyContext) |
Deprecated.
use
configure(ServletContextHandler, Configurator) instead |
static ServerContainer |
configureContext(org.eclipse.jetty.servlet.ServletContextHandler context) |
Deprecated.
use
configure(ServletContextHandler, Configurator) instead |
static ServerContainer |
initialize(org.eclipse.jetty.servlet.ServletContextHandler context) |
Immediately initialize the
ServletContext with the default (and empty) ServerContainer. |
static boolean |
isEnabledViaContext(javax.servlet.ServletContext context,
java.lang.String keyName,
boolean defValue) |
Test a ServletContext for
init-param or attribute at keyName for
true or false setting that determines if the specified feature is enabled (or not). |
void |
onStartup(java.util.Set<java.lang.Class<?>> c,
javax.servlet.ServletContext context) |
public static final java.lang.String ATTR_JAVAX_SERVER_CONTAINER
public static final java.lang.String ENABLE_KEY
public static final java.lang.String ADD_DYNAMIC_FILTER_KEY
public static final java.lang.String HTTPCLIENT_ATTRIBUTE
public WebSocketServerContainerInitializer()
public static boolean isEnabledViaContext(javax.servlet.ServletContext context,
java.lang.String keyName,
boolean defValue)
init-param or attribute at keyName for
true or false setting that determines if the specified feature is enabled (or not).context - the context to searchkeyName - the key namedefValue - the default value, if the value is not specified in the context@Deprecated public static ServerContainer configureContext(org.eclipse.jetty.servlet.ServletContextHandler context) throws javax.servlet.ServletException
configure(ServletContextHandler, Configurator) insteadcontext - the ServletContextHandler to useServerContainer instancejavax.servlet.ServletException - if the WebSocketUpgradeFilter cannot be configured@Deprecated public static ServerContainer configureContext(javax.servlet.ServletContext context, org.eclipse.jetty.servlet.ServletContextHandler jettyContext) throws javax.servlet.ServletException
configure(ServletContextHandler, Configurator) insteadcontext - not usedjettyContext - the ServletContextHandler to useServerContainer instancejavax.servlet.ServletException - if the WebSocketUpgradeFilter cannot be configuredpublic static ServerContainer initialize(org.eclipse.jetty.servlet.ServletContextHandler context) throws javax.servlet.ServletException
ServletContext with the default (and empty) ServerContainer.
This method is typically called from onStartup(Set, ServletContext) itself or from
another dependent ServletContainerInitializer that requires minimal setup to
be performed.
This method SHOULD NOT BE CALLED by users of Jetty.
Use the configure(ServletContextHandler, Configurator) method instead.
There is no enablement check here, and no automatic deployment of endpoints at this point
in time. It merely sets up the ServletContext so with the basics needed to start
configuring for `javax.websocket.server` based endpoints.
context - the context to work withServerContainer for this contextjavax.servlet.ServletExceptionpublic static void configure(org.eclipse.jetty.servlet.ServletContextHandler context,
WebSocketServerContainerInitializer.Configurator configurator)
ServletContextHandler to call onStartup(Set, ServletContext)
during the ServletContext initialization phase.context - the context to add listener toconfigurator - the lambda that is called to allow the ServerContainer to
be configured during the ServletContext initialization phasepublic void onStartup(java.util.Set<java.lang.Class<?>> c,
javax.servlet.ServletContext context)
throws javax.servlet.ServletException
onStartup in interface javax.servlet.ServletContainerInitializerjavax.servlet.ServletExceptionCopyright © 1995–2019 Webtide. All rights reserved.