Top Description Inners Fields Constructors Methods
org.eclipse.jetty.websocket.core.internal

public Class WebSocketSessionState

extends Object
Class Inheritance
Imports
java.nio.channels.ClosedChannelException, org.eclipse.jetty.util.thread.AutoLock, org.eclipse.jetty.websocket.core.CloseStatus, .Frame, .OpCode, org.eclipse.jetty.websocket.core.exception.ProtocolException

Atomic Connection State

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv CloseStatus
private byte
private byte
private WebSocketSessionState.State
private final AutoLock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static byte
checkDataSequence(byte opcode, boolean fin, byte lastOpCode)

public CloseStatus
private WebSocketSessionState.State
public boolean
public boolean
public boolean
public boolean
onClosed(CloseStatus closeStatus)

public void
public boolean
public void
onError(Throwable
the error which occurred.
t
)

If no error is set in the CloseStatus this will either, replace the current close status with a CloseStatus#SERVER_ERROR status if we had a NORMAL close code, or, it will set the cause of the CloseStatus if the previous cause was null, this allows onError to be notified after the connection is closed.

public boolean
public void
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_closeStatusback to summary
pack-priv CloseStatus _closeStatus
_incomingContinuationback to summary
private byte _incomingContinuation
_outgoingContinuationback to summary
private byte _outgoingContinuation
_sessionStateback to summary
private WebSocketSessionState.State _sessionState
lockback to summary
private final AutoLock lock

Constructor Detail

WebSocketSessionStateback to summary
public WebSocketSessionState()

Method Detail

checkDataSequenceback to summary
private static byte checkDataSequence(byte opcode, boolean fin, byte lastOpCode) throws ProtocolException
getCloseStatusback to summary
public CloseStatus getCloseStatus()
getStateback to summary
private WebSocketSessionState.State getState()
isClosedback to summary
public boolean isClosed()
isInputOpenback to summary
public boolean isInputOpen()
isOutputOpenback to summary
public boolean isOutputOpen()
onClosedback to summary
public boolean onClosed(CloseStatus closeStatus)
onConnectedback to summary
public void onConnected()
onEofback to summary
public boolean onEof()
onErrorback to summary
public void onError(Throwable t)

If no error is set in the CloseStatus this will either, replace the current close status with a CloseStatus#SERVER_ERROR status if we had a NORMAL close code, or, it will set the cause of the CloseStatus if the previous cause was null, this allows onError to be notified after the connection is closed.

This should only be called if there is an error directly before the call to WebSocketCoreSession.closeConnection(CloseStatus, Callback).

This could occur if the FrameHandler throws an exception in onFrame after receiving a close frame reply, in this case to notify onError we must set the cause in the closeStatus.

Parameters
t:Throwable

the error which occurred.

onIncomingFrameback to summary
public boolean onIncomingFrame(Frame frame) throws ProtocolException, ClosedChannelException
onOpenback to summary
public void onOpen()
onOutgoingFrameback to summary
public boolean onOutgoingFrame(Frame frame) throws Exception
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.eclipse.jetty.websocket.core.internal back to summary

pack-priv final Enum WebSocketSessionState.State

extends Enum<WebSocketSessionState.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final WebSocketSessionState.State
public static final WebSocketSessionState.State
public static final WebSocketSessionState.State
public static final WebSocketSessionState.State
public static final WebSocketSessionState.State
public static final WebSocketSessionState.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static WebSocketSessionState.State
public static WebSocketSessionState.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLOSEDback to summary
public static final WebSocketSessionState.State CLOSED
CONNECTEDback to summary
public static final WebSocketSessionState.State CONNECTED
CONNECTINGback to summary
public static final WebSocketSessionState.State CONNECTING
ISHUTback to summary
public static final WebSocketSessionState.State ISHUT
OPENback to summary
public static final WebSocketSessionState.State OPEN
OSHUTback to summary
public static final WebSocketSessionState.State OSHUT

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static WebSocketSessionState.State valueOf(String name)
valuesback to summary
public static WebSocketSessionState.State[] values()