net.esper.core
Class InsertIntoLatchSpin

java.lang.Object
  extended by net.esper.core.InsertIntoLatchSpin

public class InsertIntoLatchSpin
extends Object

A spin-locking implementation of a latch for use in guaranteeing delivery between a single event produced by a single statement and consumable by another statement.


Constructor Summary
InsertIntoLatchSpin()
          Ctor - use for the first and unused latch to indicate completion.
InsertIntoLatchSpin(InsertIntoLatchSpin earlier, long msecTimeout, Object payload)
          Ctor.
 
Method Summary
 Object await()
          Blocking call that returns only when the earlier latch completed.
 void done()
          Called to indicate that the latch completed and a later latch can start.
 boolean isCompleted()
          Returns true if the dispatch completed for this future.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertIntoLatchSpin

public InsertIntoLatchSpin(InsertIntoLatchSpin earlier,
                           long msecTimeout,
                           Object payload)
Ctor.

Parameters:
earlier - the latch before this latch that this latch should be waiting for
msecTimeout - the timeout after which delivery occurs
payload - the payload is an event to deliver

InsertIntoLatchSpin

public InsertIntoLatchSpin()
Ctor - use for the first and unused latch to indicate completion.

Method Detail

isCompleted

public boolean isCompleted()
Returns true if the dispatch completed for this future.

Returns:
true for completed, false if not

await

public Object await()
Blocking call that returns only when the earlier latch completed.

Returns:
payload of the latch

done

public void done()
Called to indicate that the latch completed and a later latch can start.


© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com