uPortal 2.4.1
API Documentation

org.jasig.portal.utils
Class BlockingQueue

java.lang.Object
  extended byorg.jasig.portal.utils.BlockingQueue

public class BlockingQueue
extends java.lang.Object

A simple FIFO queue that has MIN/MAX capacity and that blocks if either enqueue/dequeue would result in violation of these limits. Default values for min/max are 0/infinite

Author:
Peter Kharchenko

Method Summary
 java.lang.Object dequeue()
          Remove object from the beginning of the queue
 void enqueue(java.lang.Object o)
          Add new object to the end of the queue
 int getMaxSize()
           
 int getMinSize()
           
 void setLimits(int max, int min)
          Set the queue limits.
 void setMaxSize(int max)
           
 void setMinSize(int min)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

enqueue

public void enqueue(java.lang.Object o)
             throws java.lang.InterruptedException
Add new object to the end of the queue

Parameters:
o - object to be placed on the queue
Throws:
java.lang.InterruptedException

dequeue

public java.lang.Object dequeue()
                         throws java.lang.InterruptedException
Remove object from the beginning of the queue

Throws:
java.lang.InterruptedException - if the wait was interrupted

setLimits

public void setLimits(int max,
                      int min)
Set the queue limits. To specify a queue without an upper bound (that is max=inifinity) use max value of -1


getMaxSize

public int getMaxSize()

getMinSize

public int getMinSize()

setMaxSize

public void setMaxSize(int max)

setMinSize

public void setMinSize(int min)

size

public int size()

uPortal 2.4.1
API Documentation