org.elkoserver.foundation.net
Class NullMessageHandler

java.lang.Object
  extended by org.elkoserver.foundation.net.NullMessageHandler
All Implemented Interfaces:
MessageHandler

public class NullMessageHandler
extends Object
implements MessageHandler

"Message handler" for connections that are send only. No messages will ever be received over such a connection, hence no message handler will actually be needed, but one must be provided to make the comm system happy, hence this placeholder class. Note that if a message actually *is* received, it is an error, so this class provides an option for logging it.


Constructor Summary
NullMessageHandler(Trace trace)
           
 
Method Summary
 void connectionDied(Connection connection, Throwable reason)
          Cope with connection death.
 void processMessage(Connection connection, Object message)
          Process an incoming message from a connection by complaining to the log if we have configured to talk to the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullMessageHandler

public NullMessageHandler(Trace trace)
Method Detail

connectionDied

public void connectionDied(Connection connection,
                           Throwable reason)
Cope with connection death. The connection might have been shut down deliberately, the underlying TCP connection might have failed, or an internal error may have killed the connection. In any event, the connection is dead. Deal with it.

Specified by:
connectionDied in interface MessageHandler
Parameters:
connection - The connection that has just died.
reason - A possible indication why the connection went away.

processMessage

public void processMessage(Connection connection,
                           Object message)
Process an incoming message from a connection by complaining to the log if we have configured to talk to the log.

Specified by:
processMessage in interface MessageHandler
Parameters:
connection - The connection upon which the message arrived.
message - The incoming message.