org.jboss.messaging.util
Class VariableLatch

java.lang.Object
  extended by org.jboss.messaging.util.VariableLatch

public class VariableLatch
extends java.lang.Object

This class will use the framework provided to by AbstractQueuedSynchronizer. AbstractQueuedSynchronizer is the framework for any sort of concurrent synchronization, such as Semaphores, events, etc, based on AtomicIntegers. The idea is, instead of providing each user specific Latch/Synchronization, java.util.concurrent provides the framework for reuses, based on an AtomicInteger (getState()) On JBossMessaging we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown

Author:
Clebert Suconic

Constructor Summary
VariableLatch()
           
 
Method Summary
 void down()
           
 int getCount()
           
 void up()
           
 void waitCompletion()
           
 void waitCompletion(long milliseconds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableLatch

public VariableLatch()
Method Detail

getCount

public int getCount()

up

public void up()

down

public void down()

waitCompletion

public void waitCompletion()
                    throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

waitCompletion

public void waitCompletion(long milliseconds)
                    throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


Copyright © 2006 JBoss Inc. All Rights Reserved.