org.mule.util.queue
Class AbstractQueueManager

java.lang.Object
  extended by org.mule.util.queue.AbstractQueueManager
All Implemented Interfaces:
MuleContextAware, Disposable, Initialisable, Startable, Stoppable, QueueManager, QueueProvider, QueueStoreCacheListener
Direct Known Subclasses:
TransactionalQueueManager

public abstract class AbstractQueueManager
extends Object
implements QueueManager, QueueProvider, QueueStoreCacheListener, MuleContextAware, Initialisable, Disposable

Abstract implementation for a QueueManager. Contains all the logic related to queue caching and queue configuration definition.


Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
AbstractQueueManager()
           
 
Method Summary
protected  void clearQueueConfiguration(String queueName)
           
 void closeQueueStore(QueueStore queueStore)
           
protected abstract  QueueStore createQueueStore(String name, QueueConfiguration config)
          Creates a QueueStore
 void dispose()
          A lifecycle method where implementor should free up any resources.
 void disposeQueueStore(QueueStore queueStore)
           
protected abstract  void doDispose()
          Dispose resources allocated by the implementations.
protected  MuleContext getMuleContext()
           
 QueueStore getQueue(String queueName)
           
 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 newConfig)
          Specifies a QueueConfiguration for the queue which name matches queueName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.util.queue.QueueManager
getQueueSession
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.util.queue.QueueProvider
getRecoveryQueue
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 

Field Detail

logger

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

AbstractQueueManager

public AbstractQueueManager()
Method Detail

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 newConfig)
Specifies a QueueConfiguration for the queue which name matches queueName

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

setMuleContext

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

getMuleContext

protected MuleContext getMuleContext()

dispose

public final void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

disposeQueueStore

public void disposeQueueStore(QueueStore queueStore)
Specified by:
disposeQueueStore in interface QueueStoreCacheListener
Parameters:
queueStore - queue to be disposed

closeQueueStore

public void closeQueueStore(QueueStore queueStore)
Specified by:
closeQueueStore in interface QueueStoreCacheListener
Parameters:
queueStore - queue to be closed.

getQueue

public QueueStore getQueue(String queueName)
Specified by:
getQueue in interface QueueProvider
Parameters:
queueName - queue name
Returns:
the queue store related to the queue with queueName

clearQueueConfiguration

protected void clearQueueConfiguration(String queueName)

createQueueStore

protected abstract QueueStore createQueueStore(String name,
                                               QueueConfiguration config)
Creates a QueueStore

Parameters:
name - queue name
config - configuration for the queue
Returns:
a new QueueStore for the given queue name

doDispose

protected abstract void doDispose()
Dispose resources allocated by the implementations. This method is run after the queues were disposed and removed from the cache.



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