Class PingingEndpointConfigurator
- java.lang.Object
-
- jakarta.websocket.server.ServerEndpointConfig.Configurator
-
- pl.morgwai.base.servlet.scopes.GuiceServerEndpointConfigurator
-
- pl.morgwai.base.servlet.guiced.utils.PingingEndpointConfigurator
-
public class PingingEndpointConfigurator extends GuiceServerEndpointConfigurator
AGuiceServerEndpointConfigurator
that automatically registers and deregisters endpoints to theWebsocketPingerService
set withsetPingerService(WebsocketPingerService)
.- See Also:
PingingServletContextListener
-
-
Field Summary
-
Fields inherited from class pl.morgwai.base.servlet.scopes.GuiceServerEndpointConfigurator
log
-
-
Constructor Summary
Constructors Constructor Description PingingEndpointConfigurator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InvocationHandler
getAdditionalDecorator(Object endpoint)
Subclasses may override this method to further customize endpoints.protected List<Class<? extends Annotation>>
getRequiredEndpointMethodAnnotationTypes()
Returns a list of annotations of endpoint lifecycle methods that are required to be present.static void
setPingerService(WebsocketPingerService pingerService)
Sets theWebsocketPingerService
to be used.-
Methods inherited from class pl.morgwai.base.servlet.scopes.GuiceServerEndpointConfigurator
getEndpointInstance, modifyHandshake
-
Methods inherited from class jakarta.websocket.server.ServerEndpointConfig.Configurator
checkOrigin, getNegotiatedExtensions, getNegotiatedSubprotocol
-
-
-
-
Method Detail
-
setPingerService
public static void setPingerService(WebsocketPingerService pingerService)
Sets theWebsocketPingerService
to be used. Must be called inServletContextListener.contextInitialized(jakarta.servlet.ServletContextEvent)
or in listener's constructor.
-
getAdditionalDecorator
protected InvocationHandler getAdditionalDecorator(Object endpoint)
Description copied from class:GuiceServerEndpointConfigurator
Subclasses may override this method to further customize endpoints.InvocationHandler.invoke(Object, Method, Object[])
method of the returned handler will be executed withinContainerCallContext
andWebsocketConnectionContext
. By default it returns a handler that simply invokes a given method onendpoint
.- Overrides:
getAdditionalDecorator
in classGuiceServerEndpointConfigurator
-
getRequiredEndpointMethodAnnotationTypes
protected List<Class<? extends Annotation>> getRequiredEndpointMethodAnnotationTypes()
Description copied from class:GuiceServerEndpointConfigurator
Returns a list of annotations of endpoint lifecycle methods that are required to be present. By default a singleton ofOnOpen
. Subclasses may override this method if needed.- Overrides:
getRequiredEndpointMethodAnnotationTypes
in classGuiceServerEndpointConfigurator
-
-