Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.util
Class RequestQueue  view RequestQueue download RequestQueue.java

java.lang.Object
  extended byorg.objectstyle.cayenne.util.RequestQueue

public class RequestQueue
extends java.lang.Object

RequestQueue implements a FIFO queue for threads waiting for a particular event, resource, etc. Each thread will wait in the queue until either of the following events happen:

If any of the conditions above ocurrs, thread will be removed from the queue.


Field Summary
private static org.apache.log4j.Logger logObj
           
protected  int maxSize
           
protected  java.util.List queue
           
protected  int timeout
           
 
Constructor Summary
RequestQueue(int maxSize, int timeout)
          Constructor for RequestQueue.
 
Method Summary
 boolean dequeueFirst(java.lang.Object dequeuedObj)
          Releases the first thread in the queue.
 int getSize()
           
 RequestDequeue queueThread()
          Queues current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logObj

private static org.apache.log4j.Logger logObj

queue

protected java.util.List queue

maxSize

protected int maxSize

timeout

protected int timeout
Constructor Detail

RequestQueue

public RequestQueue(int maxSize,
                    int timeout)
Constructor for RequestQueue.

Method Detail

getSize

public int getSize()

queueThread

public RequestDequeue queueThread()
Queues current thread. This will block the caller till the thread is dequeued as a result of another thread calling dequeueFirst or as a result of a timeout.


dequeueFirst

public boolean dequeueFirst(java.lang.Object dequeuedObj)
Releases the first thread in the queue.