uPortal 2.4.1
API Documentation

org.jasig.portal.utils.threading
Interface Queue

All Known Implementing Classes:
BoundedQueue, UnboundedQueue

public interface Queue

A FIFO Queue.

Version:
$Revision: 1.1 $
Author:
Chad La Joie

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.
 

Method Detail

put

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

Parameters:
o - the item being placed in the queue
Throws:
java.lang.InterruptedException - thrown when a thread is waiting to place an item into a full queue and another thread interrupts it

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.

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

isEmpty

public boolean isEmpty()
Checks if the queue is empty

Returns:
True if the queue contains no items, false if not

isFull

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

Returns:
True if the queue can contain no more items, false if not. False is also returned if the queue has no limit on the number of items it can contain

size

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

Returns:
the number of items currently in the queue

uPortal 2.4.1
API Documentation