|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
S - the type of states associated with this context.public interface NioContext<S extends Enum<S>>
Context associated with an open communication channel.
| Method Summary | |
|---|---|
ChannelWrapper<?> |
getChannel()
Get the associated channel. |
S |
getState()
Get the current state of the channel this context is associated with. |
String |
getUuid()
Get the uuid for this node context. |
void |
handleException(ChannelWrapper<?> channel)
Handle the cleanup when an exception occurs on the channel. |
boolean |
readMessage(ChannelWrapper<?> wrapper)
Read data from a channel. |
void |
setChannel(ChannelWrapper<?> channel)
Set the associated channel. |
void |
setState(S state)
Set the current state of the channel this context is associated with. |
void |
setUuid(String uuid)
Set the uuid for this node context. |
boolean |
writeMessage(ChannelWrapper<?> wrapper)
Write data to a channel. |
| Method Detail |
|---|
S getState()
void setState(S state)
state - a state enum value.
boolean readMessage(ChannelWrapper<?> wrapper)
throws Exception
wrapper - the channel to read the data from.
Exception - if an error occurs while reading the data.
boolean writeMessage(ChannelWrapper<?> wrapper)
throws Exception
wrapper - the channel to write the data to.
Exception - if an error occurs while writing the data.String getUuid()
void setUuid(String uuid)
uuid - the uuid as a string.void handleException(ChannelWrapper<?> channel)
channel - the channel that threw the exception.ChannelWrapper<?> getChannel()
ChannelWrapper instance.void setChannel(ChannelWrapper<?> channel)
channel - a ChannelWrapper instance.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||