|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectServiceMBeanSupport
org.jboss.messaging.core.plugin.JDBCPersistenceManager
JDBC implementation of PersistenceManager
Nested Class Summary |
Nested classes inherited from class org.jboss.messaging.core.plugin.contract.PersistenceManager |
PersistenceManager.ReferenceInfo |
Field Summary | |
protected java.util.Map |
channelMultipliers
|
protected ChannelMapper |
cm
|
protected ObjectName |
cmObjectName
|
protected java.lang.String |
commitMessageRef1
|
protected java.lang.String |
commitMessageRef2
|
protected java.lang.String |
createCounter
|
protected java.lang.String |
createIdxMessageRefLoaded
|
protected java.lang.String |
createIdxMessageRefMessageId
|
protected java.lang.String |
createIdxMessageRefOrd
|
protected java.lang.String |
createIdxMessageRefReliable
|
protected java.lang.String |
createIdxMessageRefTx
|
protected java.lang.String |
createMessage
|
protected java.lang.String |
createMessageReference
|
protected boolean |
createTablesOnStartup
|
protected java.lang.String |
createTransaction
|
protected java.lang.String |
dataSourceJNDIName
|
protected java.lang.String |
deleteMessage
|
protected java.lang.String |
deleteMessageRef
|
protected java.lang.String |
deleteTransaction
|
protected java.lang.String |
deleteUnreffedMessages
|
protected java.lang.String |
deleteUnreliableRefs
|
protected javax.sql.DataSource |
ds
|
protected java.lang.String |
insertCounter
|
protected java.lang.String |
insertMessage
|
protected java.lang.String |
insertMessageRef
|
protected java.lang.String |
insertTransaction
|
protected java.lang.String |
loadMessages
|
protected java.lang.String |
loadReferenceInfo
|
protected int |
maxParams
|
protected java.lang.String |
messageIdColumn
|
protected int |
minOrdering
|
protected java.lang.String |
rollbackMessageRef1
|
protected java.lang.String |
rollbackMessageRef2
|
protected java.lang.String |
selectAllChannels
|
protected java.lang.String |
selectCounter
|
protected java.lang.String |
selectCountReferences
|
protected java.lang.String |
selectMinOrdering
|
protected java.lang.String |
selectPreparedTransactions
|
protected java.util.Properties |
sqlProperties
|
protected ObjectName |
tmObjectName
|
protected java.lang.String |
updateCounter
|
protected java.lang.String |
updateDeliveryCount
|
protected java.lang.String |
updateMessageChannelCount
|
protected java.lang.String |
updateMessageRef
|
protected java.lang.String |
updateMessageRefNotLoaded
|
protected java.lang.String |
updateReliableRefs
|
protected java.lang.String |
updateReliableRefsNotLoaded
|
protected java.lang.String |
updateUnreliableChannelCount
|
protected boolean |
usingBatchUpdates
|
protected boolean |
usingBinaryStream
|
Constructor Summary | |
JDBCPersistenceManager()
|
|
JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm)
Only used for testing. |
|
JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm,
ChannelMapper cm)
Only used for testing. |
Method Summary | |
protected void |
addReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps,
boolean loaded)
|
void |
addReference(long channelID,
MessageReference ref,
Transaction tx)
|
void |
addReferences(long channelID,
java.util.List references,
boolean loaded)
|
protected void |
addTXRecord(java.sql.Connection conn,
Transaction tx)
|
protected java.util.HashMap |
bytesToMap(byte[] bytes)
|
protected void |
commitPreparedTransaction(Transaction tx,
java.sql.Connection conn)
|
protected void |
createSchema()
|
protected void |
decPersistentCounts(java.util.List refs)
|
protected byte[] |
getBytes(java.sql.ResultSet rs,
int columnIndex)
|
protected org.jboss.messaging.core.plugin.JDBCPersistenceManager.TransactionCallback |
getCallback(Transaction tx)
|
ObjectName |
getChannelMapper()
Managed attribute. |
java.lang.String |
getDataSource()
Managed attribute. |
java.lang.Object |
getInstance()
A server plugin will be always accessed via a hard reference, so it is essential that each implementation exposes this method. |
protected void |
getLocks(java.util.List refs)
|
int |
getMaxParams()
|
java.util.List |
getMessages(java.util.List messageIds)
Retrieve a List of messages corresponding to the specified List of message ids. |
long |
getMinOrdering(long channelID)
|
int |
getNumberOfUnloadedReferences(long channelID)
|
java.util.List |
getReferenceInfos(long channelID,
long minOrdering,
int number)
|
java.lang.String |
getSqlProperties()
|
ObjectName |
getTransactionManager()
Managed attribute. |
protected void |
handleBeforeCommit1PC(java.util.List refsToAdd,
java.util.List refsToRemove,
Transaction tx)
|
protected void |
handleBeforeCommit2PC(java.util.List refsToRemove,
Transaction tx)
|
protected void |
handleBeforePrepare(java.util.List refsToAdd,
java.util.List refsToRemove,
Transaction tx)
|
protected void |
handleBeforeRollback(java.util.List refsToAdd,
Transaction tx)
|
protected void |
incPersistentCounts(java.util.List refs)
|
protected void |
initSqlProperties()
|
boolean |
isCreateTablesOnStartup()
Managed attribute. |
boolean |
isUsingBatchUpdates()
Managed attribute. |
protected void |
logBatchUpdate(java.lang.String name,
int[] rows,
java.lang.String action)
|
protected byte[] |
mapToBytes(java.util.Map map)
|
protected void |
orderReferences(java.util.List references)
|
protected void |
prepareToAddReference(long channelID,
MessageReference ref,
Transaction tx,
java.sql.PreparedStatement ps)
|
protected void |
prepareToRemoveReference(long channelID,
MessageReference ref,
Transaction tx,
java.sql.PreparedStatement ps)
|
protected void |
releaseLocks(java.util.List refs)
|
protected void |
removeMessage(Message message,
java.sql.PreparedStatement ps)
Removes the message from the MESSAGE table. |
protected void |
removeReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps)
|
void |
removeReference(long channelID,
MessageReference ref,
Transaction tx)
|
void |
removeReferences(long channelID,
java.util.List references)
|
protected void |
removeTXRecord(java.sql.Connection conn,
Transaction tx)
|
protected void |
removeUnreliableMessageData()
|
long |
reserveIDBlock(java.lang.String counterName,
int size)
|
void |
resetLoadedStatus(long channelID)
|
java.util.List |
retrievePreparedTransactions()
|
protected void |
rollbackPreparedTransaction(Transaction tx,
java.sql.Connection conn)
|
protected void |
setBytes(java.sql.PreparedStatement ps,
int columnIndex,
byte[] bytes)
|
void |
setChannelMapper(ObjectName cmObjectName)
Managed attribute. |
void |
setCreateTablesOnStartup(boolean b)
Managed attribute. |
void |
setDataSource(java.lang.String dataSourceJNDIName)
Managed attribute. |
void |
setMaxParams(int maxParams)
|
void |
setSqlProperties(java.util.Properties props)
|
void |
setSqlProperties(java.lang.String value)
|
void |
setTransactionManager(ObjectName tmObjectName)
Managed attribute. |
void |
setUsingBatchUpdates(boolean b)
Managed attribute. |
protected void |
startService()
|
protected void |
stopService()
|
protected void |
storeMessage(Message m,
java.sql.PreparedStatement ps)
Stores the message in the MESSAGE table. |
java.lang.String |
toString()
|
void |
updateDeliveryCount(long channelID,
MessageReference ref)
|
protected void |
updateMessageChannelCount(Message m,
java.sql.PreparedStatement ps)
|
void |
updateReferencesNotLoaded(long channelID,
java.util.List references)
|
void |
updateReliableReferencesLoadedInRange(long channelID,
long orderStart,
long orderEnd)
|
protected int |
updateWithRetry(java.sql.PreparedStatement ps)
|
protected int[] |
updateWithRetryBatch(java.sql.PreparedStatement ps)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String createMessageReference
protected java.lang.String createIdxMessageRefTx
protected java.lang.String createIdxMessageRefOrd
protected java.lang.String createIdxMessageRefMessageId
protected java.lang.String createIdxMessageRefLoaded
protected java.lang.String createIdxMessageRefReliable
protected java.lang.String insertMessageRef
protected java.lang.String deleteMessageRef
protected java.lang.String updateMessageRef
protected java.lang.String updateDeliveryCount
protected java.lang.String updateMessageRefNotLoaded
protected java.lang.String commitMessageRef1
protected java.lang.String commitMessageRef2
protected java.lang.String rollbackMessageRef1
protected java.lang.String rollbackMessageRef2
protected java.lang.String loadReferenceInfo
protected java.lang.String selectMinOrdering
protected java.lang.String selectCountReferences
protected java.lang.String updateReliableRefs
protected java.lang.String updateReliableRefsNotLoaded
protected java.lang.String deleteUnreliableRefs
protected java.lang.String createMessage
protected java.lang.String loadMessages
protected java.lang.String insertMessage
protected java.lang.String updateMessageChannelCount
protected java.lang.String deleteMessage
protected java.lang.String messageIdColumn
protected java.lang.String updateUnreliableChannelCount
protected java.lang.String deleteUnreffedMessages
protected java.lang.String createTransaction
protected java.lang.String insertTransaction
protected java.lang.String deleteTransaction
protected java.lang.String selectPreparedTransactions
protected java.lang.String createCounter
protected java.lang.String updateCounter
protected java.lang.String selectCounter
protected java.lang.String insertCounter
protected java.lang.String selectAllChannels
protected java.lang.String dataSourceJNDIName
protected javax.sql.DataSource ds
protected ObjectName tmObjectName
protected ObjectName cmObjectName
protected ChannelMapper cm
protected java.util.Properties sqlProperties
protected boolean createTablesOnStartup
protected boolean usingBatchUpdates
protected boolean usingBinaryStream
protected int maxParams
protected int minOrdering
protected java.util.Map channelMultipliers
Constructor Detail |
public JDBCPersistenceManager() throws java.lang.Exception
public JDBCPersistenceManager(javax.sql.DataSource ds, TransactionManager tm) throws java.lang.Exception
public JDBCPersistenceManager(javax.sql.DataSource ds, TransactionManager tm, ChannelMapper cm) throws java.lang.Exception
Method Detail |
protected void startService() throws java.lang.Exception
java.lang.Exception
protected void stopService() throws java.lang.Exception
java.lang.Exception
public java.lang.Object getInstance()
ServerPlugin
getInstance
in interface ServerPlugin
public long reserveIDBlock(java.lang.String counterName, int size) throws java.lang.Exception
reserveIDBlock
in interface PersistenceManager
java.lang.Exception
public void updateReliableReferencesLoadedInRange(long channelID, long orderStart, long orderEnd) throws java.lang.Exception
updateReliableReferencesLoadedInRange
in interface PersistenceManager
java.lang.Exception
public int getNumberOfUnloadedReferences(long channelID) throws java.lang.Exception
getNumberOfUnloadedReferences
in interface PersistenceManager
java.lang.Exception
public java.util.List getMessages(java.util.List messageIds) throws java.lang.Exception
getMessages
in interface PersistenceManager
java.lang.Exception
public void addReferences(long channelID, java.util.List references, boolean loaded) throws java.lang.Exception
addReferences
in interface PersistenceManager
java.lang.Exception
public void removeReferences(long channelID, java.util.List references) throws java.lang.Exception
removeReferences
in interface PersistenceManager
java.lang.Exception
public long getMinOrdering(long channelID) throws java.lang.Exception
getMinOrdering
in interface PersistenceManager
java.lang.Exception
public java.util.List getReferenceInfos(long channelID, long minOrdering, int number) throws java.lang.Exception
getReferenceInfos
in interface PersistenceManager
java.lang.Exception
public void updateReferencesNotLoaded(long channelID, java.util.List references) throws java.lang.Exception
updateReferencesNotLoaded
in interface PersistenceManager
java.lang.Exception
public void addReference(long channelID, MessageReference ref, Transaction tx) throws java.lang.Exception
addReference
in interface PersistenceManager
java.lang.Exception
public void updateDeliveryCount(long channelID, MessageReference ref) throws java.lang.Exception
updateDeliveryCount
in interface PersistenceManager
java.lang.Exception
public void removeReference(long channelID, MessageReference ref, Transaction tx) throws java.lang.Exception
removeReference
in interface PersistenceManager
java.lang.Exception
public void resetLoadedStatus(long channelID) throws java.lang.Exception
resetLoadedStatus
in interface PersistenceManager
java.lang.Exception
public java.util.List retrievePreparedTransactions() throws java.lang.Exception
retrievePreparedTransactions
in interface PersistenceManager
java.lang.Exception
public void setDataSource(java.lang.String dataSourceJNDIName) throws java.lang.Exception
java.lang.Exception
public java.lang.String getDataSource()
public void setTransactionManager(ObjectName tmObjectName) throws java.lang.Exception
java.lang.Exception
public ObjectName getTransactionManager()
public void setChannelMapper(ObjectName cmObjectName) throws java.lang.Exception
java.lang.Exception
public ObjectName getChannelMapper()
public java.lang.String getSqlProperties()
public void setSqlProperties(java.lang.String value)
public void setSqlProperties(java.util.Properties props)
public boolean isCreateTablesOnStartup() throws java.lang.Exception
java.lang.Exception
public void setCreateTablesOnStartup(boolean b) throws java.lang.Exception
java.lang.Exception
public boolean isUsingBatchUpdates() throws java.lang.Exception
java.lang.Exception
public void setUsingBatchUpdates(boolean b) throws java.lang.Exception
java.lang.Exception
public int getMaxParams()
public void setMaxParams(int maxParams)
public java.lang.String toString()
protected void createSchema() throws java.lang.Exception
java.lang.Exception
protected void initSqlProperties()
protected org.jboss.messaging.core.plugin.JDBCPersistenceManager.TransactionCallback getCallback(Transaction tx)
protected void orderReferences(java.util.List references)
protected void removeUnreliableMessageData() throws java.lang.Exception
java.lang.Exception
protected void handleBeforeCommit1PC(java.util.List refsToAdd, java.util.List refsToRemove, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void handleBeforeCommit2PC(java.util.List refsToRemove, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void handleBeforePrepare(java.util.List refsToAdd, java.util.List refsToRemove, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void handleBeforeRollback(java.util.List refsToAdd, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void addTXRecord(java.sql.Connection conn, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void removeTXRecord(java.sql.Connection conn, Transaction tx) throws java.lang.Exception
java.lang.Exception
protected void addReference(long channelID, MessageReference ref, java.sql.PreparedStatement ps, boolean loaded) throws java.lang.Exception
java.lang.Exception
protected void removeReference(long channelID, MessageReference ref, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void prepareToAddReference(long channelID, MessageReference ref, Transaction tx, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void prepareToRemoveReference(long channelID, MessageReference ref, Transaction tx, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void commitPreparedTransaction(Transaction tx, java.sql.Connection conn) throws java.lang.Exception
java.lang.Exception
protected void rollbackPreparedTransaction(Transaction tx, java.sql.Connection conn) throws java.lang.Exception
java.lang.Exception
protected byte[] mapToBytes(java.util.Map map) throws java.lang.Exception
java.lang.Exception
protected java.util.HashMap bytesToMap(byte[] bytes) throws java.lang.Exception
java.lang.Exception
protected void updateMessageChannelCount(Message m, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void storeMessage(Message m, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void removeMessage(Message message, java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected void setBytes(java.sql.PreparedStatement ps, int columnIndex, byte[] bytes) throws java.lang.Exception
java.lang.Exception
protected byte[] getBytes(java.sql.ResultSet rs, int columnIndex) throws java.lang.Exception
java.lang.Exception
protected void getLocks(java.util.List refs)
protected void releaseLocks(java.util.List refs)
protected void incPersistentCounts(java.util.List refs)
protected void decPersistentCounts(java.util.List refs)
protected void logBatchUpdate(java.lang.String name, int[] rows, java.lang.String action)
protected int updateWithRetry(java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
protected int[] updateWithRetryBatch(java.sql.PreparedStatement ps) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |