public abstract class AbstractEventDriver extends AbstractLifeCycle implements IncomingFrames, EventDriver
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onBinaryFrame, onBinaryMessage, onClose, onConnect, onError, onFrame, onInputStream, onReader, onTextFrame, onTextMessage
protected 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.IOException
protected void dispatch(java.lang.Runnable runnable)
public WebSocketPolicy getPolicy()
getPolicy
in interface EventDriver
public WebSocketSession getSession()
getSession
in interface EventDriver
public void incomingFrame(Frame frame)
IncomingFrames
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.
incomingFrame
in interface IncomingFrames
frame
- the frame to processpublic void onContinuationFrame(java.nio.ByteBuffer buffer, boolean fin) throws java.io.IOException
onContinuationFrame
in interface EventDriver
java.io.IOException
public void onPong(java.nio.ByteBuffer buffer)
onPong
in interface EventDriver
public void onPing(java.nio.ByteBuffer buffer)
onPing
in interface EventDriver
public BatchMode getBatchMode()
getBatchMode
in interface EventDriver
public void openSession(WebSocketSession session)
openSession
in interface EventDriver
Copyright © 1995–2023 Webtide. All rights reserved.