org.apache.cocoon.components.thread
Class BoundedQueue

java.lang.Object
  extended by EDU.oswego.cs.dl.util.concurrent.BoundedBuffer
      extended by org.apache.cocoon.components.thread.BoundedQueue
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.BoundedChannel, EDU.oswego.cs.dl.util.concurrent.Channel, EDU.oswego.cs.dl.util.concurrent.Puttable, EDU.oswego.cs.dl.util.concurrent.Takable, Queue

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

Efficient array-based bounded buffer class. Adapted from CPJ, chapter 8, which describes design.

[ Introduction to this package. ]


Field Summary
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.BoundedBuffer
array_, emptySlots_, putMonitor_, putPtr_, takePtr_, usedSlots_
 
Constructor Summary
BoundedQueue()
          Create a buffer with the current default capacity
BoundedQueue(int capacity)
          Create a BoundedQueue with the given capacity.
 
Method Summary
 int getQueueSize()
          DOCUMENT ME!
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.BoundedBuffer
capacity, extract, incEmptySlots, incUsedSlots, insert, offer, peek, poll, put, size, 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

BoundedQueue

public BoundedQueue()
Create a buffer with the current default capacity


BoundedQueue

public BoundedQueue(int capacity)
             throws IllegalArgumentException
Create a BoundedQueue with the given capacity.

Parameters:
capacity - The capacity
Throws:
IllegalArgumentException - if capacity less or equal to zero
Method Detail

getQueueSize

public int getQueueSize()
DOCUMENT ME!

Specified by:
getQueueSize in interface Queue
Returns:
current size of queue.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.