Class PingingServletContextListener
- java.lang.Object
-
- pl.morgwai.base.servlet.guice.scopes.GuiceServletContextListener
-
- pl.morgwai.base.servlet.guice.utils.PingingServletContextListener
-
- All Implemented Interfaces:
ServletContextListener
,EventListener
public abstract class PingingServletContextListener extends GuiceServletContextListener
AGuiceServletContextListener
that automatically registers and deregistersEndpoints
added withGuiceServletContextListener.addEndpoint(Class, String)
to its associatedWebsocketPingerService
.
-
-
Field Summary
Fields Modifier and Type Field Description protected WebsocketPingerService
pingerService
-
Fields inherited from class pl.morgwai.base.servlet.guice.scopes.GuiceServletContextListener
appDeployment, containerCallScope, deploymentName, endpointConfigurator, endpointContainer, httpSessionScope, injector, servletModule, websocketConnectionScope
-
-
Constructor Summary
Constructors Constructor Description PingingServletContextListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GuiceServerEndpointConfigurator
createEndpointConfigurator()
Overrides default configurator used byGuiceServletContextListener.addEndpoint(Class, String)
to be aPingingEndpointConfigurator
.protected WebsocketPingerService
createPingerService()
Creates aWebsocketPingerService
.protected int
getPingFailureLimit()
Allows subclasses to override ping failure limit.protected int
getPingIntervalSeconds()
Allows subclasses to override ping interval.protected int
getPingSize()
Allows subclasses to override ping data size.protected boolean
isPingerInKeepAliveOnlyMode()
Allows subclasses to override pinger mode.protected boolean
shouldSynchronizePingSending()
Allows subclasses to overridesynchronizeSending
flag.-
Methods inherited from class pl.morgwai.base.servlet.guice.scopes.GuiceServletContextListener
addConfigurationHook, addEndpoint, addEndpoint, addEnsureSessionFilter, addFilter, addFilter, addFilter, addServlet, addShutdownHook, configureInjections, configureServletsFiltersEndpoints, contextDestroyed, contextInitialized, createInjector, getExecutorsTerminationTimeoutSeconds, handleUnterminatedExecutors
-
-
-
-
Field Detail
-
pingerService
protected final WebsocketPingerService pingerService
-
-
Method Detail
-
isPingerInKeepAliveOnlyMode
protected boolean isPingerInKeepAliveOnlyMode()
Allows subclasses to override pinger mode. By defaultfalse
.
-
getPingIntervalSeconds
protected int getPingIntervalSeconds()
Allows subclasses to override ping interval. By defaultWebsocketPingerService.DEFAULT_INTERVAL
.
-
getPingFailureLimit
protected int getPingFailureLimit()
Allows subclasses to override ping failure limit. By defaultWebsocketPingerService.DEFAULT_FAILURE_LIMIT
.
-
getPingSize
protected int getPingSize()
Allows subclasses to override ping data size. By defaultWebsocketPingerService.DEFAULT_PING_SIZE
.
-
shouldSynchronizePingSending
protected boolean shouldSynchronizePingSending()
Allows subclasses to overridesynchronizeSending
flag. By defaultfalse
.
-
createPingerService
protected WebsocketPingerService createPingerService()
Creates aWebsocketPingerService
. Used in constructor to initializepingerService
. By default usesisPingerInKeepAliveOnlyMode()
,getPingIntervalSeconds()
,getPingFailureLimit()
andgetPingSize()
to configure the returned service. May be overridden if non-standard customizations are required.
-
createEndpointConfigurator
protected GuiceServerEndpointConfigurator createEndpointConfigurator()
Overrides default configurator used byGuiceServletContextListener.addEndpoint(Class, String)
to be aPingingEndpointConfigurator
.- Overrides:
createEndpointConfigurator
in classGuiceServletContextListener
-
-