public abstract class AbstractEventDriver extends AbstractLifeCycle implements IncomingFrames, EventDriver
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected MessageAppender |
activeMessage |
protected WebSocketPolicy |
policy |
protected WebSocketSession |
session |
protected Logger |
TARGET_LOG |
protected java.lang.Object |
websocket |
| Constructor and Description |
|---|
AbstractEventDriver(WebSocketPolicy policy,
java.lang.Object websocket) |
| Modifier and Type | Method and 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) |
addLifeCycleListener, doStart, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonBinaryFrame, onBinaryMessage, onClose, onConnect, onError, onFrame, onInputStream, onReader, onTextFrame, onTextMessageprotected final Logger TARGET_LOG
protected WebSocketPolicy policy
protected final java.lang.Object websocket
protected WebSocketSession session
protected MessageAppender activeMessage
public AbstractEventDriver(WebSocketPolicy policy, java.lang.Object websocket)
protected void appendMessage(java.nio.ByteBuffer buffer,
boolean fin)
throws java.io.IOException
java.io.IOExceptionprotected void dispatch(java.lang.Runnable runnable)
public WebSocketPolicy getPolicy()
getPolicy in interface EventDriverpublic WebSocketSession getSession()
getSession in interface EventDriverpublic void incomingFrame(Frame frame)
IncomingFramesNote: 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.
incomingFrame in interface IncomingFramesframe - the frame to processpublic void onContinuationFrame(java.nio.ByteBuffer buffer,
boolean fin)
throws java.io.IOException
onContinuationFrame in interface EventDriverjava.io.IOExceptionpublic void onPong(java.nio.ByteBuffer buffer)
onPong in interface EventDriverpublic void onPing(java.nio.ByteBuffer buffer)
onPing in interface EventDriverpublic BatchMode getBatchMode()
getBatchMode in interface EventDriverpublic void openSession(WebSocketSession session)
openSession in interface EventDriverCopyright © 1995–2023 Webtide. All rights reserved.