Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.server.config

public Class JettyWebSocketServletContainerInitializer

extends Object
implements ServletContainerInitializer
Class Inheritance
All Implemented Interfaces
jakarta.servlet.ServletContainerInitializer
Imports
java.util.Set, jakarta.servlet.ServletContainerInitializer, .ServletContext, org.eclipse.jetty.ee10.servlet.ServletContextHandler, org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer, org.eclipse.jetty.websocket.core.WebSocketComponents, org.eclipse.jetty.websocket.core.server.WebSocketMappings, .WebSocketServerComponents, org.slf4j.Logger, .LoggerFactory

ServletContext configuration for Jetty Native WebSockets API.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private final JettyWebSocketServletContainerInitializer.Configurator
private static final Logger

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public static void
configure(ServletContextHandler
the context to add listener to.
context
,
JettyWebSocketServletContainerInitializer.Configurator
a lambda that is called to allow the WebSocketMappings to be configured during ServletContext initialization phase
configurator
)

Configure the ServletContextHandler to call the JettyWebSocketServletContainerInitializer during the ServletContext initialization phase.

private static JettyWebSocketServerContainer

Returns:

the default JettyWebSocketServerContainer
initialize
(ServletContextHandler
the context to work with
context
)

Immediately initialize the ServletContextHandler with the default JettyWebSocketServerContainer.

public void
onStartup(Set<Class<?>>
the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes
c
,
ServletContext
the ServletContext of the web application that is being started and in which the classes contained in c were found
context
)

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configuratorback to summary
private final JettyWebSocketServletContainerInitializer.Configurator configurator
LOGback to summary
private static final Logger LOG

Constructor Detail

JettyWebSocketServletContainerInitializerback to summary
public JettyWebSocketServletContainerInitializer()
JettyWebSocketServletContainerInitializerback to summary
public JettyWebSocketServletContainerInitializer(JettyWebSocketServletContainerInitializer.Configurator configurator)

Method Detail

configureback to summary
public static void configure(ServletContextHandler context, JettyWebSocketServletContainerInitializer.Configurator configurator)

Configure the ServletContextHandler to call the JettyWebSocketServletContainerInitializer during the ServletContext initialization phase.

Parameters
context:ServletContextHandler

the context to add listener to.

configurator:JettyWebSocketServletContainerInitializer.Configurator

a lambda that is called to allow the WebSocketMappings to be configured during ServletContext initialization phase

initializeback to summary
private static JettyWebSocketServerContainer initialize(ServletContextHandler context)

Immediately initialize the ServletContextHandler with the default JettyWebSocketServerContainer.

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.

This will return the default JettyWebSocketServerContainer if already initialized, and not create a new JettyWebSocketServerContainer each time it is called.

Parameters
context:ServletContextHandler

the context to work with

Returns:JettyWebSocketServerContainer

the default JettyWebSocketServerContainer

onStartupback to summary
public void onStartup(Set<Class<?>> c, ServletContext context)

Implements jakarta.servlet.ServletContainerInitializer.onStartup.

Doc from jakarta.servlet.ServletContainerInitializer.onStartup.

Notifies this ServletContainerInitializer of the startup of the application represented by the given ServletContext.

If this ServletContainerInitializer is bundled in a JAR file inside the WEB-INF/lib directory of an application, its onStartup method will be invoked only once during the startup of the bundling application. If this ServletContainerInitializer is bundled inside a JAR file outside of any WEB-INF/lib directory, but still discoverable as described above, its onStartup method will be invoked every time an application is started.

Parameters
c:Set<Class<?>>

the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes

context:ServletContext

the ServletContext of the web application that is being started and in which the classes contained in c were found

Annotations
@Override
org.eclipse.jetty.ee10.websocket.server.config back to summary

public Interface JettyWebSocketServletContainerInitializer.Configurator


Method Summary

Modifier and TypeMethod and Description
public void

Method Detail

acceptback to summary
public void accept(ServletContext servletContext, JettyWebSocketServerContainer container)