Class NativeWebSocketServletContainerInitializer
java.lang.Object
org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer
- All Implemented Interfaces:
javax.servlet.ServletContainerInitializer
public class NativeWebSocketServletContainerInitializer
extends Object
implements javax.servlet.ServletContainerInitializer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
configure
(org.eclipse.jetty.servlet.ServletContextHandler context, NativeWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandler
to call theNativeWebSocketServletContainerInitializer
during theServletContext
initialization phase.static NativeWebSocketConfiguration
getDefaultFrom
(javax.servlet.ServletContext context) Deprecated.static NativeWebSocketConfiguration
initialize
(org.eclipse.jetty.servlet.ServletContextHandler context) Immediately initialize theServletContextHandler
with the defaultNativeWebSocketConfiguration
.void
-
Field Details
-
ATTR_KEY
-
-
Constructor Details
-
NativeWebSocketServletContainerInitializer
public NativeWebSocketServletContainerInitializer()
-
-
Method Details
-
initialize
public static NativeWebSocketConfiguration initialize(org.eclipse.jetty.servlet.ServletContextHandler context) Immediately initialize theServletContextHandler
with the defaultNativeWebSocketConfiguration
.This method is typically called from
onStartup(Set, ServletContext)
itself or from another dependentServletContainerInitializer
that requires minimal setup to be performed.This method SHOULD NOT BE CALLED by users of Jetty. Use the
configure(ServletContextHandler, Configurator)
method instead.This will return the default
NativeWebSocketConfiguration
if already initialized, and not create a newNativeWebSocketConfiguration
each time it is called.- Parameters:
context
- the context to work with- Returns:
- the default
NativeWebSocketConfiguration
-
configure
public static void configure(org.eclipse.jetty.servlet.ServletContextHandler context, NativeWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandler
to call theNativeWebSocketServletContainerInitializer
during theServletContext
initialization phase.- Parameters:
context
- the context to add listener to.configurator
- a lambda that is called to allow theNativeWebSocketConfiguration
to be configured duringServletContext
initialization phase
-
getDefaultFrom
@Deprecated public static NativeWebSocketConfiguration getDefaultFrom(javax.servlet.ServletContext context) Deprecated.useconfigure(ServletContextHandler, Configurator)
insteadObtain the defaultNativeWebSocketConfiguration
from theServletContext
- Parameters:
context
- the context to work with- Returns:
- the default
NativeWebSocketConfiguration
- See Also:
-
onStartup
- Specified by:
onStartup
in interfacejavax.servlet.ServletContainerInitializer
-
configure(ServletContextHandler, Configurator)
instead