|
||||||||||
| 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.jdbc3.PersistenceManager
public class PersistenceManager
This class manages all persistence related services for JDBC based persistence.
| 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()
Create a new persistence manager |
|
| Method Summary | |
|---|---|
void |
add(MessageReference messageRef,
Tx txId)
Add a message to the persistent store. |
protected void |
addMessage(Connection c,
String queue,
SpyMessage message,
Tx txId,
String mark,
String lateClone)
Add a message |
void |
addMessage(SpyMessage message)
Persist the message |
protected void |
addReference(Connection c,
String queue,
MessageReference message,
Tx txId,
String mark)
Add a reference |
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 SpyMessage |
extractMessage(ResultSet rs,
int column)
Extract a message from a result |
protected Connection |
getConnection()
Gets a connection from the datasource, retrying as needed. |
javax.management.ObjectName |
getConnectionManager()
Retrieve the connection manager object name |
int |
getConnectionRetryAttempts()
Gets the ConnectionRetryAttempts. |
int |
getGCPeriodSecs()
Set the garbage collection period |
Object |
getInstance()
Get the instance |
javax.management.ObjectName |
getMessageCache()
Unsupported operation |
MessageCache |
getMessageCacheInstance()
Unsupported operation |
String |
getSqlProperties()
Gets the sqlProperties. |
TxManager |
getTxManager()
Get a transaction manager. |
SpyMessage |
loadFromStorage(MessageReference messageRef)
Reads the message refered to by the MessagReference back as a SpyMessage |
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. |
protected void |
removeMarkedMessages(Connection c,
Tx txid,
String mark)
Remove messages for a given transaction and mark |
protected void |
removeMarkedReferences(Connection c,
Tx txid,
String mark)
Remove references for a given transaction and mark |
protected void |
removeTXRecord(Connection c,
long txid)
Remove a transaction record |
protected void |
resolveAllUncommitedTXs()
Resolve uncommitted transactions |
void |
restoreQueue(JMSDestination jmsDest,
SpyDestination dest)
Restore a queue. |
void |
rollbackPersistentTx(Tx txId)
Rollback the transaction. |
void |
run()
|
void |
saveToStorage(MessageReference messageRef,
SpyMessage message)
Stores the given message to secondary storeage. |
protected void |
setBlob(PreparedStatement stmt,
int column,
SpyMessage message)
Store the message in a blob |
void |
setConnectionManager(javax.management.ObjectName connectionManagerName)
Set the connection manager object name |
void |
setConnectionRetryAttempts(int value)
Sets the ConnectionRetryAttempts. |
void |
setGCPeriodSecs(int gcPeriodSecs)
Set the garbage collection period in seconds |
void |
setMessageCache(javax.management.ObjectName messageCache)
Unsupported operation |
void |
setSqlProperties(String value)
Sets the sqlProperties. |
protected void |
startService()
|
protected void |
stopService()
|
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 |
| 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 |
| Constructor Detail |
|---|
public PersistenceManager()
throws javax.jms.JMSException
javax.jms.JMSException - for any error| Method Detail |
|---|
public javax.management.ObjectName getConnectionManager()
public void setConnectionManager(javax.management.ObjectName connectionManagerName)
public int getGCPeriodSecs()
public void setGCPeriodSecs(int gcPeriodSecs)
public int getConnectionRetryAttempts()
public void setConnectionRetryAttempts(int value)
value - the number of retry attemptspublic String getSqlProperties()
public void setSqlProperties(String value)
sqlProperties - The sqlProperties to set
public Tx createPersistentTx()
throws javax.jms.JMSException
PersistenceManager
createPersistentTx in interface PersistenceManagerjavax.jms.JMSException - for any error
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 rollbackPersistentTx(Tx txId)
throws javax.jms.JMSException
PersistenceManager
rollbackPersistentTx in interface PersistenceManagertxId - Description of Parameter
javax.jms.JMSException - for any error
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
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 error
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 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 errorpublic MessageCache getMessageCacheInstance()
getMessageCacheInstance in interface PersistenceManager
public void addMessage(SpyMessage message)
throws javax.jms.JMSException
NewPersistenceManager
addMessage in interface NewPersistenceManagermessage - the message to persist
javax.jms.JMSException - for any errorpublic Object getInstance()
CacheStoreMBean
getInstance in interface CacheStoreMBeangetInstance in interface PersistenceManagerMBeanpublic javax.management.ObjectName getMessageCache()
getMessageCache in interface PersistenceManagerMBeanpublic void setMessageCache(javax.management.ObjectName messageCache)
setMessageCache in interface PersistenceManagerMBeanmessageCache - the object name
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 errorpublic void run()
run in interface Runnable
protected void startService()
throws Exception
startService in class org.jboss.system.ServiceMBeanSupportException
protected void stopService()
throws Exception
stopService in class org.jboss.system.ServiceMBeanSupportException
protected void resolveAllUncommitedTXs()
throws javax.jms.JMSException
javax.jms.JMSException - for any error
protected void removeTXRecord(Connection c,
long txid)
throws SQLException
c - the connectiontxid - the transaction
SQLException - for any error
protected void addMessage(Connection c,
String queue,
SpyMessage message,
Tx txId,
String mark,
String lateClone)
throws SQLException,
IOException
c - the connectionqueue - the queue namemessage - the messagetxid - the transaction idmark - the mark to set for the message
SQLException - for an error in the db
IOException - for an error serializing the message
protected void addReference(Connection c,
String queue,
MessageReference message,
Tx txId,
String mark)
throws SQLException,
IOException
c - the connectionqueue - the queue namemessage - the referencetxid - the transaction idmark - the mark to set for the message
SQLException - for an error in the db
IOException - for an error serializing the message
protected void removeMarkedMessages(Connection c,
Tx txid,
String mark)
throws SQLException
c - the connectiontxid - the transaction idmark - the mark
SQLException - for any error
protected void removeMarkedReferences(Connection c,
Tx txid,
String mark)
throws SQLException
c - the connectiontxid - the transaction idmark - the mark
SQLException - for any error
protected void setBlob(PreparedStatement stmt,
int column,
SpyMessage message)
throws IOException,
SQLException
stmt - the prepared statementcolumn - the column in the prepared statementmessage - the messageIOException - for an error serializing the messageSQLException - for an error accessing the db
IOException
SQLException
protected SpyMessage extractMessage(ResultSet rs,
int column)
throws SQLException,
IOException
rs - the result setcolumn - the column number
SQLException - for an error accessing the db
IOException - for an error extracting the message
protected Connection getConnection()
throws SQLException
SQLException - if an error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||