Class MessageRelay

All Implemented Interfaces:

public class MessageRelay
extends java.lang.Object
implements MessageListener

A message listener that relays all received messages to a target thread's message writer. If the writer is null when a message is received the message is ignored.

$Revision: 1.7 $
Jon Barrilleaux ( of JMB and Associates Inc.

Constructor Summary
MessageRelay(MessageThread target)
Method Summary
 void processMessage(Message message, MessageWriter writer)
          Called when the listener needs to process a new message.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MessageRelay(MessageThread target)
target - Thread with the target message writer. Never null.
Method Detail


public void processMessage(Message message,
                           MessageWriter writer)
Description copied from interface: MessageListener
Called when the listener needs to process a new message. Presumably the message type (subclass) is one that the listener is interested in (see MessageRouter).

Specified by:
processMessage in interface MessageListener
message - The message to be handled. Never null.
writer - Message writer to be used for sending a reply message (on the router thread). Null if none.