Class JakartaWebSocketServletContainerInitializer
java.lang.Object
org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer
- All Implemented Interfaces:
jakarta.servlet.ServletContainerInitializer
public class JakartaWebSocketServletContainerInitializer
extends Object
implements jakarta.servlet.ServletContainerInitializer
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJakartaWebSocketServletContainerInitializer
(JakartaWebSocketServletContainerInitializer.Configurator configurator) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
configure
(ServletContextHandler context, JakartaWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandler
to callonStartup(Set, ServletContext)
during theServletContext
initialization phase.static jakarta.websocket.server.ServerContainer
initialize
(ServletContextHandler context) Immediately initialize theServletContext
with the default (and empty)ServerContainer
.void
-
Field Details
-
ATTR_JAKARTA_SERVER_CONTAINER
The ServletContext attribute key name for the ServerContainer per jakarta.websocket spec 1.0 final section 6.4 Programmatic Server Deployment -
ENABLE_KEY
- See Also:
-
HTTPCLIENT_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
JakartaWebSocketServletContainerInitializer
public JakartaWebSocketServletContainerInitializer() -
JakartaWebSocketServletContainerInitializer
public JakartaWebSocketServletContainerInitializer(JakartaWebSocketServletContainerInitializer.Configurator configurator)
-
-
Method Details
-
configure
public static void configure(ServletContextHandler context, JakartaWebSocketServletContainerInitializer.Configurator configurator) Configure theServletContextHandler
to callonStartup(Set, ServletContext)
during theServletContext
initialization phase.- Parameters:
context
- the context to add listener toconfigurator
- the lambda that is called to allow theServerContainer
to be configured during theServletContext
initialization phase
-
initialize
Immediately initialize theServletContext
with the default (and empty)ServerContainer
.This method is typically called from
onStartup(Set, ServletContext)
itself or from another dependentServletContainerInitializer
that 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
ServletContext
so with the basics needed to start configuring for `jakarta.websocket.server` based endpoints.- Parameters:
context
- the context to work with- Returns:
- the default
ServerContainer
for this context
-
onStartup
public void onStartup(Set<Class<?>> c, jakarta.servlet.ServletContext context) throws jakarta.servlet.ServletException - Specified by:
onStartup
in interfacejakarta.servlet.ServletContainerInitializer
- Throws:
jakarta.servlet.ServletException
-