se.lth.cs.realtime.event
Class RendezvousEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byse.lth.cs.realtime.event.RTEvent
          extended byse.lth.cs.realtime.event.RendezvousEvent
All Implemented Interfaces:
java.io.Serializable

public class RendezvousEvent
extends RTEvent

Support rendezvous between an event producer and an event consumer.

See Also:
License, Serialized Form

Field Summary
 
Fields inherited from class se.lth.cs.realtime.event.RTEvent
owner, ticker, timestamp
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RendezvousEvent()
          Create empty event, without shared data and without work to be done, which can be useful to only synchronize execution.
 
Method Summary
 void accept(java.lang.Object arg)
          Accept the rendezvous and call call to carry out any work using the shared data as provided in subclasses of this class.
protected  void call(java.lang.Object arg)
          The work to be carried out by the tread accepting the rendezvous.
 void entry(RTEventListener worker)
          Enter the rendezvous where blocking should occur while the accepting thread carries out all transfers involving shared data.
 
Methods inherited from class se.lth.cs.realtime.event.RTEvent
getMillis, getNanos, getOwner, getSeconds, getTicks, getTimebase, paramString, setOwner, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RendezvousEvent

public RendezvousEvent()
Create empty event, without shared data and without work to be done, which can be useful to only synchronize execution.

Method Detail

accept

public final void accept(java.lang.Object arg)
Accept the rendezvous and call call to carry out any work using the shared data as provided in subclasses of this class.

Parameters:
arg - additional local data provided by the accepting thread.

call

protected void call(java.lang.Object arg)
The work to be carried out by the tread accepting the rendezvous. To be defined in subclasses; by default nothing. Data to be provided from the client side can be defined as attributes in the subclasses, e.g. by a reference to a shared-data object. (It it not good a good practise to use the event source for calling methods of the client thread object; store shared data in passive objects).

Parameters:
arg - to be provided by the accepting thread, as an argument to the accept method, thereby giving access data in the context of the accepting thread.

entry

public final void entry(RTEventListener worker)
Enter the rendezvous where blocking should occur while the accepting thread carries out all transfers involving shared data.

Parameters:
worker - the thread that is expected to accept the rendezvous.