T - the type of the message that will be validated and handled.public abstract class MessageHandler<T extends java.io.Serializable> extends java.lang.Object implements IMessageHandler
| Constructor and Description |
|---|
MessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(byte[] data,
java.net.InetAddress address,
int port)
Handle.
|
protected abstract void |
handle(T message,
java.net.InetAddress address,
int port) |
protected boolean |
validate(T message)
This method can be overwritten by concrete implementations to provide a
validation mechanism for the messages sent.
|
public void handle(byte[] data,
java.net.InetAddress address,
int port)
IMessageHandlerhandle in interface IMessageHandlerdata - the dataaddress - the addressport - the portprotected abstract void handle(T message, java.net.InetAddress address, int port)
protected boolean validate(T message)
message - The message object that is validated.