org.jboss.mq.pm.none
Class PersistenceManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.mq.pm.none.PersistenceManager
All Implemented Interfaces:
CacheStore (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , PersistenceManager (src) , Service (src) , ServiceMBean (src)
Direct Known Subclasses:
NewPersistenceManager (src)

public class PersistenceManager
extends ServiceMBeanSupport (src)
implements PersistenceManager (src) , CacheStore (src)

A persistence manager and cache store that does not persistence. It can do persistence by delegating to a real persistence manager, depending upon destination configuration.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
PersistenceManager()
           
 
Method Summary
 void add(MessageReference (src)  message, Tx (src)  txId)
          Add a message to the persistent store.
 void closeQueue(JMSDestination (src)  jmsDest, SpyDestination (src)  dest)
          Close a queue
 void commitPersistentTx(Tx (src)  txId)
          Commit the transaction to the persistent store.
 Tx (src) createPersistentTx()
          Create and return a unique transaction id.
 ObjectName (src) getDelegatePM()
          Retrieve the delegate persistence manager
 java.lang.Object getInstance()
           
 ObjectName (src) getMessageCache()
          Unsupported operation
 MessageCache (src) getMessageCacheInstance()
          Get the message cache
 TxManager (src) getTxManager()
          Get a transaction manager.
 SpyMessage (src) loadFromStorage(MessageReference (src)  mh)
          Reads the message refered to by the MessagReference back as a SpyMessage
 void remove(MessageReference (src)  message, Tx (src)  txId)
          Remove message from the persistent store.
 void removeFromStorage(MessageReference (src)  mh)
          Removes the message that was stored in secondary storage.
 void restoreQueue(JMSDestination (src)  jmsDest, SpyDestination (src)  dest)
          Restore a queue.
 void rollbackPersistentTx(Tx (src)  txId)
          Rollback the transaction.
 void saveToStorage(MessageReference (src)  mh, SpyMessage (src)  message)
          Stores the given message to secondary storeage.
 void setDelegatePM(ObjectName (src)  delegateName)
          Set the delegate persistence manager
 void setMessageCache(ObjectName (src)  messageCache)
          Unsupported operation
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 void update(MessageReference (src)  message, Tx (src)  txId)
          Update message in the persistent store.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceManager

public PersistenceManager()
Method Detail

getDelegatePM

public ObjectName (src)  getDelegatePM()
Retrieve the delegate persistence manager

Returns:
the object name of the delegate persistence manager

setDelegatePM

public void setDelegatePM(ObjectName (src)  delegateName)
Set the delegate persistence manager


add

public void add(MessageReference (src)  message,
                Tx (src)  txId)
         throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Add a message to the persistent store. If the message is part of a transaction, txId is not null.

Specified by:
add in interface PersistenceManager (src)
Parameters:
message - the message
txId - the transaction
Throws:
JMSException (src) - for any error

closeQueue

public void closeQueue(JMSDestination (src)  jmsDest,
                       SpyDestination (src)  dest)
                throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Close a queue

Specified by:
closeQueue in interface PersistenceManager (src)
Parameters:
jmsDest - the jms destination
dest - the client destination
Throws:
JMSException (src) - for any error

commitPersistentTx

public void commitPersistentTx(Tx (src)  txId)
                        throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Commit the transaction to the persistent store.

Specified by:
commitPersistentTx in interface PersistenceManager (src)
Parameters:
txId - Description of Parameter
Throws:
JMSException (src) - for any error

createPersistentTx

public Tx (src)  createPersistentTx()
                      throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Create and return a unique transaction id.

Specified by:
createPersistentTx in interface PersistenceManager (src)
Returns:
the transaction
Throws:
JMSException (src) - for any error

getMessageCacheInstance

public MessageCache (src)  getMessageCacheInstance()
Description copied from interface: PersistenceManager (src)
Get the message cache

Specified by:
getMessageCacheInstance in interface PersistenceManager (src)
Returns:
the instance of the message cache

getTxManager

public TxManager (src)  getTxManager()
Description copied from interface: PersistenceManager (src)
Get a transaction manager.

Specified by:
getTxManager in interface PersistenceManager (src)
Returns:
the transaction manager

remove

public void remove(MessageReference (src)  message,
                   Tx (src)  txId)
            throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Remove message from the persistent store. If the message is part of a transaction, txId is not null.

Specified by:
remove in interface PersistenceManager (src)
Parameters:
message - the message
txId - the transaction
Throws:
JMSException (src) - for any error

restoreQueue

public void restoreQueue(JMSDestination (src)  jmsDest,
                         SpyDestination (src)  dest)
                  throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Restore a queue.

Specified by:
restoreQueue in interface PersistenceManager (src)
Parameters:
jmsDest - the jms destination
dest - the client destination
Throws:
JMSException (src) - for any error

rollbackPersistentTx

public void rollbackPersistentTx(Tx (src)  txId)
                          throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Rollback the transaction.

Specified by:
rollbackPersistentTx in interface PersistenceManager (src)
Parameters:
txId - Description of Parameter
Throws:
JMSException (src) - for any error

update

public void update(MessageReference (src)  message,
                   Tx (src)  txId)
            throws JMSException (src) 
Description copied from interface: PersistenceManager (src)
Update message in the persistent store. If the message is part of a transaction, txId is not null (not currently supported).

Specified by:
update in interface PersistenceManager (src)
Parameters:
message -
txId - Description of Parameter
Throws:
JMSException (src) - for any error

getInstance

public java.lang.Object getInstance()

getMessageCache

public ObjectName (src)  getMessageCache()
Unsupported operation


setMessageCache

public void setMessageCache(ObjectName (src)  messageCache)
Unsupported operation


loadFromStorage

public SpyMessage (src)  loadFromStorage(MessageReference (src)  mh)
                           throws JMSException (src) 
Description copied from interface: CacheStore (src)
Reads the message refered to by the MessagReference back as a SpyMessage

Specified by:
loadFromStorage in interface CacheStore (src)
Parameters:
mh - the message reference
Returns:
the message
Throws:
JMSException (src) - for any error

removeFromStorage

public void removeFromStorage(MessageReference (src)  mh)
                       throws JMSException (src) 
Description copied from interface: CacheStore (src)
Removes the message that was stored in secondary storage.

Specified by:
removeFromStorage in interface CacheStore (src)
Parameters:
mh - the message reference
Throws:
JMSException (src) - for any error

saveToStorage

public void saveToStorage(MessageReference (src)  mh,
                          SpyMessage (src)  message)
                   throws JMSException (src) 
Description copied from interface: CacheStore (src)
Stores the given message to secondary storeage. You should be able to use the MessagReference to load the message back later.

Specified by:
saveToStorage in interface CacheStore (src)
Parameters:
mh - the message reference
message - the message
Throws:
JMSException (src) - for any error

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception