C
- the Connection
type.public interface ConnectionHandler<C extends Connection>
Connection
callbacks.Modifier and Type | Interface and Description |
---|---|
static class |
ConnectionHandler.ClosingType
An enumeration of the ways in which a connection may be closed.
|
Modifier and Type | Method and Description |
---|---|
C |
getConnection()
Gets the
Connection associated with this handler. |
void |
onBind()
On binding.
|
void |
onClose()
On completion of closure.
|
void |
onClosing(ConnectionHandler.ClosingType type,
ByteBuffer bb)
On closure.
|
void |
onReceive(ByteBuffer bb)
On receipt of data.
|
void |
setConnection(C conn)
Sets the
Connection associated with this handler. |
String |
toString()
Creates a human-readable representation of this handler.
|
void onBind()
void onReceive(ByteBuffer bb)
bb
- the ByteBuffer
containing data.void onClosing(ConnectionHandler.ClosingType type, ByteBuffer bb)
type
- the ConnectionHandler.ClosingType
.bb
- the ByteBuffer
containing data. It must be completely drained, as this is the final callback.ConnectionHandler.ClosingType
void onClose()
C getConnection()
Connection
associated with this handler.void setConnection(C conn)
Connection
associated with this handler.conn
- the Connection
.