public abstract class AbstractEventDriver extends Object implements IncomingFrames, EventDriver
| Modifier and Type | Field and Description |
|---|---|
protected MessageAppender |
activeMessage |
protected WebSocketPolicy |
policy |
protected WebSocketSession |
session |
protected Logger |
TARGET_LOG |
protected Object |
websocket |
| Constructor and Description |
|---|
AbstractEventDriver(WebSocketPolicy policy,
Object websocket) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendMessage(ByteBuffer buffer,
boolean fin) |
protected void |
dispatch(Runnable runnable) |
WebSocketPolicy |
getPolicy() |
WebSocketSession |
getSession() |
void |
incomingError(Throwable e) |
void |
incomingFrame(Frame frame)
Process the incoming frame.
|
void |
onContinuationFrame(ByteBuffer buffer,
boolean fin) |
void |
onPing(ByteBuffer buffer) |
void |
onPong(ByteBuffer buffer) |
void |
openSession(WebSocketSession session) |
protected void |
terminateConnection(int statusCode,
String rawreason) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonBinaryFrame, onBinaryMessage, onClose, onConnect, onError, onFrame, onInputStream, onReader, onTextFrame, onTextMessageprotected final Logger TARGET_LOG
protected final WebSocketPolicy policy
protected final Object websocket
protected WebSocketSession session
protected MessageAppender activeMessage
public AbstractEventDriver(WebSocketPolicy policy, Object websocket)
protected void appendMessage(ByteBuffer buffer, boolean fin) throws IOException
IOExceptionprotected void dispatch(Runnable runnable)
public WebSocketPolicy getPolicy()
getPolicy in interface EventDriverpublic WebSocketSession getSession()
getSession in interface EventDriverpublic final void incomingError(Throwable e)
incomingError in interface IncomingFramespublic 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(ByteBuffer buffer, boolean fin) throws IOException
onContinuationFrame in interface EventDriverIOExceptionpublic void onPong(ByteBuffer buffer)
onPong in interface EventDriverpublic void onPing(ByteBuffer buffer)
onPing in interface EventDriverpublic void openSession(WebSocketSession session)
openSession in interface EventDriverprotected void terminateConnection(int statusCode,
String rawreason)
Copyright © 1995-2015 Webtide. All Rights Reserved.