public class MessageContext
extends java.lang.Object
MendelMessage
.Constructor and Description |
---|
MessageContext(MessageRouter router,
java.nio.channels.SelectionKey key) |
Modifier and Type | Method and Description |
---|---|
MessageRouter |
getMessageRouter() |
NetworkDestination |
getNetworkDestination()
Retrieves the originating endpoint that sent the message associated with
this context.
|
java.nio.channels.SelectionKey |
getSelectionKey() |
int |
getServerPort() |
java.nio.channels.SocketChannel |
getSocketChannel() |
NetworkDestination |
getSource() |
void |
sendMessage(MendelMessage message)
Sends a message back to the originator of the message this context
belongs to.
|
public MessageContext(MessageRouter router, java.nio.channels.SelectionKey key)
public NetworkDestination getNetworkDestination()
public MessageRouter getMessageRouter()
public java.nio.channels.SelectionKey getSelectionKey()
public java.nio.channels.SocketChannel getSocketChannel()
public int getServerPort()
public NetworkDestination getSource()
public void sendMessage(MendelMessage message) throws java.io.IOException
java.io.IOException