uPortal 2.4.1
API Documentation

org.jasig.portal.utils.threading
Class UnboundedQueue

java.lang.Object
  extended byorg.jasig.portal.utils.threading.UnboundedQueue
All Implemented Interfaces:
Queue

public class UnboundedQueue
extends java.lang.Object
implements Queue


Constructor Summary
UnboundedQueue()
          Creates an UnboucedQueue with no elements
 
Method Summary
 boolean isEmpty()
          Checks if the queue is empty
 boolean isFull()
          Checks to see if the queue is full
 void put(java.lang.Object o)
          Puts an item into the Queue
 int size()
          Gets the total number of items in the queue
 java.lang.Object take()
          Takes the next item in the Queue, if there are no items in the queue the thread is blocked until there is.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnboundedQueue

public UnboundedQueue()
Creates an UnboucedQueue with no elements

Method Detail

isEmpty

public boolean isEmpty()
Checks if the queue is empty

Specified by:
isEmpty in interface Queue
Returns:
True if the queue contains no items, false if not

isFull

public boolean isFull()
Checks to see if the queue is full

Specified by:
isFull in interface Queue
Returns:
returns false as this queue does not have an upper item limit and can therefore never be full

size

public int size()
Gets the total number of items in the queue

Specified by:
size in interface Queue
Returns:
the number of items currently in the queue

put

public void put(java.lang.Object o)
         throws java.lang.InterruptedException
Puts an item into the Queue

Specified by:
put in interface Queue
Parameters:
o - the item being placed in the queue
Throws:
java.lang.InterruptedException - never thrown as a thread never has to wait to put an item into the queue

take

public java.lang.Object take()
                      throws java.lang.InterruptedException
Takes the next item in the Queue, if there are no items in the queue the thread is blocked until there is.

Specified by:
take in interface Queue
Returns:
The next Object in the queue
Throws:
java.lang.InterruptedException - thrown when a thread is waiting get an item from an empty queue and another thread interrupts it

uPortal 2.4.1
API Documentation