org.apache.ode.bpel.engine
Class NStateLatch
java.lang.Object
org.apache.ode.bpel.engine.NStateLatch
public class NStateLatch
- extends java.lang.Object
An N state synchronization latch useful for implementing hydration/dehydration. The
latch functions as follows. At any time, the latch is in one of N states and has a
count. Clients can "latch" and "release" the latch, which increments/decrements the
count; however, when latching, a state must be specified. If the state does not match
the current state, the latch blocks until the count is zero. Essentially, the latch
can change state only when the count is zero. Every time the latch changes state an
optional Runnable
corresponding to the new state is executed.
Field Summary |
protected java.lang.Runnable[] |
_transitions
Action for state transition ?-->i |
Constructor Summary |
NStateLatch(java.lang.Runnable[] transitions)
Constructor, the array of Runnable s defines the number of states and the transition
actions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_transitions
protected java.lang.Runnable[] _transitions
- Action for state transition ?-->i
NStateLatch
public NStateLatch(java.lang.Runnable[] transitions)
- Constructor, the array of
Runnable
s defines the number of states and the transition
actions.
- Parameters:
transitions
- action to perform when entering state x.
latch
public void latch(int state)
release
public void release(int state)
getDepth
public int getDepth(int state)