Protomatter Software v1.1.7

com.protomatter.util
Class BlockingQueue

java.lang.Object
  |
  +--com.protomatter.pool.SimpleObjectPool
        |
        +--com.protomatter.pool.GrowingObjectPool
              |
              +--com.protomatter.util.BlockingQueue
All Implemented Interfaces:
ObjectPool

public final class BlockingQueue
extends GrowingObjectPool

A thread-blocking queue. The getNextObject() method blocks until there's something added to the queue.


Fields inherited from class com.protomatter.pool.SimpleObjectPool
sync
 
Constructor Summary
BlockingQueue()
          Create a new queue.
 
Method Summary
 void add(java.lang.Object object)
          Add an object to the queue.
 ObjectPoolObject createObjectPoolObject()
          To be implemented by sub-classes.
 java.lang.Object getNextObject()
          Get the next object in the queue.
 int getQueueLength()
          Get the length of the queue (number of work elements yet to be processed).
 
Methods inherited from class com.protomatter.pool.GrowingObjectPool
checkinPoolObject, getCreateWaitTime, getCurrentPoolSize, getInitialObjectPoolSize, getMaxObjectPoolSize, getNextPoolObject, getObjectPoolGrowSize, getObjectPoolSize, getPool, init, reInitializeObjectPool, setMaxObjectPoolSize
 
Methods inherited from class com.protomatter.pool.SimpleObjectPool
checkin, checkout, getCheckedOutObjects, getNumWaiters, getObjectsInUse, getSyncObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingQueue

public BlockingQueue()
Create a new queue.
Method Detail

createObjectPoolObject

public ObjectPoolObject createObjectPoolObject()
Description copied from class: SimpleObjectPool
To be implemented by sub-classes. This is a factory method for creating objects that go in this pool.
Overrides:
createObjectPoolObject in class SimpleObjectPool
Following copied from class: com.protomatter.pool.SimpleObjectPool
Throws:
java.lang.Exception - If there is a problem creating the next object for the pool -- this is implementation specific.

getQueueLength

public int getQueueLength()
Get the length of the queue (number of work elements yet to be processed).

getNextObject

public final java.lang.Object getNextObject()
Get the next object in the queue. This method blocks until something has been added.

add

public final void add(java.lang.Object object)
Add an object to the queue. If there is a thread blocked waiting on the getNextObject() method, it will be un-blocked.

Protomatter Software v1.1.7
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.7 http://protomatter.sourceforge.net/1.1.7