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<Object>
              extended by org.wso2.carbon.registry.core.utils.LogQueue
All Implemented Interfaces:
Serializable, Iterable<Object>, Collection<Object>, BlockingQueue<Object>, Queue<Object>

public class LogQueue
extends LinkedBlockingQueue<Object>

Implementation of a Queue for logs.

See Also:
Serialized Form

Constructor Summary
LogQueue()
           
 
Method Summary
 void clear()
          Clears to queue.
 Object peek()
          Retrieves the head of the queue, or null if this queue is empty.
 Object poll()
          Retrieves and removes the head of this queue, or null if this queue is empty.
 void put(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 Collection<Object>
Overrides:
clear in class LinkedBlockingQueue<Object>

peek

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

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

poll

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

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

put

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

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

size

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

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


Copyright © 2012 WSO2 Inc. All Rights Reserved.