org.apache.cocoon.thread.impl
Class LinkedQueue

java.lang.Object
  extended byEDU.oswego.cs.dl.util.concurrent.LinkedQueue
      extended byorg.apache.cocoon.thread.impl.LinkedQueue
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.Channel, EDU.oswego.cs.dl.util.concurrent.Puttable, Queue, EDU.oswego.cs.dl.util.concurrent.Takable

public class LinkedQueue
extends EDU.oswego.cs.dl.util.concurrent.LinkedQueue
implements Queue

A linked list based channel implementation. The algorithm avoids contention between puts and takes when the queue is not empty. Normally a put and a take can proceed simultaneously. (Although it does not allow multiple concurrent puts or takes.) This class tends to perform more efficently than other Queue implementations in producer/consumer applications.

[ Introduction to this package. ]


Field Summary
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.LinkedQueue
head_, last_, putLock_, waitingForTake_
 
Constructor Summary
LinkedQueue()
           
 
Method Summary
 int getQueueSize()
          get the current queue size
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.LinkedQueue
extract, insert, isEmpty, offer, peek, poll, put, take
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface EDU.oswego.cs.dl.util.concurrent.Channel
offer, peek, poll, put, take
 

Constructor Detail

LinkedQueue

public LinkedQueue()
Method Detail

getQueueSize

public int getQueueSize()
Description copied from interface: Queue
get the current queue size

Specified by:
getQueueSize in interface Queue
Returns:
current size of queue. If the size of the queue is not maintained by an implementation -1 should be returned.
See Also:
Queue.getQueueSize()


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.