Class prominence.msg.GenericMessageCopier
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prominence.msg.GenericMessageCopier

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----prominence.msg.MessageCopier
                   |
                   +----prominence.msg.GenericMessageCopier

public class GenericMessageCopier
extends MessageCopier
An extension of the MessageCopier class that relays messages from a MessageInput to a MessageOutput.

If an exception is encountered while relaying messages, this class calls the stop() method of a sibling thread, allowing the communications layer to shut down gracefully.


Variable Index

 o sibling
The sibling thread to be stopped should an error be encountered.

Constructor Index

 o GenericMessageCopier(Thread, MessageInput, MessageOutput)
Creates a new GenericMessageCopier.

Method Index

 o run()
Relays messages from i to o, stopping sibling if an exception is encountered.

Variables

 o sibling
  protected Thread sibling
The sibling thread to be stopped should an error be encountered.

Constructors

 o GenericMessageCopier
  public GenericMessageCopier(Thread sibling,
                              MessageInput i,
                              MessageOutput o)
Creates a new GenericMessageCopier.
Parameters:
sibling - The sibling thread to stop in case of an exception
i - The MessageInput from which messages should be relayed
o - The MessageOutput to which messages should be relayed

Methods

 o run
  public void run()
Relays messages from i to o, stopping sibling if an exception is encountered.

This method is called when the superclass start() method is called.

Overrides:
run in class MessageCopier
See Also:
start

All Packages  Class Hierarchy  This Package  Previous  Next  Index