ist.palcom.device
Class EventChannel

java.lang.Object
  extended by ist.palcom.base.Object
      extended by ist.palcom.base.Channel
          extended by ist.palcom.device.EventChannel

public class EventChannel
extends Channel

EventChannel is a Channel that can be used from Java threads for sending PalcomEvents to PalcomThreads in a safe way (doing operations such as putEvent directly on a PalcomThread from a Java thread is not safe, because the PalComScheduler is not aware of the Java threads).

A EventChannelThread has to be scheduled for the EventChannel for the event passing to work. Java threads may call the thread safe method safePutEvent on the channel, and events will be delivered to PalcomThreads, given that an EventChannelThread runs.

When finished using the EventChannel, the method close must be called. Otherwise, running EventChannelThreads will not stop.


Constructor Summary
EventChannel()
           
 
Method Summary
 void close()
          Close the channel.
 boolean dataAvailable()
          This method should only be called by the System class.
 void safePutEvent(Event event, PalcomThread target)
          Put an event in the mailbox of a PalcomThread in a way that does not interfere with the PalcomScheduler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventChannel

public EventChannel()
Method Detail

safePutEvent

public void safePutEvent(Event event,
                         PalcomThread target)
Put an event in the mailbox of a PalcomThread in a way that does not interfere with the PalcomScheduler.


close

public void close()
Close the channel. The EventChannelThread that handles the channel will stop.


dataAvailable

public boolean dataAvailable()
This method should only be called by the System class.

See Also:
ist.palcom.base.Channel#dataAvailable()