org.wso2.carbon.registry.core.utils
Class LogQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.LinkedBlockingQueue<java.lang.Object>
              extended by org.wso2.carbon.registry.core.utils.LogQueue
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.concurrent.BlockingQueue<java.lang.Object>, java.util.Queue<java.lang.Object>

public class LogQueue
extends java.util.concurrent.LinkedBlockingQueue<java.lang.Object>

Implementation of a Queue for logs.

See Also:
Serialized Form

Constructor Summary
LogQueue()
           
 
Method Summary
 void clear()
          Clears to queue.
 java.lang.Object peek()
          Retrieves the head of the queue, or null if this queue is empty.
 java.lang.Object poll()
          Retrieves and removes the head of this queue, or null if this queue is empty.
 void put(java.lang.Object object)
          Adds an item into this queue.
 int size()
          Obtains the size of this queue.
 
Methods inherited from class java.util.concurrent.LinkedBlockingQueue
drainTo, drainTo, iterator, offer, offer, poll, remainingCapacity, remove, take, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
add, addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Constructor Detail

LogQueue

public LogQueue()
Method Detail

clear

public void clear()
Clears to queue.

Specified by:
clear in interface java.util.Collection<java.lang.Object>
Overrides:
clear in class java.util.concurrent.LinkedBlockingQueue<java.lang.Object>

peek

public java.lang.Object peek()
Retrieves the head of the queue, or null if this queue is empty.

Specified by:
peek in interface java.util.Queue<java.lang.Object>
Overrides:
peek in class java.util.concurrent.LinkedBlockingQueue<java.lang.Object>
Returns:
the top most object, or null if this queue is empty.

poll

public java.lang.Object poll()
Retrieves and removes the head of this queue, or null if this queue is empty.

Specified by:
poll in interface java.util.Queue<java.lang.Object>
Overrides:
poll in class java.util.concurrent.LinkedBlockingQueue<java.lang.Object>
Returns:
the top most object, or null if this queue is empty.

put

public void put(java.lang.Object object)
         throws java.lang.InterruptedException
Adds an item into this queue.

Specified by:
put in interface java.util.concurrent.BlockingQueue<java.lang.Object>
Overrides:
put in class java.util.concurrent.LinkedBlockingQueue<java.lang.Object>
Parameters:
object - the object to add
Throws:
java.lang.InterruptedException - if the operation failed.

size

public int size()
Obtains the size of this queue.

Specified by:
size in interface java.util.Collection<java.lang.Object>
Overrides:
size in class java.util.concurrent.LinkedBlockingQueue<java.lang.Object>
Returns:
the size of this queue.


Copyright © 2011 WSO2 Inc. All Rights Reserved.