com.cisco.services.tracing
Class TraceBlockingQueue

java.lang.Object
  extended by com.cisco.services.tracing.TraceBlockingQueue

public final class TraceBlockingQueue
extends java.lang.Object


Constructor Summary
TraceBlockingQueue()
           
TraceBlockingQueue(int initialCapacity)
           
TraceBlockingQueue(int initialCapacity, int capacityIncrement)
           
 
Method Summary
 long getAverageTakeMillis()
           
 int getMaxLength()
           
 long getTotalTakeMillis()
           
 java.lang.Object peek()
           
 java.lang.Object[] peekAll()
           
 void put(java.lang.Object x)
           
 void resetStatistics()
           
 void setCollectStatistics(boolean enabled)
           
 int size()
           
 java.lang.Object take()
          Take one element off the queue -- if no event on the queue, wait forever for one to become available
 java.lang.Object take(long msecs)
          Take one element off the queue -- if no event on the queue, wait for a specified time for one to become available
 java.lang.Object[] takeAll()
          Take all elements off the queue -- if no events are on the queue, wait forever
 java.lang.Object[] takeAll(long msecs)
          Take all elements off the queue -- if no events are on the queue, wait for a specified time for one to become available
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceBlockingQueue

public TraceBlockingQueue()

TraceBlockingQueue

public TraceBlockingQueue(int initialCapacity)

TraceBlockingQueue

public TraceBlockingQueue(int initialCapacity,
                          int capacityIncrement)
Method Detail

getMaxLength

public int getMaxLength()

getAverageTakeMillis

public long getAverageTakeMillis()

getTotalTakeMillis

public long getTotalTakeMillis()

put

public void put(java.lang.Object x)
         throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

take

public java.lang.Object take()
                      throws java.lang.InterruptedException
Take one element off the queue -- if no event on the queue, wait forever for one to become available

Returns:
dequeued element
Throws:
java.lang.InterruptedException

take

public java.lang.Object take(long msecs)
                      throws java.lang.InterruptedException
Take one element off the queue -- if no event on the queue, wait for a specified time for one to become available

Parameters:
msecs - number of milliseconds to wait for an element to be put on the queue
Returns:
dequeued element if one was available during the specified time, null if timeout occurred
Throws:
java.lang.InterruptedException

takeAll

public java.lang.Object[] takeAll()
                           throws java.lang.InterruptedException
Take all elements off the queue -- if no events are on the queue, wait forever

Returns:
dequeued elements
Throws:
java.lang.InterruptedException

takeAll

public java.lang.Object[] takeAll(long msecs)
                           throws java.lang.InterruptedException
Take all elements off the queue -- if no events are on the queue, wait for a specified time for one to become available

Parameters:
msecs - number of milliseconds to wait for an element to be put on the queue
Returns:
dequeued elements if at least one was available during the specified time, null if timeout occurred
Throws:
java.lang.InterruptedException

peekAll

public java.lang.Object[] peekAll()

peek

public java.lang.Object peek()

setCollectStatistics

public void setCollectStatistics(boolean enabled)

resetStatistics

public void resetStatistics()

size

public int size()