|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemq.store.jdbc.JDBCPersistenceAdapter
public class JDBCPersistenceAdapter
A PersistenceAdapter implementation using JDBC for
persistence storage.
This persistence adapter will correctly remember prepared XA transactions,
but it will not keep track of local transaction commits so that operations
performed against the Message store are done as a single uow.
| Constructor Summary | |
|---|---|
JDBCPersistenceAdapter()
|
|
JDBCPersistenceAdapter(DataSource ds,
WireFormat wireFormat)
|
|
| Method Summary | |
|---|---|
void |
beginTransaction()
This method starts a transaction on the persistent storage - which is nothing to do with JMS or XA transactions - its purely a mechanism to perform multiple writes to a persistent store in 1 transaction as a performance optimisation. |
void |
cleanup()
|
void |
cleanupOldMessage(Connection c,
MessageIdentity messageIdentity)
|
void |
commitTransaction()
Commit a persistence transaction |
MessageStore |
createQueueMessageStore(String destinationName)
Factory method to create a new queue message store with the given destination name |
TopicMessageStore |
createTopicMessageStore(String destinationName)
Factory method to create a new topic message store with the given destination name |
TransactionStore |
createTransactionStore()
Factory method to create a new persistent prepared transaction store for XA recovery |
boolean |
deadLetterAlreadySent(long seq,
boolean useDatabaseLocking)
Ensures that no previous dead letter was already sent for this message |
String |
getAdapterClass()
|
BrokerContainer |
getBrokerContainer()
|
int |
getCleanupPeriod()
|
long |
getCleanupRepeatInterval()
|
ClockDaemon |
getClockDaemon()
|
Connection |
getConnection()
|
DataSource |
getDataSource()
|
DeadLetterPolicy |
getDeadLetterPolicy()
|
boolean |
getDeleteExpiredMessages()
|
boolean |
getDropTablesOnStartup()
|
Map |
getInitialDestinations()
Returns a map, indexed by String name, of all the Destination
objects active on startup. |
JDBCAdapter |
getJDBCAdapter()
|
String |
getTablePrefix()
|
WireFormat |
getWireFormat()
|
boolean |
isAutoCleanupExpiredMessages()
|
void |
returnConnection(Connection connection)
|
void |
rollbackTransaction()
Rollback a persistence transaction |
protected void |
sendToDeadLetter(ActiveMQMessage message)
|
void |
setAdapterClass(String adapterClass)
|
void |
setAutoCleanupExpiredMessages(boolean autoCleanupExpiredMessages)
|
void |
setBrokerContainer(BrokerContainer brokerContainer)
|
void |
setCleanupPeriod(int cleanupPeriod)
|
void |
setCleanupRepeatInterval(long cleanupRepeatInterval)
|
void |
setClockDaemon(ClockDaemon clockDaemon)
|
void |
setDataSource(DataSource dataSource)
|
void |
setDeadLetterPolicy(DeadLetterPolicy deadLetterPolicy)
|
void |
setDeleteExpiredMessages(boolean deleteExpiredMessages)
|
void |
setDropTablesOnStartup(boolean dropTablesOnStartup)
|
void |
setTablePrefix(String tablePrefix)
|
void |
setWireFormat(WireFormat wireFormat)
|
void |
start()
Called to start the service |
void |
stop()
Called to shutdown the service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCPersistenceAdapter()
public JDBCPersistenceAdapter(DataSource ds,
WireFormat wireFormat)
| Method Detail |
|---|
public Map getInitialDestinations()
PersistenceAdapterDestination
objects active on startup.
getInitialDestinations in interface PersistenceAdapter
public MessageStore createQueueMessageStore(String destinationName)
throws JMSException
PersistenceAdapter
createQueueMessageStore in interface PersistenceAdapterJMSException
public TopicMessageStore createTopicMessageStore(String destinationName)
throws JMSException
PersistenceAdapter
createTopicMessageStore in interface PersistenceAdapterJMSException
public TransactionStore createTransactionStore()
throws JMSException
PersistenceAdapter
createTransactionStore in interface PersistenceAdapterJMSException
public void beginTransaction()
throws JMSException
PersistenceAdapter
beginTransaction in interface PersistenceAdapterJMSException
public void commitTransaction()
throws JMSException
PersistenceAdapter
commitTransaction in interface PersistenceAdapterJMSExceptionPersistenceAdapter.beginTransaction()public void rollbackTransaction()
PersistenceAdapter
rollbackTransaction in interface PersistenceAdapterPersistenceAdapter.beginTransaction()
public void start()
throws JMSException
Service
start in interface ServiceJMSException
public void cleanup()
throws SQLException
SQLException
protected void sendToDeadLetter(ActiveMQMessage message)
throws JMSException
JMSException
public void cleanupOldMessage(Connection c,
MessageIdentity messageIdentity)
throws JMSException,
SQLException
JMSException
SQLException
public boolean deadLetterAlreadySent(long seq,
boolean useDatabaseLocking)
deadLetterAlreadySent in interface PersistenceAdapteruseDatabaseLocking - to prevent concurrency/dups
public void setClockDaemon(ClockDaemon clockDaemon)
public ClockDaemon getClockDaemon()
public void stop()
throws JMSException
Service
stop in interface ServiceJMSExceptionpublic BrokerContainer getBrokerContainer()
public void setBrokerContainer(BrokerContainer brokerContainer)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public WireFormat getWireFormat()
public void setWireFormat(WireFormat wireFormat)
public Connection getConnection()
throws SQLException
SQLExceptionpublic void returnConnection(Connection connection)
public String getAdapterClass()
public void setAdapterClass(String adapterClass)
adapterClass - The adapterClass to set.public JDBCAdapter getJDBCAdapter()
public boolean getDropTablesOnStartup()
public void setDropTablesOnStartup(boolean dropTablesOnStartup)
dropTablesOnStartup - The dropTablesOnStartup to set.public DeadLetterPolicy getDeadLetterPolicy()
public void setDeadLetterPolicy(DeadLetterPolicy deadLetterPolicy)
public boolean getDeleteExpiredMessages()
public void setDeleteExpiredMessages(boolean deleteExpiredMessages)
public boolean isAutoCleanupExpiredMessages()
public void setAutoCleanupExpiredMessages(boolean autoCleanupExpiredMessages)
autoCleanupExpiredMessages - The autoCleanupExpiredMessages to set.public long getCleanupRepeatInterval()
public void setCleanupRepeatInterval(long cleanupRepeatInterval)
cleanupRepeatInterval - The cleanupRepeatInterval to set.public int getCleanupPeriod()
public void setCleanupPeriod(int cleanupPeriod)
public String getTablePrefix()
public void setTablePrefix(String tablePrefix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||