站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 messaging API Documentation 英文版文档

PersistenceManager (JBoss Messaging API) - JBoss 3.2.7 messaging API Documentation 英文版文档


org.jboss.mq.pm.jdbc2
Class PersistenceManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.mq.pm.jdbc2.PersistenceManager
All Implemented Interfaces:
CacheStore, CacheStoreMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, PersistenceManager, PersistenceManagerMBean, PersistenceManagerMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class PersistenceManager
extends org.jboss.system.ServiceMBeanSupport
implements PersistenceManagerMBean, PersistenceManager, CacheStore

This class manages all persistence related services for JDBC based persistence.

Version:
$Revision: 1.6.2.20 $
Author:
Jayesh Parayali (jayeshpk1@yahoo.com), Hiram Chirino (cojonudo14@hotmail.com)

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Fields inherited from interface org.jboss.mq.pm.PersistenceManagerMBean
OBJECT_NAME
 
Constructor Summary
PersistenceManager()
           
 
Method Summary
protected  void add(Connection c, String queue, SpyMessage message, Tx txId, String mark)
           
 void add(MessageReference messageRef, Tx txId)
          Add a message to the persistent store.
 void addTXRecord(Connection c, long txid)
           
 void closeQueue(JMSDestination jmsDest, SpyDestination dest)
          Close a queue
 void commitPersistentTx(Tx txId)
          Commit the transaction to the persistent store.
 Tx createPersistentTx()
          Create and return a unique transaction id.
 javax.management.ObjectName getConnectionManager()
           
 int getConnectionRetryAttempts()
          Gets the ConnectionRetryAttempts.
 Object getInstance()
          Describe getInstance method here.
 javax.management.ObjectName getMessageCache()
          Describe getMessageCache method here.
 MessageCache getMessageCacheInstance()
          Get the message cache
 String getSqlProperties()
          Gets the sqlProperties.
 TxManager getTxManager()
          Get a transaction manager.
 void insertPersistentTx(org.jboss.mq.pm.jdbc2.PersistenceManager.TransactionManagerStrategy tms, Connection c, Tx tx)
           
 SpyMessage loadFromStorage(MessageReference messageRef)
          Reads the message refered to by the MessagReference back as a SpyMessage
 void markMessage(Connection c, long messageid, String destination, Tx txId, String mark)
           
 void remove(MessageReference messageRef, Tx txId)
          Remove message from the persistent store.
 void removeFromStorage(MessageReference messageRef)
          Removes the message that was stored in secondary storage.
 void removeMarkedMessages(Connection c, Tx txid, String mark)
           
 void removeTXRecord(Connection c, long txid)
           
 void resolveAllUncommitedTXs()
           
 void restoreQueue(JMSDestination jmsDest, SpyDestination dest)
          Restore a queue.
 void rollbackPersistentTx(Tx txId)
          Rollback the transaction.
 void saveToStorage(MessageReference messageRef, SpyMessage message)
          Stores the given message to secondary storeage.
 void setBlob(PreparedStatement stmt, int column, SpyMessage message)
           
 void setConnectionManager(javax.management.ObjectName connectionManagerName)
           
 void setConnectionRetryAttempts(int value)
          Sets the ConnectionRetryAttempts.
 void setMessageCache(javax.management.ObjectName messageCache)
          Describe setMessageCache method here.
 void setSqlProperties(String value)
          Sets the sqlProperties.
 void startService()
           
 void update(MessageReference messageRef, Tx txId)
          Update message in the persistent store.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
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
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

PersistenceManager

public PersistenceManager()
                   throws javax.jms.JMSException
Method Detail

resolveAllUncommitedTXs

public void resolveAllUncommitedTXs()
                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

restoreQueue

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

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

commitPersistentTx

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

Specified by:
commitPersistentTx in interface PersistenceManager
Parameters:
txId - Description of Parameter
Throws:
javax.jms.JMSException - for any error

removeMarkedMessages

public void removeMarkedMessages(Connection c,
                                 Tx txid,
                                 String mark)
                          throws SQLException
Throws:
SQLException

addTXRecord

public void addTXRecord(Connection c,
                        long txid)
                 throws SQLException
Throws:
SQLException

removeTXRecord

public void removeTXRecord(Connection c,
                           long txid)
                    throws SQLException
Throws:
SQLException

rollbackPersistentTx

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

Specified by:
rollbackPersistentTx in interface PersistenceManager
Parameters:
txId - Description of Parameter
Throws:
javax.jms.JMSException - for any error

createPersistentTx

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

Specified by:
createPersistentTx in interface PersistenceManager
Returns:
the transaction
Throws:
javax.jms.JMSException - for any error

insertPersistentTx

public void insertPersistentTx(org.jboss.mq.pm.jdbc2.PersistenceManager.TransactionManagerStrategy tms,
                               Connection c,
                               Tx tx)
                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

add

public void add(MessageReference messageRef,
                Tx txId)
         throws javax.jms.JMSException
Description copied from interface: PersistenceManager
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
Parameters:
messageRef - the message
txId - the transaction
Throws:
javax.jms.JMSException - for any error

add

protected void add(Connection c,
                   String queue,
                   SpyMessage message,
                   Tx txId,
                   String mark)
            throws SQLException,
                   IOException
Throws:
SQLException
IOException

markMessage

public void markMessage(Connection c,
                        long messageid,
                        String destination,
                        Tx txId,
                        String mark)
                 throws SQLException
Throws:
SQLException

setBlob

public void setBlob(PreparedStatement stmt,
                    int column,
                    SpyMessage message)
             throws IOException,
                    SQLException
Throws:
IOException
SQLException

update

public void update(MessageReference messageRef,
                   Tx txId)
            throws javax.jms.JMSException
Description copied from interface: PersistenceManager
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
Parameters:
messageRef -
txId - Description of Parameter
Throws:
javax.jms.JMSException - for any error

remove

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

Specified by:
remove in interface PersistenceManager
Parameters:
messageRef - the message
txId - the transaction
Throws:
javax.jms.JMSException - for any error

getTxManager

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

Specified by:
getTxManager in interface PersistenceManager
Returns:
the transaction manager

closeQueue

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

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

loadFromStorage

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

Specified by:
loadFromStorage in interface CacheStore
Parameters:
messageRef - the message reference
Returns:
the message
Throws:
javax.jms.JMSException - for any error

removeFromStorage

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

Specified by:
removeFromStorage in interface CacheStore
Parameters:
messageRef - the message reference
Throws:
javax.jms.JMSException - for any error

saveToStorage

public void saveToStorage(MessageReference messageRef,
                          SpyMessage message)
                   throws javax.jms.JMSException
Description copied from interface: CacheStore
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
Parameters:
messageRef - the message reference
message - the message
Throws:
javax.jms.JMSException - for any error

startService

public void startService()
                  throws Exception
Throws:
Exception

getInstance

public Object getInstance()
Describe getInstance method here.

Specified by:
getInstance in interface PersistenceManagerMBean
Returns:
an Object value

getMessageCache

public javax.management.ObjectName getMessageCache()
Describe getMessageCache method here.

Specified by:
getMessageCache in interface PersistenceManagerMBean
Returns:
an ObjectName value

setMessageCache

public void setMessageCache(javax.management.ObjectName messageCache)
Describe setMessageCache method here.

Specified by:
setMessageCache in interface PersistenceManagerMBean
Parameters:
messageCache - an ObjectName value

getConnectionManager

public javax.management.ObjectName getConnectionManager()
Specified by:
getConnectionManager in interface PersistenceManagerMBean

setConnectionManager

public void setConnectionManager(javax.management.ObjectName connectionManagerName)
Specified by:
setConnectionManager in interface PersistenceManagerMBean

getMessageCacheInstance

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

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

getSqlProperties

public String getSqlProperties()
Gets the sqlProperties.

Specified by:
getSqlProperties in interface PersistenceManagerMBean
Returns:
Returns a Properties

setSqlProperties

public void setSqlProperties(String value)
Sets the sqlProperties.

Specified by:
setSqlProperties in interface PersistenceManagerMBean

setConnectionRetryAttempts

public void setConnectionRetryAttempts(int value)
Sets the ConnectionRetryAttempts.

Specified by:
setConnectionRetryAttempts in interface PersistenceManagerMBean

getConnectionRetryAttempts

public int getConnectionRetryAttempts()
Gets the ConnectionRetryAttempts.

Specified by:
getConnectionRetryAttempts in interface PersistenceManagerMBean
Returns:
Returns a ConnectionRetryAttempt value


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.