org.apache.activemq.thread
Class Valve

java.lang.Object
  extended by org.apache.activemq.thread.Valve

public final class Valve
extends java.lang.Object

A Valve is a synchronization object used enable or disable the "flow" of concurrent processing.

Version:
$Revision: 1.2 $

Constructor Summary
Valve(boolean on)
           
 
Method Summary
 void decrement()
          Decrements the use counter of the valve.
 void increment()
          Increments the use counter of the valve.
 void turnOff()
          Turns the valve off.
 void turnOn()
          Turns the valve on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Valve

public Valve(boolean on)
Method Detail

turnOn

public void turnOn()
            throws java.lang.InterruptedException
Turns the valve on. This method blocks until the valve is off.

Throws:
java.lang.InterruptedException

turnOff

public void turnOff()
             throws java.lang.InterruptedException
Turns the valve off. This method blocks until the valve is on and the valve is not in use.

Throws:
java.lang.InterruptedException

increment

public void increment()
               throws java.lang.InterruptedException
Increments the use counter of the valve. This method blocks if the valve is off, or is being turned off.

Throws:
java.lang.InterruptedException

decrement

public void decrement()
Decrements the use counter of the valve.



Copyright © 2010 Apache Software Foundation. All Rights Reserved.