Stellent
HowToComponents
JavaDoc

intradoc.lang
Class BlockingQueue

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--intradoc.lang.Queue
                          |
                          +--intradoc.lang.BlockingQueue
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class BlockingQueue
extends Queue

The BlockingQueue class represents a Queue where remove will block the calling thread if the queue is empty.

See Also:
Queue, Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BlockingQueue()
           
 
Method Summary
 java.lang.Object insert(java.lang.Object obj)
          Adds an object to the back of this queue notifying a blocked threads (if there is one).
 java.util.Vector namesOfBlockedThreads()
          Get the list of threads waiting on this queue.
 java.lang.Object remove()
          Removes an object from the front of this queue and returns that object blocking if the queue is empty.
 java.lang.Object removeWithTimeout(long milliseconds)
          Removes an object from the front of this queue and returns that object blocking, with timeout, if the queue is empty.
 
Methods inherited from class intradoc.lang.Queue
empty, peek, search
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

BlockingQueue

public BlockingQueue()
Method Detail

insert

public java.lang.Object insert(java.lang.Object obj)
Adds an object to the back of this queue notifying a blocked threads (if there is one).

Overrides:
insert in class Queue
Parameters:
obj - the object to add to this queue.
Returns:
the item argument.

remove

public java.lang.Object remove()
Removes an object from the front of this queue and returns that object blocking if the queue is empty.

Overrides:
remove in class Queue
Returns:
the object at the front of this queue.

removeWithTimeout

public java.lang.Object removeWithTimeout(long milliseconds)
Removes an object from the front of this queue and returns that object blocking, with timeout, if the queue is empty.

Parameters:
milliseconds - the timeout interval.
Returns:
the object at the front of this queue.

namesOfBlockedThreads

public java.util.Vector namesOfBlockedThreads()
Get the list of threads waiting on this queue.

Returns:
Vector of String containing thread named waiting.


(c) 1996-2005  All rights reserved.  Stellent, Inc.