ist.palcom.mal
Class CommunicationThread

java.lang.Object
  extended by ist.palcom.palcomthreads.PalcomThread
      extended by ist.palcom.palcomthreads.PalcomPriorityThread
          extended by ist.palcom.mal.CommunicationThread
Direct Known Subclasses:
BluetoothCollector, BluetoothCommunicationThread, IRReceiverThread, IRSenderThread, PoolCommunicationThread, RascalCommunicationThread, UDPCommunicationThread

public abstract class CommunicationThread
extends PalcomPriorityThread

A CommunicationThread is responsible for sending and receiving messages over one medium or protocol (such as UDP or IR). Subclasses implement protocol/medium specifics. In the case of UDP, one CommunicationThread sends and receives on one socket. In general, one CommunicationThread is needed for each independent sequence of incoming messages.

With the exception of the getURL method, the interface of this class is given by the set of events handled. A CommunicationThread supports the following incoming events:

The only outgoing event is a MessageWithURLEvent, which is sent to the DistributorThread of a MediaManager when a message has been received. The URL in the event is the URL on which the message has been received.

See Also:
MediaManager

Constructor Summary
CommunicationThread()
           
 
Method Summary
abstract  URL getURL()
           
 
Methods inherited from class ist.palcom.palcomthreads.PalcomPriorityThread
getPriority, setPriority
 
Methods inherited from class ist.palcom.palcomthreads.PalcomThread
askEvent, disableIOEvents, disablePeriodicEvents, enableIOEvent, enablePeriodicEvents, getScheduler, putEvent, run, terminate, waitEvent, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommunicationThread

public CommunicationThread()
Method Detail

getURL

public abstract URL getURL()
Returns:
The URL for sending messages to this thread, a URL this thread listens at (protocol-specific URL).