org.jboss.messaging.core.impl
Class JDBCPersistenceManager
java.lang.Object
org.jboss.messaging.core.impl.JDBCSupport
org.jboss.messaging.core.impl.JDBCPersistenceManager
- All Implemented Interfaces:
- MessagingComponent, PersistenceManager
public class JDBCPersistenceManager
- extends JDBCSupport
- implements PersistenceManager
JDBC implementation of PersistenceManager
- Version:
- 1.1
JDBCPersistenceManager.java,v 1.1 2006/02/22 17:33:41 timfox Exp
- Author:
- Ovidiu Feodorov, Tim Fox, Adrian Brock, Juha Lindfors
Constructor Summary |
JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm,
java.util.Properties sqlProperties,
boolean createTablesOnStartup,
boolean usingBatchUpdates,
boolean usingBinaryStream,
boolean usingTrailingByte,
int maxParams,
boolean supportsBlobSelect,
boolean supportsSetNullOnBlobs)
|
JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm,
java.util.Properties sqlProperties,
boolean createTablesOnStartup,
boolean usingBatchUpdates,
boolean usingBinaryStream,
boolean usingTrailingByte,
int maxParams,
boolean supportsBlobSelect,
boolean supportsSetNullOnBlobs,
boolean detectDuplicates,
boolean useNDBFailoverStrategy,
int idCacheSize)
|
Method Summary |
protected void |
addReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps,
boolean paged)
|
void |
addReference(long channelID,
MessageReference ref,
Transaction tx)
|
void |
addTransaction(Transaction tx)
|
protected void |
addTXRecord(java.sql.Connection conn,
Transaction tx)
|
protected java.util.HashMap |
bytesToMap(byte[] bytes)
|
protected void |
cacheID(java.sql.Connection conn,
java.lang.String id)
|
protected byte[] |
getBytes(java.sql.ResultSet rs,
int columnIndex)
|
protected org.jboss.messaging.core.impl.JDBCPersistenceManager.TransactionCallback |
getCallback(Transaction tx)
|
protected java.util.Map |
getDefaultDDLStatements()
|
protected java.util.Map |
getDefaultDMLStatements()
|
java.util.List |
getMessageChannelPairAcksForTx(long transactionId)
|
java.util.List |
getMessageChannelPairRefsForTx(long transactionId)
|
java.util.List |
getMessages(java.util.List messageIds)
|
java.util.List |
getPagedReferenceInfos(long channelID,
long orderStart,
int number)
|
protected byte[] |
getVarBinaryColumn(java.sql.ResultSet rs,
int columnIndex)
|
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)
|
boolean |
idExists(java.lang.String messageID)
|
void |
injectNodeID(int nodeID)
|
PersistenceManager.InitialLoadInfo |
loadFromStart(long channelID,
int number)
|
protected void |
loadIDCache(java.util.Map<java.lang.Integer,java.lang.String> cache,
int theNodeID)
|
protected void |
logBatchUpdate(java.lang.String name,
int[] rows,
java.lang.String action)
|
protected byte[] |
mapToBytes(java.util.Map map)
|
PersistenceManager.InitialLoadInfo |
mergeAndLoad(long fromChannelID,
long toChannelID,
int numberToLoad,
long firstPagingOrder,
long nextPagingOrder)
|
void |
mergeTransactions(int fromNodeID,
int toNodeID)
|
void |
moveReference(long sourceChannelID,
long destChannelID,
MessageReference ref)
|
void |
pageReferences(long channelID,
java.util.List references,
boolean page)
|
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)
|
void |
removeDepagedReferences(long channelID,
java.util.List references)
|
protected void |
removeReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps)
|
void |
removeReference(long channelID,
MessageReference ref,
Transaction tx)
|
protected void |
removeTXRecord(java.sql.Connection conn,
Transaction tx)
|
long |
reserveIDBlock(java.lang.String counterName,
int size)
|
java.util.List |
retrievePreparedTransactions()
|
protected void |
setBytes(java.sql.PreparedStatement ps,
int columnIndex,
byte[] bytes)
|
protected void |
setVarBinaryColumn(int column,
java.sql.PreparedStatement ps,
byte[] bytes)
|
void |
start()
|
void |
stop()
|
protected void |
storeMessage(Message m,
java.sql.PreparedStatement ps,
boolean bindBlobs)
Stores the message in the MESSAGE table. |
protected int |
storeMessage(Message message,
java.sql.PreparedStatement psInsertMessage,
java.sql.PreparedStatement psUpdateMessage)
|
java.lang.String |
toString()
|
void |
updateDeliveryCount(long channelID,
MessageReference ref)
|
void |
updatePageOrder(long channelID,
java.util.List references)
|
void |
updateReferencesNotPagedInRange(long channelID,
long orderStart,
long orderEnd,
long num)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JDBCPersistenceManager
public JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm,
java.util.Properties sqlProperties,
boolean createTablesOnStartup,
boolean usingBatchUpdates,
boolean usingBinaryStream,
boolean usingTrailingByte,
int maxParams,
boolean supportsBlobSelect,
boolean supportsSetNullOnBlobs,
boolean detectDuplicates,
boolean useNDBFailoverStrategy,
int idCacheSize)
JDBCPersistenceManager
public JDBCPersistenceManager(javax.sql.DataSource ds,
TransactionManager tm,
java.util.Properties sqlProperties,
boolean createTablesOnStartup,
boolean usingBatchUpdates,
boolean usingBinaryStream,
boolean usingTrailingByte,
int maxParams,
boolean supportsBlobSelect,
boolean supportsSetNullOnBlobs)
start
public void start()
throws java.lang.Exception
- Specified by:
start
in interface MessagingComponent
- Overrides:
start
in class JDBCSupport
- Throws:
java.lang.Exception
stop
public void stop()
throws java.lang.Exception
- Specified by:
stop
in interface MessagingComponent
- Overrides:
stop
in class JDBCSupport
- Throws:
java.lang.Exception
injectNodeID
public void injectNodeID(int nodeID)
throws java.lang.Exception
- Throws:
java.lang.Exception
getMessageChannelPairRefsForTx
public java.util.List getMessageChannelPairRefsForTx(long transactionId)
throws java.lang.Exception
- Specified by:
getMessageChannelPairRefsForTx
in interface PersistenceManager
- Throws:
java.lang.Exception
getMessageChannelPairAcksForTx
public java.util.List getMessageChannelPairAcksForTx(long transactionId)
throws java.lang.Exception
- Specified by:
getMessageChannelPairAcksForTx
in interface PersistenceManager
- Throws:
java.lang.Exception
retrievePreparedTransactions
public java.util.List retrievePreparedTransactions()
throws java.lang.Exception
- Specified by:
retrievePreparedTransactions
in interface PersistenceManager
- Throws:
java.lang.Exception
reserveIDBlock
public long reserveIDBlock(java.lang.String counterName,
int size)
throws java.lang.Exception
- Specified by:
reserveIDBlock
in interface PersistenceManager
- Throws:
java.lang.Exception
getMessages
public java.util.List getMessages(java.util.List messageIds)
throws java.lang.Exception
- Specified by:
getMessages
in interface PersistenceManager
- Throws:
java.lang.Exception
pageReferences
public void pageReferences(long channelID,
java.util.List references,
boolean page)
throws java.lang.Exception
- Specified by:
pageReferences
in interface PersistenceManager
- Throws:
java.lang.Exception
removeDepagedReferences
public void removeDepagedReferences(long channelID,
java.util.List references)
throws java.lang.Exception
- Specified by:
removeDepagedReferences
in interface PersistenceManager
- Throws:
java.lang.Exception
updateReferencesNotPagedInRange
public void updateReferencesNotPagedInRange(long channelID,
long orderStart,
long orderEnd,
long num)
throws java.lang.Exception
- Specified by:
updateReferencesNotPagedInRange
in interface PersistenceManager
- Throws:
java.lang.Exception
updatePageOrder
public void updatePageOrder(long channelID,
java.util.List references)
throws java.lang.Exception
- Specified by:
updatePageOrder
in interface PersistenceManager
- Throws:
java.lang.Exception
getPagedReferenceInfos
public java.util.List getPagedReferenceInfos(long channelID,
long orderStart,
int number)
throws java.lang.Exception
- Specified by:
getPagedReferenceInfos
in interface PersistenceManager
- Throws:
java.lang.Exception
loadFromStart
public PersistenceManager.InitialLoadInfo loadFromStart(long channelID,
int number)
throws java.lang.Exception
- Specified by:
loadFromStart
in interface PersistenceManager
- Throws:
java.lang.Exception
mergeTransactions
public void mergeTransactions(int fromNodeID,
int toNodeID)
throws java.lang.Exception
- Specified by:
mergeTransactions
in interface PersistenceManager
- Throws:
java.lang.Exception
mergeAndLoad
public PersistenceManager.InitialLoadInfo mergeAndLoad(long fromChannelID,
long toChannelID,
int numberToLoad,
long firstPagingOrder,
long nextPagingOrder)
throws java.lang.Exception
- Specified by:
mergeAndLoad
in interface PersistenceManager
- Throws:
java.lang.Exception
addReference
public void addReference(long channelID,
MessageReference ref,
Transaction tx)
throws java.lang.Exception
- Specified by:
addReference
in interface PersistenceManager
- Throws:
java.lang.Exception
moveReference
public void moveReference(long sourceChannelID,
long destChannelID,
MessageReference ref)
throws java.lang.Exception
- Specified by:
moveReference
in interface PersistenceManager
- Throws:
java.lang.Exception
updateDeliveryCount
public void updateDeliveryCount(long channelID,
MessageReference ref)
throws java.lang.Exception
- Specified by:
updateDeliveryCount
in interface PersistenceManager
- Throws:
java.lang.Exception
removeReference
public void removeReference(long channelID,
MessageReference ref,
Transaction tx)
throws java.lang.Exception
- Specified by:
removeReference
in interface PersistenceManager
- Throws:
java.lang.Exception
idExists
public boolean idExists(java.lang.String messageID)
throws java.lang.Exception
- Specified by:
idExists
in interface PersistenceManager
- Throws:
java.lang.Exception
addTransaction
public void addTransaction(Transaction tx)
- Specified by:
addTransaction
in interface PersistenceManager
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
cacheID
protected void cacheID(java.sql.Connection conn,
java.lang.String id)
throws java.lang.Exception
- Throws:
java.lang.Exception
loadIDCache
protected void loadIDCache(java.util.Map<java.lang.Integer,java.lang.String> cache,
int theNodeID)
throws java.lang.Exception
- Throws:
java.lang.Exception
getCallback
protected org.jboss.messaging.core.impl.JDBCPersistenceManager.TransactionCallback getCallback(Transaction tx)
handleBeforeCommit1PC
protected void handleBeforeCommit1PC(java.util.List refsToAdd,
java.util.List refsToRemove,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
handleBeforeCommit2PC
protected void handleBeforeCommit2PC(java.util.List refsToRemove,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
handleBeforePrepare
protected void handleBeforePrepare(java.util.List refsToAdd,
java.util.List refsToRemove,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
handleBeforeRollback
protected void handleBeforeRollback(java.util.List refsToAdd,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
addTXRecord
protected void addTXRecord(java.sql.Connection conn,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
removeTXRecord
protected void removeTXRecord(java.sql.Connection conn,
Transaction tx)
throws java.lang.Exception
- Throws:
java.lang.Exception
addReference
protected void addReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps,
boolean paged)
throws java.lang.Exception
- Throws:
java.lang.Exception
removeReference
protected void removeReference(long channelID,
MessageReference ref,
java.sql.PreparedStatement ps)
throws java.lang.Exception
- Throws:
java.lang.Exception
prepareToAddReference
protected void prepareToAddReference(long channelID,
MessageReference ref,
Transaction tx,
java.sql.PreparedStatement ps)
throws java.lang.Exception
- Throws:
java.lang.Exception
prepareToRemoveReference
protected void prepareToRemoveReference(long channelID,
MessageReference ref,
Transaction tx,
java.sql.PreparedStatement ps)
throws java.lang.Exception
- Throws:
java.lang.Exception
mapToBytes
protected byte[] mapToBytes(java.util.Map map)
throws java.lang.Exception
- Throws:
java.lang.Exception
bytesToMap
protected java.util.HashMap bytesToMap(byte[] bytes)
throws java.lang.Exception
- Throws:
java.lang.Exception
storeMessage
protected void storeMessage(Message m,
java.sql.PreparedStatement ps,
boolean bindBlobs)
throws java.lang.Exception
- Stores the message in the MESSAGE table.
- Throws:
java.lang.Exception
storeMessage
protected int storeMessage(Message message,
java.sql.PreparedStatement psInsertMessage,
java.sql.PreparedStatement psUpdateMessage)
throws java.lang.Exception
- Throws:
java.lang.Exception
setVarBinaryColumn
protected void setVarBinaryColumn(int column,
java.sql.PreparedStatement ps,
byte[] bytes)
throws java.lang.Exception
- Throws:
java.lang.Exception
getVarBinaryColumn
protected byte[] getVarBinaryColumn(java.sql.ResultSet rs,
int columnIndex)
throws java.lang.Exception
- Throws:
java.lang.Exception
setBytes
protected void setBytes(java.sql.PreparedStatement ps,
int columnIndex,
byte[] bytes)
throws java.lang.Exception
- Throws:
java.lang.Exception
getBytes
protected byte[] getBytes(java.sql.ResultSet rs,
int columnIndex)
throws java.lang.Exception
- Throws:
java.lang.Exception
logBatchUpdate
protected void logBatchUpdate(java.lang.String name,
int[] rows,
java.lang.String action)
getDefaultDDLStatements
protected java.util.Map getDefaultDDLStatements()
- Overrides:
getDefaultDDLStatements
in class JDBCSupport
getDefaultDMLStatements
protected java.util.Map getDefaultDMLStatements()
- Overrides:
getDefaultDMLStatements
in class JDBCSupport
Copyright © 2006 JBoss Inc. All Rights Reserved.