public abstract class ConnectionBase extends Object implements Connection
Modifier and Type | Field and Description |
---|---|
protected static Object |
theCloseMarker
Token to put on send queue to signal close of connection.
|
Modifier | Constructor and Description |
---|---|
protected |
ConnectionBase(NetworkManager mgr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
connectionDied(Throwable reason)
Cope with loss of a connection.
|
protected void |
enqueueHandlerFactory(MessageHandlerFactory handlerFactory)
Enqueue a task to invoke a message handler factory to produce a message
handler for this connection.
|
protected void |
enqueueReceivedMessage(Object message)
Enqueue a received message for processing.
|
int |
id()
Identify this connection for logging purposes.
|
void |
setDebugMode(boolean mode)
Turn on or off debug features on this connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, sendMsg
protected static final Object theCloseMarker
protected ConnectionBase(NetworkManager mgr)
mgr
- Network manager for this server.protected void connectionDied(Throwable reason)
reason
- Throwable describing why the connection died.public int id()
id
in interface Connection
protected void enqueueReceivedMessage(Object message)
message
- The received message.protected void enqueueHandlerFactory(MessageHandlerFactory handlerFactory)
handlerFactory
- Provider of a message handler to process messages
received on this connection.public void setDebugMode(boolean mode)
setDebugMode
in interface Connection
mode
- If true, turn debug mode on; if false, turn it off.Copyright © 2017. All rights reserved.