Class AbstractEventDriver
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.websocket.common.events.AbstractEventDriver
-
- All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle,org.eclipse.jetty.websocket.api.extensions.IncomingFrames,EventDriver
- Direct Known Subclasses:
JettyAnnotatedEventDriver,JettyListenerEventDriver
public abstract class AbstractEventDriver extends org.eclipse.jetty.util.component.AbstractLifeCycle implements org.eclipse.jetty.websocket.api.extensions.IncomingFrames, EventDriver
EventDriver is the main interface between the User's WebSocket POJO and the internal jetty implementation of WebSocket.
-
-
Field Summary
Fields Modifier and Type Field Description protected MessageAppenderactiveMessageprotected org.eclipse.jetty.websocket.api.WebSocketPolicypolicyprotected WebSocketSessionsessionprotected org.eclipse.jetty.util.log.LoggerTARGET_LOGprotected Objectwebsocket
-
Constructor Summary
Constructors Constructor Description AbstractEventDriver(org.eclipse.jetty.websocket.api.WebSocketPolicy policy, Object websocket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendMessage(ByteBuffer buffer, boolean fin)protected voiddispatch(Runnable runnable)org.eclipse.jetty.websocket.api.BatchModegetBatchMode()org.eclipse.jetty.websocket.api.WebSocketPolicygetPolicy()WebSocketSessiongetSession()voidincomingError(Throwable e)voidincomingFrame(org.eclipse.jetty.websocket.api.extensions.Frame frame)voidonContinuationFrame(ByteBuffer buffer, boolean fin)voidonPing(ByteBuffer buffer)voidonPong(ByteBuffer buffer)voidopenSession(WebSocketSession session)protected voidterminateConnection(int statusCode, String rawreason)-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, doStart, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.websocket.common.events.EventDriver
onBinaryFrame, onBinaryMessage, onClose, onConnect, onError, onFrame, onInputStream, onReader, onTextFrame, onTextMessage
-
-
-
-
Field Detail
-
TARGET_LOG
protected final org.eclipse.jetty.util.log.Logger TARGET_LOG
-
policy
protected org.eclipse.jetty.websocket.api.WebSocketPolicy policy
-
websocket
protected final Object websocket
-
session
protected WebSocketSession session
-
activeMessage
protected MessageAppender activeMessage
-
-
Constructor Detail
-
AbstractEventDriver
public AbstractEventDriver(org.eclipse.jetty.websocket.api.WebSocketPolicy policy, Object websocket)
-
-
Method Detail
-
appendMessage
protected void appendMessage(ByteBuffer buffer, boolean fin) throws IOException
- Throws:
IOException
-
dispatch
protected void dispatch(Runnable runnable)
-
getPolicy
public org.eclipse.jetty.websocket.api.WebSocketPolicy getPolicy()
- Specified by:
getPolicyin interfaceEventDriver
-
getSession
public WebSocketSession getSession()
- Specified by:
getSessionin interfaceEventDriver
-
incomingError
public final void incomingError(Throwable e)
- Specified by:
incomingErrorin interfaceorg.eclipse.jetty.websocket.api.extensions.IncomingFrames
-
incomingFrame
public void incomingFrame(org.eclipse.jetty.websocket.api.extensions.Frame frame)
- Specified by:
incomingFramein interfaceorg.eclipse.jetty.websocket.api.extensions.IncomingFrames
-
onContinuationFrame
public void onContinuationFrame(ByteBuffer buffer, boolean fin) throws IOException
- Specified by:
onContinuationFramein interfaceEventDriver- Throws:
IOException
-
onPong
public void onPong(ByteBuffer buffer)
- Specified by:
onPongin interfaceEventDriver
-
onPing
public void onPing(ByteBuffer buffer)
- Specified by:
onPingin interfaceEventDriver
-
getBatchMode
public org.eclipse.jetty.websocket.api.BatchMode getBatchMode()
- Specified by:
getBatchModein interfaceEventDriver
-
openSession
public void openSession(WebSocketSession session)
- Specified by:
openSessionin interfaceEventDriver
-
terminateConnection
protected void terminateConnection(int statusCode, String rawreason)
-
-