Top Description Inners Fields Constructors Methods
org.springframework.web.socket.messaging

public Class SubProtocolWebSocketHandler

extends Object
implements WebSocketHandler, SubProtocolCapable, MessageHandler, SmartLifecycle
Class Inheritance
All Implemented Interfaces
org.springframework.context.SmartLifecycle, org.springframework.context.Phased, org.springframework.context.Lifecycle, org.springframework.messaging.MessageHandler, org.springframework.web.socket.SubProtocolCapable, org.springframework.web.socket.WebSocketHandler
Imports
java.util.ArrayList, .Collections, .LinkedHashSet, .List, .Map, .Set, .TreeMap, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicInteger, java.util.concurrent.locks.Lock, .ReentrantLock, org.apache.commons.logging.Log, .LogFactory, org.springframework.context.SmartLifecycle, org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessageChannel, .MessageHandler, .MessagingException, .SubscribableChannel, org.springframework.util.Assert, .CollectionUtils, .StringUtils, org.springframework.web.socket.CloseStatus, .SubProtocolCapable, .WebSocketHandler, .WebSocketMessage, .WebSocketSession, org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator, .SessionLimitExceededException, .WebSocketSessionDecorator, org.springframework.web.socket.sockjs.transport.session.PollingSockJsSession, .StreamingSockJsSession

An implementation of WebSocketHandler that delegates incoming WebSocket messages to a SubProtocolHandler along with a MessageChannel to which the sub-protocol handler can send messages from WebSocket clients to the application.

Also an implementation of MessageHandler that finds the WebSocket session associated with the Message and passes it, along with the message, to the sub-protocol handler to send messages from the application back to the client.

Authors
Rossen Stoyanchev, Juergen Hoeller, Andy Wilkinson, Artem Bilan
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
public static interface
SubProtocolWebSocketHandler.Stats

Contract for access to session counters.

private static class

Field Summary

Modifier and TypeField and Description
private final MessageChannel
private final SubscribableChannel
private static final int
private SubProtocolHandler
private volatile long
private final Object
private final Log
private Integer
private final Map<String, SubProtocolHandler>
private final Set<SubProtocolHandler>
private volatile boolean
private int
private int
private final Lock
private final Map<String, SubProtocolWebSocketHandler.WebSocketSessionHolder>
private final SubProtocolWebSocketHandler.DefaultStats
private int

Constructor Summary

AccessConstructor and Description
public
SubProtocolWebSocketHandler(MessageChannel
the inbound MessageChannel
clientInboundChannel
,
SubscribableChannel
the outbound MessageChannel
clientOutboundChannel
)

Create a new SubProtocolWebSocketHandler for the given inbound and outbound channels.

Method Summary

Modifier and TypeMethod and Description
public void
addProtocolHandler(SubProtocolHandler handler)

Register a sub-protocol handler.

public void
afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus)

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred.

public void
afterConnectionEstablished(WebSocketSession session)

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.

private void
checkSessions()

A higher-level protocol can use heartbeats to detect sessions that need to be cleaned up.

private void
protected WebSocketSession

Returns:

the decorated WebSocketSession, or potentially the given session as-is
decorateSession
(WebSocketSession
the original WebSocketSession
session
)

Decorate the given WebSocketSession, if desired.

protected final SubProtocolHandler
findProtocolHandler(WebSocketSession
the WebSocketSession to find a handler for
session
)

Find a SubProtocolHandler for the given session.

public SubProtocolHandler
getDefaultProtocolHandler()

Return the default sub-protocol handler to use.

public int
getPhase()

Overrides default org.springframework.context.SmartLifecycle.getPhase.

Return the phase that this lifecycle object is supposed to run in.

The default implementation returns DEFAULT_PHASE in order to let stop() callbacks execute before regular Lifecycle implementations.

public Map<String, SubProtocolHandler>
getProtocolHandlerMap()

Return the sub-protocols keyed by protocol name.

public List<SubProtocolHandler>
public int
getSendBufferSizeLimit()

Return the buffer-size limit (number of bytes).

public int
getSendTimeLimit()

Return the send-time limit (milliseconds).

public SubProtocolWebSocketHandler.Stats
getStats()

Return a structured object with various session counters.

public String
getStatsInfo()

Return a String describing internal state and counters.

public List<String>
public int
getTimeToFirstMessage()

Return the maximum time allowed after the WebSocket connection is established and before the first sub-protocol message.

public void
handleMessage(WebSocketSession session, WebSocketMessage<?> message)

Implements org.springframework.web.socket.WebSocketHandler.handleMessage.

Handle an inbound message from a WebSocket client.

public void
handleMessage(Message<?>
the message to be handled
message
)

Implements org.springframework.messaging.MessageHandler.handleMessage.

Handle an outbound Spring Message to a WebSocket client.

public void
handleTransportError(WebSocketSession session, Throwable exception)

Implements org.springframework.web.socket.WebSocketHandler.handleTransportError.

Handle an error from the underlying WebSocket message transport.

public final boolean
isRunning()

Implements org.springframework.context.Lifecycle.isRunning.

Check whether this component is currently running.

private String
public void
setDefaultProtocolHandler(SubProtocolHandler
the default handler
defaultProtocolHandler
)

Set the SubProtocolHandler to use when the client did not request a sub-protocol.

public void
setPhase(int phase)

Set the phase that this handler should run in.

By default, this is SmartLifecycle#DEFAULT_PHASE.

public void
setProtocolHandlers(List<SubProtocolHandler>
the sub-protocol handlers to use
protocolHandlers
)

Configure one or more handlers to use depending on the sub-protocol requested by the client in the WebSocket handshake request.

public void
setSendBufferSizeLimit(int sendBufferSizeLimit)

Specify the buffer-size limit (number of bytes).

public void
setSendTimeLimit(int sendTimeLimit)

Specify the send-time limit (milliseconds).

public void
setTimeToFirstMessage(int
the maximum time allowed in milliseconds
timeToFirstMessage
)

Set the maximum time allowed in milliseconds after the WebSocket connection is established and before the first sub-protocol message is received.

public final void
start()

Implements org.springframework.context.Lifecycle.start.

Start this component.

public final void
stop()

Implements org.springframework.context.Lifecycle.stop.

Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method.

public final void
stop(Runnable callback)

Overrides default org.springframework.context.SmartLifecycle.stop.

Indicates that a Lifecycle component must stop if it is currently running.

public boolean
supportsPartialMessages()

Implements org.springframework.web.socket.WebSocketHandler.supportsPartialMessages.

Whether the WebSocketHandler handles partial messages.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

clientInboundChannelback to summary
private final MessageChannel clientInboundChannel
clientOutboundChannelback to summary
private final SubscribableChannel clientOutboundChannel
DEFAULT_TIME_TO_FIRST_MESSAGEback to summary
private static final int DEFAULT_TIME_TO_FIRST_MESSAGE

The default value for timeToFirstMessage.

defaultProtocolHandlerback to summary
private SubProtocolHandler defaultProtocolHandler
Annotations
@Nullable
lastSessionCheckTimeback to summary
private volatile long lastSessionCheckTime
lifecycleMonitorback to summary
private final Object lifecycleMonitor
loggerback to summary
private final Log logger
phaseback to summary
private Integer phase
Annotations
@Nullable
protocolHandlerLookupback to summary
private final Map<String, SubProtocolHandler> protocolHandlerLookup
protocolHandlersback to summary
private final Set<SubProtocolHandler> protocolHandlers
runningback to summary
private volatile boolean running
sendBufferSizeLimitback to summary
private int sendBufferSizeLimit
sendTimeLimitback to summary
private int sendTimeLimit
sessionCheckLockback to summary
private final Lock sessionCheckLock
sessionsback to summary
private final Map<String, SubProtocolWebSocketHandler.WebSocketSessionHolder> sessions
statsback to summary
private final SubProtocolWebSocketHandler.DefaultStats stats
timeToFirstMessageback to summary
private int timeToFirstMessage

Constructor Detail

SubProtocolWebSocketHandlerback to summary
public SubProtocolWebSocketHandler(MessageChannel clientInboundChannel, SubscribableChannel clientOutboundChannel)

Create a new SubProtocolWebSocketHandler for the given inbound and outbound channels.

Parameters
clientInboundChannel:MessageChannel

the inbound MessageChannel

clientOutboundChannel:SubscribableChannel

the outbound MessageChannel

Method Detail

addProtocolHandlerback to summary
public void addProtocolHandler(SubProtocolHandler handler)

Register a sub-protocol handler.

afterConnectionClosedback to summary
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

Doc from org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred. Although the session may technically still be open, depending on the underlying implementation, sending messages at this point is discouraged and most likely will not succeed.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
afterConnectionEstablishedback to summary
public void afterConnectionEstablished(WebSocketSession session) throws Exception

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Doc from org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
checkSessionsback to summary
private void checkSessions()

A higher-level protocol can use heartbeats to detect sessions that need to be cleaned up. However, if a WebSocket session is established, but messages can't flow (e.g. due to a proxy issue), then the higher level protocol is never successfully negotiated, and without heartbeats, sessions can hang. The method checks for sessions that have not received any messages 60 seconds after the WebSocket session was established, and closes them.

clearSessionback to summary
private void clearSession(WebSocketSession session, CloseStatus closeStatus) throws Exception
decorateSessionback to summary
protected WebSocketSession decorateSession(WebSocketSession session)

Decorate the given WebSocketSession, if desired.

The default implementation builds a ConcurrentWebSocketSessionDecorator with the configured send-time limit and buffer-size limit.

Parameters
session:WebSocketSession

the original WebSocketSession

Returns:WebSocketSession

the decorated WebSocketSession, or potentially the given session as-is

Since
4.3.13
findProtocolHandlerback to summary
protected final SubProtocolHandler findProtocolHandler(WebSocketSession session)

Find a SubProtocolHandler for the given session.

Parameters
session:WebSocketSession

the WebSocketSession to find a handler for

getDefaultProtocolHandlerback to summary
public SubProtocolHandler getDefaultProtocolHandler()

Return the default sub-protocol handler to use.

Annotations
@Nullable
getPhaseback to summary
public int getPhase()

Overrides default org.springframework.context.SmartLifecycle.getPhase.

Doc from org.springframework.context.SmartLifecycle.getPhase.

Return the phase that this lifecycle object is supposed to run in.

The default implementation returns DEFAULT_PHASE in order to let stop() callbacks execute before regular Lifecycle implementations.

Annotations
@Override
getProtocolHandlerMapback to summary
public Map<String, SubProtocolHandler> getProtocolHandlerMap()

Return the sub-protocols keyed by protocol name.

getProtocolHandlersback to summary
public List<SubProtocolHandler> getProtocolHandlers()
getSendBufferSizeLimitback to summary
public int getSendBufferSizeLimit()

Return the buffer-size limit (number of bytes).

getSendTimeLimitback to summary
public int getSendTimeLimit()

Return the send-time limit (milliseconds).

getStatsback to summary
public SubProtocolWebSocketHandler.Stats getStats()

Return a structured object with various session counters.

Since
5.2
getStatsInfoback to summary
public String getStatsInfo()

Return a String describing internal state and counters. Effectively toString() on getStats().

getSubProtocolsback to summary
public List<String> getSubProtocols()

Implements org.springframework.web.socket.SubProtocolCapable.getSubProtocols.

Return all supported protocols.

Annotations
@Override
getTimeToFirstMessageback to summary
public int getTimeToFirstMessage()

Return the maximum time allowed after the WebSocket connection is established and before the first sub-protocol message.

Since
5.1
handleMessageback to summary
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception

Implements org.springframework.web.socket.WebSocketHandler.handleMessage.

Handle an inbound message from a WebSocket client.

Annotations
@Override
Exceptions
Exception:

Doc from org.springframework.web.socket.WebSocketHandler.handleMessage.

this method can handle or propagate exceptions; see class-level Javadoc for details.

handleMessageback to summary
public void handleMessage(Message<?> message) throws MessagingException

Implements org.springframework.messaging.MessageHandler.handleMessage.

Handle an outbound Spring Message to a WebSocket client.

Parameters
message:Message<?>

Doc from org.springframework.messaging.MessageHandler.handleMessage.

the message to be handled

Annotations
@Override
Exceptions
MessagingException:

Doc from org.springframework.messaging.MessageHandler.handleMessage.

if the handler failed to process the message

handleTransportErrorback to summary
public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception

Implements org.springframework.web.socket.WebSocketHandler.handleTransportError.

Doc from org.springframework.web.socket.WebSocketHandler.handleTransportError.

Handle an error from the underlying WebSocket message transport.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
isRunningback to summary
public final boolean isRunning()

Implements org.springframework.context.Lifecycle.isRunning.

Doc from org.springframework.context.Lifecycle.isRunning.

Check whether this component is currently running.

In the case of a container, this will return true only if all components that apply are currently running.

Returns:boolean

whether the component is currently running

Annotations
@Override
resolveSessionIdback to summary
private String resolveSessionId(Message<?> message)
Annotations
@Nullable
setDefaultProtocolHandlerback to summary
public void setDefaultProtocolHandler(SubProtocolHandler defaultProtocolHandler)

Set the SubProtocolHandler to use when the client did not request a sub-protocol.

Parameters
defaultProtocolHandler:SubProtocolHandler

the default handler

setPhaseback to summary
public void setPhase(int phase)

Set the phase that this handler should run in.

By default, this is SmartLifecycle#DEFAULT_PHASE.

Since
6.1.4
setProtocolHandlersback to summary
public void setProtocolHandlers(List<SubProtocolHandler> protocolHandlers)

Configure one or more handlers to use depending on the sub-protocol requested by the client in the WebSocket handshake request.

Parameters
protocolHandlers:List<SubProtocolHandler>

the sub-protocol handlers to use

setSendBufferSizeLimitback to summary
public void setSendBufferSizeLimit(int sendBufferSizeLimit)

Specify the buffer-size limit (number of bytes).

See Also
ConcurrentWebSocketSessionDecorator
setSendTimeLimitback to summary
public void setSendTimeLimit(int sendTimeLimit)

Specify the send-time limit (milliseconds).

See Also
ConcurrentWebSocketSessionDecorator
setTimeToFirstMessageback to summary
public void setTimeToFirstMessage(int timeToFirstMessage)

Set the maximum time allowed in milliseconds after the WebSocket connection is established and before the first sub-protocol message is received.

This handler is for WebSocket connections that use a sub-protocol. Therefore, we expect the client to send at least one sub-protocol message in the beginning, or else we assume the connection isn't doing well, e.g. proxy issue, slow network, and can be closed.

By default this is set to 60,000 (1 minute).

Parameters
timeToFirstMessage:int

the maximum time allowed in milliseconds

Since
5.1
See Also
checkSessions()
startback to summary
public final void start()

Implements org.springframework.context.Lifecycle.start.

Doc from org.springframework.context.Lifecycle.start.

Start this component.

Should not throw an exception if the component is already running.

In the case of a container, this will propagate the start signal to all components that apply.

Annotations
@Override
stopback to summary
public final void stop()

Implements org.springframework.context.Lifecycle.stop.

Doc from org.springframework.context.Lifecycle.stop.

Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. Consider implementing SmartLifecycle and its stop(Runnable) variant when asynchronous stop behavior is necessary.

Note that this stop notification is not guaranteed to come before destruction: On regular shutdown, Lifecycle beans will first receive a stop notification before the general destruction callbacks are being propagated; however, on hot refresh during a context's lifetime or on aborted refresh attempts, a given bean's destroy method will be called without any consideration of stop signals upfront.

Should not throw an exception if the component is not running (not started yet).

In the case of a container, this will propagate the stop signal to all components that apply.

Annotations
@Override
stopback to summary
public final void stop(Runnable callback)

Overrides default org.springframework.context.SmartLifecycle.stop.

Doc from org.springframework.context.SmartLifecycle.stop.

Indicates that a Lifecycle component must stop if it is currently running.

The provided callback is used by the LifecycleProcessor to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after the SmartLifecycle component does indeed stop.

The LifecycleProcessor will call only this variant of the stop method; i.e. Lifecycle#stop() will not be called for SmartLifecycle implementations unless explicitly delegated to within the implementation of this method.

The default implementation delegates to stop() and immediately triggers the given callback in the calling thread. Note that there is no synchronization between the two, so custom implementations may at least want to put the same steps within their common lifecycle monitor (if any).

Annotations
@Override
supportsPartialMessagesback to summary
public boolean supportsPartialMessages()

Implements org.springframework.web.socket.WebSocketHandler.supportsPartialMessages.

Doc from org.springframework.web.socket.WebSocketHandler.supportsPartialMessages.

Whether the WebSocketHandler handles partial messages. If this flag is set to true and the underlying WebSocket server supports partial messages, then a large WebSocket message, or one of an unknown size may be split and maybe received over multiple calls to handleMessage(WebSocketSession, WebSocketMessage). The flag org.springframework.web.socket.WebSocketMessage#isLast() indicates if the message is partial and whether it is the last part.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.springframework.web.socket.messaging back to summary

private Class SubProtocolWebSocketHandler.DefaultStats

extends Object
implements Stats
Class Inheritance
  • java.lang.Object
  • org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.DefaultStats
All Implemented Interfaces
org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private final AtomicInteger
private final AtomicInteger
private final AtomicInteger
private final AtomicInteger
private final AtomicInteger
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv AtomicInteger
public int
public int
public int
public int
public int
public int
public int
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

httpPollingback to summary
private final AtomicInteger httpPolling
httpStreamingback to summary
private final AtomicInteger httpStreaming
limitExceededback to summary
private final AtomicInteger limitExceeded
noMessagesReceivedback to summary
private final AtomicInteger noMessagesReceived
totalback to summary
private final AtomicInteger total
transportErrorback to summary
private final AtomicInteger transportError
webSocketback to summary
private final AtomicInteger webSocket

Constructor Detail

DefaultStatsback to summary
private DefaultStats()

Method Detail

decrementSessionCountback to summary
pack-priv void decrementSessionCount(WebSocketSession session)
getCountForback to summary
pack-priv AtomicInteger getCountFor(WebSocketSession session)
getHttpPollingSessionsback to summary
public int getHttpPollingSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getHttpPollingSessions.

Annotations
@Override
getHttpStreamingSessionsback to summary
public int getHttpStreamingSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getHttpStreamingSessions.

Annotations
@Override
getLimitExceededSessionsback to summary
public int getLimitExceededSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getLimitExceededSessions.

Annotations
@Override
getNoMessagesReceivedSessionsback to summary
public int getNoMessagesReceivedSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getNoMessagesReceivedSessions.

Annotations
@Override
getTotalSessionsback to summary
public int getTotalSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getTotalSessions.

Annotations
@Override
getTransportErrorSessionsback to summary
public int getTransportErrorSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getTransportErrorSessions.

Annotations
@Override
getWebSocketSessionsback to summary
public int getWebSocketSessions()

Implements org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.Stats.getWebSocketSessions.

Annotations
@Override
incrementLimitExceededCountback to summary
pack-priv void incrementLimitExceededCount()
incrementNoMessagesReceivedCountback to summary
pack-priv void incrementNoMessagesReceivedCount()
incrementSessionCountback to summary
pack-priv void incrementSessionCount(WebSocketSession session)
incrementTransportErrorback to summary
pack-priv void incrementTransportError()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.springframework.web.socket.messaging back to summary

public Interface SubProtocolWebSocketHandler.Stats

Known Direct Implementers
org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.DefaultStats

Contract for access to session counters.
Since
5.2

Method Summary

Modifier and TypeMethod and Description
public int
public int
public int
public int
public int
public int
public int

Method Detail

getHttpPollingSessionsback to summary
public int getHttpPollingSessions()
getHttpStreamingSessionsback to summary
public int getHttpStreamingSessions()
getLimitExceededSessionsback to summary
public int getLimitExceededSessions()
getNoMessagesReceivedSessionsback to summary
public int getNoMessagesReceivedSessions()
getTotalSessionsback to summary
public int getTotalSessions()
getTransportErrorSessionsback to summary
public int getTransportErrorSessions()
getWebSocketSessionsback to summary
public int getWebSocketSessions()
org.springframework.web.socket.messaging back to summary

private Class SubProtocolWebSocketHandler.WebSocketSessionHolder

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.WebSocketSessionHolder

Field Summary

Modifier and TypeField and Description
private final long
private volatile boolean
private final WebSocketSession

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long
public WebSocketSession
public boolean
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

createTimeback to summary
private final long createTime
hasHandledMessagesback to summary
private volatile boolean hasHandledMessages
sessionback to summary
private final WebSocketSession session

Constructor Detail

WebSocketSessionHolderback to summary
public WebSocketSessionHolder(WebSocketSession session)

Method Detail

getCreateTimeback to summary
public long getCreateTime()
getSessionback to summary
public WebSocketSession getSession()
hasHandledMessagesback to summary
public boolean hasHandledMessages()
setHasHandledMessagesback to summary
public void setHasHandledMessages()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override