org.mule.util.queue
Class TransactionAwareQueueStore

java.lang.Object
  extended by org.mule.util.queue.TransactionAwareQueueStore
All Implemented Interfaces:
NamedObject, Queue

public class TransactionAwareQueueStore
extends Object
implements Queue

Queue implementation that executes operations: - If there is no transaction context then executes the operation directly to the queue. - If there is a transaction context then executes the operation through the transaction context. - During queue dispose a QueueStoreCacheListener will be notified


Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
TransactionAwareQueueStore(QueueStore queue, TransactionContextProvider transactionContextProvider, MuleContext muleContext)
           
 
Method Summary
 void clear()
          Discards all the elements in the queue
 void dispose()
          Disposes this queue by releasing it's storage and associated memory and storage.
 String getName()
          Gets the name of the object
 boolean offer(Serializable item, long timeout)
           
 Serializable peek()
           
 Serializable poll(long timeout)
           
 void put(Serializable item)
          Puts a new object in this queue and wait if necessary.
 int size()
          Returns the number of elements in this queue.
 Serializable take()
          Blocks and retrieves an object from this queue.
 void untake(Serializable item)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient org.apache.commons.logging.Log logger
Constructor Detail

TransactionAwareQueueStore

public TransactionAwareQueueStore(QueueStore queue,
                                  TransactionContextProvider transactionContextProvider,
                                  MuleContext muleContext)
Method Detail

put

public void put(Serializable item)
         throws InterruptedException,
                ObjectStoreException
Description copied from interface: Queue
Puts a new object in this queue and wait if necessary.

Specified by:
put in interface Queue
Throws:
InterruptedException
ObjectStoreException

clear

public void clear()
           throws InterruptedException
Description copied from interface: Queue
Discards all the elements in the queue

Specified by:
clear in interface Queue
Throws:
InterruptedException

offer

public boolean offer(Serializable item,
                     long timeout)
              throws InterruptedException,
                     ObjectStoreException
Specified by:
offer in interface Queue
Throws:
InterruptedException
ObjectStoreException

take

public Serializable take()
                  throws InterruptedException
Description copied from interface: Queue
Blocks and retrieves an object from this queue.

Specified by:
take in interface Queue
Returns:
an object.
Throws:
InterruptedException

untake

public void untake(Serializable item)
            throws InterruptedException,
                   ObjectStoreException
Specified by:
untake in interface Queue
Throws:
InterruptedException
ObjectStoreException

poll

public Serializable poll(long timeout)
                  throws InterruptedException
Specified by:
poll in interface Queue
Throws:
InterruptedException

peek

public Serializable peek()
                  throws InterruptedException
Specified by:
peek in interface Queue
Throws:
InterruptedException

dispose

public void dispose()
             throws MuleException,
                    InterruptedException
Description copied from interface: Queue
Disposes this queue by releasing it's storage and associated memory and storage. If after disposing the queue you try go get it back, you'll get a fresh new one which maintains none of the original one's data

Specified by:
dispose in interface Queue
Throws:
MuleException
InterruptedException

size

public int size()
Description copied from interface: Queue
Returns the number of elements in this queue.

Specified by:
size in interface Queue

getName

public String getName()
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
Returns:
the name of the object


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.