Class AbstractEventDriver
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.websocket.common.events.AbstractEventDriver
-
- All Implemented Interfaces:
LifeCycle,IncomingFrames,EventDriver
- Direct Known Subclasses:
AbstractJsrEventDriver,JettyAnnotatedEventDriver,JettyListenerEventDriver
public abstract class AbstractEventDriver extends AbstractLifeCycle implements IncomingFrames, EventDriver
EventDriver is the main interface between the User's WebSocket POJO and the internal jetty implementation of WebSocket.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected MessageAppenderactiveMessageprotected WebSocketPolicypolicyprotected WebSocketSessionsessionprotected LoggertargetLogprotected java.lang.Objectwebsocket
-
Constructor Summary
Constructors Constructor Description AbstractEventDriver(WebSocketPolicy policy, java.lang.Object websocket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendMessage(java.nio.ByteBuffer buffer, boolean fin)protected voiddispatch(java.lang.Runnable runnable)BatchModegetBatchMode()WebSocketPolicygetPolicy()WebSocketSessiongetSession()voidincomingFrame(Frame frame)Process the incoming frame.voidonContinuationFrame(java.nio.ByteBuffer buffer, boolean fin)voidonPing(java.nio.ByteBuffer buffer)voidonPong(java.nio.ByteBuffer buffer)voidopenSession(WebSocketSession session)-
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
-
targetLog
protected final Logger targetLog
-
policy
protected WebSocketPolicy policy
-
websocket
protected final java.lang.Object websocket
-
session
protected WebSocketSession session
-
activeMessage
protected MessageAppender activeMessage
-
-
Constructor Detail
-
AbstractEventDriver
public AbstractEventDriver(WebSocketPolicy policy, java.lang.Object websocket)
-
-
Method Detail
-
appendMessage
protected void appendMessage(java.nio.ByteBuffer buffer, boolean fin) throws java.io.IOException- Throws:
java.io.IOException
-
dispatch
protected void dispatch(java.lang.Runnable runnable)
-
getPolicy
public WebSocketPolicy getPolicy()
- Specified by:
getPolicyin interfaceEventDriver
-
getSession
public WebSocketSession getSession()
- Specified by:
getSessionin interfaceEventDriver
-
incomingFrame
public void incomingFrame(Frame frame)
Description copied from interface:IncomingFramesProcess the incoming frame.Note: if you need to hang onto any information from the frame, be sure to copy it, as the information contained in the Frame will be released and/or reused by the implementation.
- Specified by:
incomingFramein interfaceIncomingFrames- Parameters:
frame- the frame to process
-
onContinuationFrame
public void onContinuationFrame(java.nio.ByteBuffer buffer, boolean fin) throws java.io.IOException- Specified by:
onContinuationFramein interfaceEventDriver- Throws:
java.io.IOException
-
onPong
public void onPong(java.nio.ByteBuffer buffer)
- Specified by:
onPongin interfaceEventDriver
-
onPing
public void onPing(java.nio.ByteBuffer buffer)
- Specified by:
onPingin interfaceEventDriver
-
getBatchMode
public BatchMode getBatchMode()
- Specified by:
getBatchModein interfaceEventDriver
-
openSession
public void openSession(WebSocketSession session)
- Specified by:
openSessionin interfaceEventDriver
-
-