org.mule.util.queue
Class TransactionalQueueManager

java.lang.Object
  extended by org.mule.util.xa.AbstractResourceManager
      extended by org.mule.util.xa.AbstractXAResourceManager
          extended by org.mule.util.queue.TransactionalQueueManager
All Implemented Interfaces:
MuleContextAware, Startable, Stoppable, QueueManager

public class TransactionalQueueManager
extends AbstractXAResourceManager
implements QueueManager, MuleContextAware

The Transactional Queue Manager is responsible for creating and Managing transactional Queues. Queues can also be persistent by setting a persistence strategy on the manager. Default straties are provided for Memory, Jounaling, Cache and File.


Field Summary
 
Fields inherited from class org.mule.util.xa.AbstractXAResourceManager
activeContexts, suspendedContexts
 
Fields inherited from class org.mule.util.xa.AbstractResourceManager
DEFAULT_COMMIT_TIMEOUT_FACTOR, DEFAULT_TIMEOUT_MSECS, defaultTimeout, dirty, globalTransactions, logger, OPERATION_MODE_RECOVERING, OPERATION_MODE_STARTED, OPERATION_MODE_STARTING, OPERATION_MODE_STOPPED, OPERATION_MODE_STOPPING, operationMode, SHUTDOWN_MODE_KILL, SHUTDOWN_MODE_NORMAL, SHUTDOWN_MODE_ROLLBACK
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Constructor Summary
TransactionalQueueManager()
           
 
Method Summary
protected  AbstractTransactionContext createTransactionContext(Object session)
           
protected  void disposeQueue(Queue queue)
           
protected  void doBegin(AbstractTransactionContext context)
           
protected  void doClear(QueueInfo queue)
           
protected  void doCommit(AbstractTransactionContext context)
           
protected  Serializable doLoad(QueueInfo queue, Serializable id)
           
protected  int doPrepare(AbstractTransactionContext context)
           
protected  void doRemove(QueueInfo queue, Serializable id)
           
protected  void doRollback(AbstractTransactionContext context)
           
protected  void doStart()
           
protected  Serializable doStore(QueueInfo queue, Serializable object)
           
protected  void findAllListableObjectStores()
           
protected  void findAllQueueStores()
           
 MuleContext getMuleContext()
           
protected  QueueInfo getQueue(String name)
           
protected  QueueInfo getQueue(String name, QueueConfiguration config)
           
 QueueInfo getQueueInfo(String name)
           
 QueueSession getQueueSession()
          Returns a new instance of QueueSession bounded to this QueueManager
protected  void recover()
           
 void setDefaultQueueConfiguration(QueueConfiguration config)
          Sets the default QueueConfiguration for any created Queue for which a custom configuration hasn't been specified
 void setMuleContext(MuleContext context)
           
 void setQueueConfiguration(String queueName, QueueConfiguration config)
          Specifies a QueueConfiguration for the queue which name matches queueName
protected  boolean shutdown(int mode, long timeoutMSecs)
           
 
Methods inherited from class org.mule.util.xa.AbstractXAResourceManager
getTransactionalResource, includeBranchInXid
 
Methods inherited from class org.mule.util.xa.AbstractResourceManager
assureReady, assureStarted, beginTransaction, commitTransaction, getDefaultTransactionTimeout, prepareTransaction, rollbackTransaction, setDefaultTransactionTimeout, setDirty, setTransactionRollbackOnly, start, startTransaction, stop, stop, stop, waitForAllTxToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 

Constructor Detail

TransactionalQueueManager

public TransactionalQueueManager()
Method Detail

getQueueSession

public QueueSession getQueueSession()
Returns a new instance of QueueSession bounded to this QueueManager

Specified by:
getQueueSession in interface QueueManager
Returns:
an instance of TransactionalQueueSession

setDefaultQueueConfiguration

public void setDefaultQueueConfiguration(QueueConfiguration config)
Sets the default QueueConfiguration for any created Queue for which a custom configuration hasn't been specified

Specified by:
setDefaultQueueConfiguration in interface QueueManager
Parameters:
config - an instance of QueueConfiguration

setQueueConfiguration

public void setQueueConfiguration(String queueName,
                                  QueueConfiguration config)
Specifies a QueueConfiguration for the queue which name matches queueName

Specified by:
setQueueConfiguration in interface QueueManager
Parameters:
queueName - the name of a Queue
config - an instance of QueueConfiguration

disposeQueue

protected void disposeQueue(Queue queue)
                     throws MuleException,
                            InterruptedException
Throws:
MuleException
InterruptedException

getQueue

protected QueueInfo getQueue(String name)

getQueue

protected QueueInfo getQueue(String name,
                             QueueConfiguration config)

getQueueInfo

public QueueInfo getQueueInfo(String name)

doStart

protected void doStart()
                throws ResourceManagerSystemException
Overrides:
doStart in class AbstractResourceManager
Throws:
ResourceManagerSystemException

shutdown

protected boolean shutdown(int mode,
                           long timeoutMSecs)
Overrides:
shutdown in class AbstractResourceManager

recover

protected void recover()
                throws ResourceManagerSystemException
Overrides:
recover in class AbstractResourceManager
Throws:
ResourceManagerSystemException

createTransactionContext

protected AbstractTransactionContext createTransactionContext(Object session)
Specified by:
createTransactionContext in class AbstractResourceManager

doBegin

protected void doBegin(AbstractTransactionContext context)
Specified by:
doBegin in class AbstractResourceManager

doPrepare

protected int doPrepare(AbstractTransactionContext context)
Specified by:
doPrepare in class AbstractResourceManager

doCommit

protected void doCommit(AbstractTransactionContext context)
                 throws ResourceManagerException
Specified by:
doCommit in class AbstractResourceManager
Throws:
ResourceManagerException

doStore

protected Serializable doStore(QueueInfo queue,
                               Serializable object)
                        throws ObjectStoreException
Throws:
ObjectStoreException

doClear

protected void doClear(QueueInfo queue)
                throws ObjectStoreException,
                       InterruptedException
Throws:
ObjectStoreException
InterruptedException

doRemove

protected void doRemove(QueueInfo queue,
                        Serializable id)
                 throws ObjectStoreException
Throws:
ObjectStoreException

doLoad

protected Serializable doLoad(QueueInfo queue,
                              Serializable id)
                       throws ObjectStoreException
Throws:
ObjectStoreException

doRollback

protected void doRollback(AbstractTransactionContext context)
                   throws ResourceManagerException
Specified by:
doRollback in class AbstractResourceManager
Throws:
ResourceManagerException

findAllListableObjectStores

protected void findAllListableObjectStores()

findAllQueueStores

protected void findAllQueueStores()

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware

getMuleContext

public MuleContext getMuleContext()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.