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 MessageAppender
activeMessage
protected WebSocketPolicy
policy
protected WebSocketSession
session
protected Logger
targetLog
protected java.lang.Object
websocket
-
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 void
appendMessage(java.nio.ByteBuffer buffer, boolean fin)
protected void
dispatch(java.lang.Runnable runnable)
BatchMode
getBatchMode()
WebSocketPolicy
getPolicy()
WebSocketSession
getSession()
void
incomingFrame(Frame frame)
Process the incoming frame.void
onContinuationFrame(java.nio.ByteBuffer buffer, boolean fin)
void
onPing(java.nio.ByteBuffer buffer)
void
onPong(java.nio.ByteBuffer buffer)
void
openSession(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:
getPolicy
in interfaceEventDriver
-
getSession
public WebSocketSession getSession()
- Specified by:
getSession
in interfaceEventDriver
-
incomingFrame
public void incomingFrame(Frame frame)
Description copied from interface:IncomingFrames
Process 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:
incomingFrame
in interfaceIncomingFrames
- Parameters:
frame
- the frame to process
-
onContinuationFrame
public void onContinuationFrame(java.nio.ByteBuffer buffer, boolean fin) throws java.io.IOException
- Specified by:
onContinuationFrame
in interfaceEventDriver
- Throws:
java.io.IOException
-
onPong
public void onPong(java.nio.ByteBuffer buffer)
- Specified by:
onPong
in interfaceEventDriver
-
onPing
public void onPing(java.nio.ByteBuffer buffer)
- Specified by:
onPing
in interfaceEventDriver
-
getBatchMode
public BatchMode getBatchMode()
- Specified by:
getBatchMode
in interfaceEventDriver
-
openSession
public void openSession(WebSocketSession session)
- Specified by:
openSession
in interfaceEventDriver
-
-