oemware.core
Class FixedBlockingQueue

java.lang.Object
  extended by oemware.core.FixedBlockingQueue

public final class FixedBlockingQueue
extends java.lang.Object

The blocking fixed size queue (i.e., has a max size).


Constructor Summary
FixedBlockingQueue(int pCapacity)
          Construct a new queue.
 
Method Summary
 void put(java.lang.Object pObj)
          Add an element.
 int remainingCapacity()
          Returns the remaining capacity.
 void shutdown()
          Stop the queue.
 void startup()
           
 java.lang.Object take()
          Take the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedBlockingQueue

public FixedBlockingQueue(int pCapacity)
Construct a new queue.

Parameters:
pCapacity - The max capacity.
Method Detail

take

public final java.lang.Object take()
                            throws java.lang.InterruptedException
Take the object. Blocks if no object.

Returns:
The new object.
Throws:
java.lang.InterruptedException

put

public final void put(java.lang.Object pObj)
               throws java.lang.InterruptedException
Add an element.

Throws:
java.lang.InterruptedException

remainingCapacity

public final int remainingCapacity()
Returns the remaining capacity.

Returns:
The remaining capacity.

shutdown

public final void shutdown()
Stop the queue.


startup

public final void startup()


Copyright © 2009 Deft Labs - Released under LGPL, Version 3.0