|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.mq.pm.jdbc3.PersistenceManager
This class manages all persistence related services for JDBC based persistence.
| 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()
Create a new persistence manager |
|
| Method Summary | |
void |
add(MessageReference (src) messageRef,
Tx (src) txId)
Add a message to the persistent store. |
protected void |
addMessage(java.sql.Connection c,
java.lang.String queue,
SpyMessage (src) message,
Tx (src) txId,
java.lang.String mark,
java.lang.String lateClone)
Add a message |
void |
addMessage(SpyMessage (src) message)
Persist the message |
protected void |
addReference(java.sql.Connection c,
java.lang.String queue,
MessageReference (src) message,
Tx (src) txId,
java.lang.String mark)
Add a reference |
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. |
protected SpyMessage (src) |
extractMessage(java.sql.ResultSet rs,
int column)
Extract a message from a result |
protected java.sql.Connection |
getConnection()
Gets a connection from the datasource, retrying as needed. |
ObjectName (src) |
getConnectionManager()
Retrieve the connection manager object name |
int |
getConnectionRetryAttempts()
Gets the ConnectionRetryAttempts. |
int |
getGCPeriodSecs()
Set the garbage collection period |
java.lang.Object |
getInstance()
|
ObjectName (src) |
getMessageCache()
Unsupported operation |
MessageCache (src) |
getMessageCacheInstance()
Unsupported operation |
java.lang.String |
getSqlProperties()
Gets the sqlProperties. |
TxManager (src) |
getTxManager()
Get a transaction manager. |
SpyMessage (src) |
loadFromStorage(MessageReference (src) messageRef)
Reads the message refered to by the MessagReference back as a SpyMessage |
void |
remove(MessageReference (src) messageRef,
Tx (src) txId)
Remove message from the persistent store. |
void |
removeFromStorage(MessageReference (src) messageRef)
Removes the message that was stored in secondary storage. |
protected void |
removeMarkedMessages(java.sql.Connection c,
Tx (src) txid,
java.lang.String mark)
Remove messages for a given transaction and mark |
protected void |
removeMarkedReferences(java.sql.Connection c,
Tx (src) txid,
java.lang.String mark)
Remove references for a given transaction and mark |
protected void |
removeTXRecord(java.sql.Connection c,
long txid)
Remove a transaction record |
protected void |
resolveAllUncommitedTXs()
Resolve uncommitted transactions |
void |
restoreQueue(JMSDestination (src) jmsDest,
SpyDestination (src) dest)
Restore a queue. |
void |
rollbackPersistentTx(Tx (src) txId)
Rollback the transaction. |
void |
run()
|
void |
saveToStorage(MessageReference (src) messageRef,
SpyMessage (src) message)
Stores the given message to secondary storeage. |
protected void |
setBlob(java.sql.PreparedStatement stmt,
int column,
SpyMessage (src) message)
Store the message in a blob |
void |
setConnectionManager(ObjectName (src) 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(ObjectName (src) messageCache)
Unsupported operation |
void |
setSqlProperties(java.lang.String value)
Sets the sqlProperties. |
protected void |
startService()
Sub-classes should override this method to provide custum 'start' logic. |
protected void |
stopService()
Sub-classes should override this method to provide custum 'stop' logic. |
void |
update(MessageReference (src) messageRef,
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 |
| 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 |
public PersistenceManager()
throws JMSException (src)
JMSException (src) - for any error| Method Detail |
public ObjectName (src) getConnectionManager()
public void setConnectionManager(ObjectName (src) connectionManagerName)
public int getGCPeriodSecs()
public void setGCPeriodSecs(int gcPeriodSecs)
public int getConnectionRetryAttempts()
public void setConnectionRetryAttempts(int value)
value - the number of retry attemptspublic java.lang.String getSqlProperties()
public void setSqlProperties(java.lang.String value)
public Tx (src) createPersistentTx()
throws JMSException (src)
PersistenceManager (src)
createPersistentTx in interface PersistenceManager (src) JMSException (src) - for any error
public void commitPersistentTx(Tx (src) txId)
throws JMSException (src)
PersistenceManager (src)
commitPersistentTx in interface PersistenceManager (src) txId - Description of Parameter
JMSException (src) - for any error
public void rollbackPersistentTx(Tx (src) txId)
throws JMSException (src)
PersistenceManager (src)
rollbackPersistentTx in interface PersistenceManager (src) txId - Description of Parameter
JMSException (src) - for any error
public void add(MessageReference (src) messageRef,
Tx (src) txId)
throws JMSException (src)
PersistenceManager (src)
add in interface PersistenceManager (src) messageRef - the messagetxId - the transaction
JMSException (src) - for any error
public void update(MessageReference (src) messageRef,
Tx (src) txId)
throws JMSException (src)
PersistenceManager (src)
update in interface PersistenceManager (src) messageRef - txId - Description of Parameter
JMSException (src) - for any error
public void remove(MessageReference (src) messageRef,
Tx (src) txId)
throws JMSException (src)
PersistenceManager (src)
remove in interface PersistenceManager (src) messageRef - the messagetxId - the transaction
JMSException (src) - for any error
public void restoreQueue(JMSDestination (src) jmsDest,
SpyDestination (src) dest)
throws JMSException (src)
PersistenceManager (src)
restoreQueue in interface PersistenceManager (src) jmsDest - the jms destinationdest - the client destination
JMSException (src) - for any errorpublic TxManager (src) getTxManager()
PersistenceManager (src)
getTxManager in interface PersistenceManager (src)
public void closeQueue(JMSDestination (src) jmsDest,
SpyDestination (src) dest)
throws JMSException (src)
PersistenceManager (src)
closeQueue in interface PersistenceManager (src) jmsDest - the jms destinationdest - the client destination
JMSException (src) - for any errorpublic MessageCache (src) getMessageCacheInstance()
getMessageCacheInstance in interface PersistenceManager (src)
public void addMessage(SpyMessage (src) message)
throws JMSException (src)
NewPersistenceManager (src)
addMessage in interface NewPersistenceManager (src) message - the message to persist
JMSException (src) - for any errorpublic java.lang.Object getInstance()
public ObjectName (src) getMessageCache()
public void setMessageCache(ObjectName (src) messageCache)
public SpyMessage (src) loadFromStorage(MessageReference (src) messageRef)
throws JMSException (src)
CacheStore (src)
loadFromStorage in interface CacheStore (src) messageRef - the message reference
JMSException (src) - for any error
public void removeFromStorage(MessageReference (src) messageRef)
throws JMSException (src)
CacheStore (src)
removeFromStorage in interface CacheStore (src) messageRef - the message reference
JMSException (src) - for any error
public void saveToStorage(MessageReference (src) messageRef,
SpyMessage (src) message)
throws JMSException (src)
CacheStore (src)
saveToStorage in interface CacheStore (src) messageRef - the message referencemessage - the message
JMSException (src) - for any errorpublic void run()
run in interface java.lang.Runnable
protected void startService()
throws java.lang.Exception
ServiceMBeanSupport (src) This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
startService in class ServiceMBeanSupport (src) java.lang.Exception
protected void stopService()
throws java.lang.Exception
ServiceMBeanSupport (src) This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
stopService in class ServiceMBeanSupport (src) java.lang.Exception
protected void resolveAllUncommitedTXs()
throws JMSException (src)
JMSException (src) - for any error
protected void removeTXRecord(java.sql.Connection c,
long txid)
throws java.sql.SQLException
c - the connectiontxid - the transaction
java.sql.SQLException - for any error
protected void addMessage(java.sql.Connection c,
java.lang.String queue,
SpyMessage (src) message,
Tx (src) txId,
java.lang.String mark,
java.lang.String lateClone)
throws java.sql.SQLException,
java.io.IOException
c - the connectionqueue - the queue namemessage - the messagemark - the mark to set for the message
java.sql.SQLException - for an error in the db
java.io.IOException - for an error serializing the message
protected void addReference(java.sql.Connection c,
java.lang.String queue,
MessageReference (src) message,
Tx (src) txId,
java.lang.String mark)
throws java.sql.SQLException,
java.io.IOException
c - the connectionqueue - the queue namemessage - the referencemark - the mark to set for the message
java.sql.SQLException - for an error in the db
java.io.IOException - for an error serializing the message
protected void removeMarkedMessages(java.sql.Connection c,
Tx (src) txid,
java.lang.String mark)
throws java.sql.SQLException
c - the connectiontxid - the transaction idmark - the mark
java.sql.SQLException - for any error
protected void removeMarkedReferences(java.sql.Connection c,
Tx (src) txid,
java.lang.String mark)
throws java.sql.SQLException
c - the connectiontxid - the transaction idmark - the mark
java.sql.SQLException - for any error
protected void setBlob(java.sql.PreparedStatement stmt,
int column,
SpyMessage (src) message)
throws java.io.IOException,
java.sql.SQLException
stmt - the prepared statementcolumn - the column in the prepared statementmessage - the message
java.io.IOException
java.sql.SQLException
protected SpyMessage (src) extractMessage(java.sql.ResultSet rs,
int column)
throws java.sql.SQLException,
java.io.IOException
rs - the result setcolumn - the column number
java.sql.SQLException - for an error accessing the db
java.io.IOException - for an error extracting the message
protected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||