Class JavaxWebSocketServletContainerInitializer
java.lang.Object
org.eclipse.jetty.ee8.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer
- All Implemented Interfaces:
javax.servlet.ServletContainerInitializer
public class JavaxWebSocketServletContainerInitializer
extends Object
implements javax.servlet.ServletContainerInitializer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJavaxWebSocketServletContainerInitializer(JavaxWebSocketServletContainerInitializer.Configurator configurator) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(ServletContextHandler context, JavaxWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandlerto callonStartup(Set, ServletContext)during theServletContextinitialization phase.static javax.websocket.server.ServerContainerinitialize(ServletContextHandler context) Immediately initialize theServletContextwith the default (and empty)ServerContainer.void
-
Field Details
-
ATTR_JAKARTA_SERVER_CONTAINER
The ServletContext attribute key name for the ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment -
ENABLE_KEY
- See Also:
-
HTTPCLIENT_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
JavaxWebSocketServletContainerInitializer
public JavaxWebSocketServletContainerInitializer() -
JavaxWebSocketServletContainerInitializer
public JavaxWebSocketServletContainerInitializer(JavaxWebSocketServletContainerInitializer.Configurator configurator)
-
-
Method Details
-
configure
public static void configure(ServletContextHandler context, JavaxWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandlerto callonStartup(Set, ServletContext)during theServletContextinitialization phase.- Parameters:
context- the context to add listener toconfigurator- the lambda that is called to allow theServerContainerto be configured during theServletContextinitialization phase
-
initialize
Immediately initialize theServletContextwith the default (and empty)ServerContainer.This method is typically called from
onStartup(Set, ServletContext)itself or from another dependentServletContainerInitializerthat requires minimal setup to be performed.Users of Jetty should 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
ServletContextso with the basics needed to start configuring for `javax.websocket.server` based endpoints.- Parameters:
context- the context to work with- Returns:
- the default
ServerContainerfor this context
-
onStartup
-