net.vattp.data
Interface MsgHandler

All Known Implementing Classes:
CapTPConnection, DataPath, StartUpProtocol, Suspend

public interface MsgHandler

Untamed:


Method Summary
 void connectionDead(VatTPConnection connection, Throwable reason)
          Enabled: Receive notification that the connection is dead.
 void processMessage(byte[] message, VatTPConnection connection)
          Enabled: Process an incoming message from the VatTPConnection.
 

Method Detail

connectionDead

public void connectionDead(VatTPConnection connection,
                           Throwable reason)
Enabled: Receive notification that the connection is dead. Either the connection has been shut down with VatTPConnection.shutDownConnection, the underlying TCP connection has failed, a bad MAC has been received on the connection, or an internal error has caused the connection to fail.

If an object is registered to handle more than one message type, it will receive one connectionDead notification for each message type for which it is registered.

Parameters:
connection - The VatTPConnection object which has just died.
reason - is a Throwable which describes why the connection died.

processMessage

public void processMessage(byte[] message,
                           VatTPConnection connection)
Enabled: Process an incoming message from the VatTPConnection.

Parameters:
message - is the incoming message. The first byte (message[0]) is the message type (see class Msg). A handler which is registered for more than one message can use the initial byte to determine what is the message type of the current message.
connection - is the VatTPConnection object on which the the message arrived.
See Also:
Msg, VatTPConnection


comments?