|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.mq.pm.jdbc2.PersistenceManager
public class PersistenceManager
This class manages all persistence related services for JDBC based persistence.
| Nested Class Summary | |
|---|---|
protected class |
PersistenceManager.TransactionManagerStrategy
This inner class helps handle the tx management of the jdbc connections. |
| 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,
Tx 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. |
protected void |
createSchema()
|
protected Connection |
getConnection()
Gets a connection from the datasource, retrying as needed. |
javax.management.ObjectName |
getConnectionManager()
|
int |
getConnectionRetryAttempts()
|
Object |
getInstance()
Get the instance |
javax.management.ObjectName |
getMessageCache()
Get the object name of the cache |
MessageCache |
getMessageCacheInstance()
Get the message cache |
int |
getRecoverMessagesChunk()
|
int |
getRecoveryRetries()
|
int |
getRecoveryTimeout()
|
String |
getSqlProperties()
|
int |
getStatementRetries()
|
TxManager |
getTxManager()
Get a transaction manager. |
protected void |
initializeFields()
|
void |
insertPersistentTx(PersistenceManager.TransactionManagerStrategy tms,
Connection c,
Tx tx)
|
protected void |
internalRestoreQueue(JMSDestination jmsDest,
SpyDestination dest)
|
boolean |
isXARecovery()
|
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)
|
protected 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 |
setBlob(PreparedStatement stmt,
int column,
Xid xid)
|
void |
setConnectionManager(javax.management.ObjectName connectionManagerName)
|
void |
setConnectionRetryAttempts(int value)
|
void |
setMessageCache(javax.management.ObjectName messageCache)
Set the object name of the message cache |
void |
setRecoverMessagesChunk(int recoverMessagesChunk)
|
void |
setRecoveryRetries(int retries)
|
void |
setRecoveryTimeout(int timeout)
|
void |
setSqlProperties(String value)
|
void |
setStatementRetries(int statementRetries)
|
void |
setXARecovery(boolean xaRecovery)
|
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, getDeploymentInfo, 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, nextNotificationSequenceNumber, 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 |
| Field Detail |
|---|
protected EDU.oswego.cs.dl.util.concurrent.SynchronizedLong nextTransactionId
protected TxManager txManager
protected DataSource datasource
protected TransactionManager tm
protected String UPDATE_MARKED_MESSAGES
protected String UPDATE_MARKED_MESSAGES_XARECOVERY
protected String UPDATE_MARKED_MESSAGES_WITH_TX
protected String DELETE_MARKED_MESSAGES_WITH_TX
protected String DELETE_MARKED_MESSAGES_WITH_TX_XARECOVERY
protected String DELETE_TX
protected String DELETE_MARKED_MESSAGES
protected String DELETE_TEMPORARY_MESSAGES
protected String INSERT_TX
protected String INSERT_TX_XARECOVERY
protected String DELETE_ALL_TX
protected String DELETE_ALL_TX_XARECOVERY
protected String SELECT_MAX_TX
protected String SELECT_ALL_TX_XARECOVERY
protected String SELECT_MESSAGES_IN_DEST
protected String SELECT_MESSAGES_IN_DEST_XARECOVERY
protected String SELECT_MESSAGE_KEYS_IN_DEST
protected String SELECT_MESSAGE
protected String SELECT_MESSAGE_XARECOVERY
protected String INSERT_MESSAGE
protected String MARK_MESSAGE
protected String DELETE_MESSAGE
protected String UPDATE_MESSAGE
protected String CREATE_MESSAGE_TABLE
protected String CREATE_IDX_MESSAGE_TXOP_TXID
protected String CREATE_IDX_MESSAGE_DESTINATION
protected String CREATE_TX_TABLE
protected String CREATE_TX_TABLE_XARECOVERY
protected static final int OBJECT_BLOB
protected static final int BYTES_BLOB
protected static final int BINARYSTREAM_BLOB
protected static final int BLOB_BLOB
protected int blobType
protected boolean createTables
protected int connectionRetryAttempts
protected boolean xaRecovery
protected javax.management.ObjectName connectionManagerName
protected Properties sqlProperties
| Constructor Detail |
|---|
public PersistenceManager()
throws javax.jms.JMSException
javax.jms.JMSException| Method Detail |
|---|
protected void createSchema()
throws javax.jms.JMSException
javax.jms.JMSException
protected void resolveAllUncommitedTXs()
throws javax.jms.JMSException
javax.jms.JMSException
public void restoreQueue(JMSDestination jmsDest,
SpyDestination dest)
throws javax.jms.JMSException
PersistenceManager
restoreQueue in interface PersistenceManagerjmsDest - the jms destinationdest - the client destination
javax.jms.JMSException - for any error
protected void internalRestoreQueue(JMSDestination jmsDest,
SpyDestination dest)
throws javax.jms.JMSException
javax.jms.JMSException
public void commitPersistentTx(Tx txId)
throws javax.jms.JMSException
PersistenceManager
commitPersistentTx in interface PersistenceManagertxId - Description of Parameter
javax.jms.JMSException - for any error
public void removeMarkedMessages(Connection c,
Tx txid,
String mark)
throws SQLException
SQLException
public void addTXRecord(Connection c,
Tx txid)
throws SQLException,
IOException
SQLException
IOException
public void removeTXRecord(Connection c,
long txid)
throws SQLException
SQLException
public void rollbackPersistentTx(Tx txId)
throws javax.jms.JMSException
PersistenceManager
rollbackPersistentTx in interface PersistenceManagertxId - Description of Parameter
javax.jms.JMSException - for any error
public Tx createPersistentTx()
throws javax.jms.JMSException
PersistenceManager
createPersistentTx in interface PersistenceManagerjavax.jms.JMSException - for any error
public void insertPersistentTx(PersistenceManager.TransactionManagerStrategy tms,
Connection c,
Tx tx)
throws javax.jms.JMSException
javax.jms.JMSException
public void add(MessageReference messageRef,
Tx txId)
throws javax.jms.JMSException
PersistenceManager
add in interface PersistenceManagermessageRef - the messagetxId - the transaction
javax.jms.JMSException - for any error
protected void add(Connection c,
String queue,
SpyMessage message,
Tx txId,
String mark)
throws SQLException,
IOException
SQLException
IOException
public void markMessage(Connection c,
long messageid,
String destination,
Tx txId,
String mark)
throws SQLException
SQLException
public void setBlob(PreparedStatement stmt,
int column,
SpyMessage message)
throws IOException,
SQLException
IOException
SQLException
public void setBlob(PreparedStatement stmt,
int column,
Xid xid)
throws IOException,
SQLException
IOException
SQLException
public void update(MessageReference messageRef,
Tx txId)
throws javax.jms.JMSException
PersistenceManager
update in interface PersistenceManagertxId - Description of Parameter
javax.jms.JMSException - for any error
public void remove(MessageReference messageRef,
Tx txId)
throws javax.jms.JMSException
PersistenceManager
remove in interface PersistenceManagermessageRef - the messagetxId - the transaction
javax.jms.JMSException - for any errorpublic TxManager getTxManager()
PersistenceManager
getTxManager in interface PersistenceManager
public void closeQueue(JMSDestination jmsDest,
SpyDestination dest)
throws javax.jms.JMSException
PersistenceManager
closeQueue in interface PersistenceManagerjmsDest - the jms destinationdest - the client destination
javax.jms.JMSException - for any error
public SpyMessage loadFromStorage(MessageReference messageRef)
throws javax.jms.JMSException
CacheStore
loadFromStorage in interface CacheStoremessageRef - the message reference
javax.jms.JMSException - for any error
public void removeFromStorage(MessageReference messageRef)
throws javax.jms.JMSException
CacheStore
removeFromStorage in interface CacheStoremessageRef - the message reference
javax.jms.JMSException - for any error
public void saveToStorage(MessageReference messageRef,
SpyMessage message)
throws javax.jms.JMSException
CacheStore
saveToStorage in interface CacheStoremessageRef - the message referencemessage - the message
javax.jms.JMSException - for any error
protected Connection getConnection()
throws SQLException
SQLException - if an error occurs.
public void startService()
throws Exception
startService in class org.jboss.system.ServiceMBeanSupportException
protected void initializeFields()
throws javax.management.MBeanException,
javax.management.AttributeNotFoundException,
javax.management.InstanceNotFoundException,
javax.management.ReflectionException,
NamingException
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
NamingExceptionpublic Object getInstance()
CacheStoreMBean
getInstance in interface CacheStoreMBeangetInstance in interface PersistenceManagerMBeanpublic javax.management.ObjectName getMessageCache()
PersistenceManagerMBean
getMessageCache in interface PersistenceManagerMBeanpublic void setMessageCache(javax.management.ObjectName messageCache)
PersistenceManagerMBean
setMessageCache in interface PersistenceManagerMBeanmessageCache - the object namepublic javax.management.ObjectName getConnectionManager()
public void setConnectionManager(javax.management.ObjectName connectionManagerName)
public MessageCache getMessageCacheInstance()
PersistenceManager
getMessageCacheInstance in interface PersistenceManagerpublic String getSqlProperties()
public void setSqlProperties(String value)
public void setConnectionRetryAttempts(int value)
public int getConnectionRetryAttempts()
public int getRecoveryTimeout()
public void setRecoveryTimeout(int timeout)
public int getRecoveryRetries()
public void setRecoveryRetries(int retries)
public int getRecoverMessagesChunk()
public void setRecoverMessagesChunk(int recoverMessagesChunk)
public boolean isXARecovery()
public void setXARecovery(boolean xaRecovery)
public int getStatementRetries()
public void setStatementRetries(int statementRetries)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||