context.arch.comm.language
Interface MessageHandler
- All Known Implementing Classes:
- BaseObject
- public interface MessageHandler
This interface specifies all the methods for encoding outgoing messages
and decoding incoming messages, as well as the method that handles
decoded incoming messages.
decodeData
public DataObject decodeData(java.io.Reader message)
throws DecodeException,
InvalidDecoderException
- Method to decode the incoming data
- Parameters:
message
- Message to be decoded- Returns:
- the decoded message in a DataObject
- Throws:
- DecodeException - thrown when the given
data can not be decoded successfully
- InvalidDecoderException - thrown when the
decoder can not be run successfully
encodeData
public java.lang.String encodeData(DataObject data)
throws EncodeException,
InvalidEncoderException
- Method to encode the incoming data
- Parameters:
data
- Data to be encoded- Returns:
- the encoded message
- Throws:
- EncodeException - thrown when the given
data can not be encoded successfully
- InvalidEncoderException - thrown when the
encoder can not be run successfully
runMethod
public DataObject runMethod(java.lang.String methodType,
DataObject data)
throws InvalidMethodException,
MethodException
- This method handles both the system-defined, callbacks and user-defined RPCs.
- Parameters:
methodType
- Name of method to rundata
- DataObject containing data for the method call- Throws:
- InvalidMethodException - thrown if specified RPC couldn't be found
- MethodException - thrown if specified RPC had an error