|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.store.jdbc.DataSourceSupport
org.apache.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(ConnectionContext context)
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 optimization. |
void |
cleanup()
|
void |
commitTransaction(ConnectionContext context)
Commit a persistence transaction |
protected JDBCAdapter |
createAdapter()
|
protected DatabaseLocker |
createDatabaseLocker()
|
MessageStore |
createQueueMessageStore(ActiveMQQueue destination)
Factory method to create a new queue message store with the given destination name |
TopicMessageStore |
createTopicMessageStore(ActiveMQTopic destination)
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 |
protected void |
databaseLockKeepAlive()
|
void |
deleteAllMessages()
Delete's all the messages in the persistent store. |
JDBCAdapter |
getAdapter()
|
BrokerService |
getBrokerService()
|
int |
getCleanupPeriod()
|
DatabaseLocker |
getDatabaseLocker()
|
Set |
getDestinations()
Returns a set of all the ActiveMQDestination
objects that the persistence store is aware exist. |
long |
getLastMessageBrokerSequenceId()
|
edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor |
getScheduledThreadPoolExecutor()
|
Statements |
getStatements()
|
TransactionContext |
getTransactionContext()
|
TransactionContext |
getTransactionContext(ConnectionContext context)
|
WireFormat |
getWireFormat()
|
boolean |
isCreateTablesOnStartup()
|
boolean |
isUseDatabaseLock()
|
boolean |
isUseExternalMessageReferences()
|
static void |
log(String msg,
SQLException e)
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction |
void |
setAdapter(JDBCAdapter adapter)
|
void |
setBrokerService(BrokerService brokerService)
|
void |
setCleanupPeriod(int cleanupPeriod)
Sets the number of milliseconds until the database is attempted to be cleaned up for durable topics |
void |
setCreateTablesOnStartup(boolean createTablesOnStartup)
Sets whether or not tables are created on startup |
void |
setDatabaseLocker(DatabaseLocker databaseLocker)
Sets the database locker strategy to use to lock the database on startup |
void |
setScheduledThreadPoolExecutor(edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor clockDaemon)
|
void |
setStatements(Statements statements)
|
void |
setUsageManager(UsageManager usageManager)
|
void |
setUseDatabaseLock(boolean useDatabaseLock)
Sets whether or not an exclusive database lock should be used to enable JDBC Master/Slave. |
void |
setUseExternalMessageReferences(boolean useExternalMessageReferences)
|
void |
setWireFormat(WireFormat wireFormat)
|
void |
start()
|
void |
stop()
|
protected void |
stopBroker()
|
Methods inherited from class org.apache.activemq.store.jdbc.DataSourceSupport |
---|
createDataSource, getDataDirectory, getDataDirectoryFile, getDataSource, setDataDirectory, setDataDirectoryFile, setDataSource |
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 Set getDestinations()
PersistenceAdapter
ActiveMQDestination
objects that the persistence store is aware exist.
getDestinations
in interface PersistenceAdapter
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException
PersistenceAdapter
createQueueMessageStore
in interface PersistenceAdapter
IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException
PersistenceAdapter
createTopicMessageStore
in interface PersistenceAdapter
IOException
public TransactionStore createTransactionStore() throws IOException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
IOException
public long getLastMessageBrokerSequenceId() throws IOException
getLastMessageBrokerSequenceId
in interface PersistenceAdapter
IOException
public void start() throws Exception
start
in interface Service
Exception
public void stop() throws Exception
stop
in interface Service
Exception
public void cleanup()
public void setScheduledThreadPoolExecutor(edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor clockDaemon)
public edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()
public JDBCAdapter getAdapter() throws IOException
IOException
public DatabaseLocker getDatabaseLocker() throws IOException
IOException
public void setDatabaseLocker(DatabaseLocker databaseLocker)
public BrokerService getBrokerService()
public void setBrokerService(BrokerService brokerService)
setBrokerService
in interface BrokerServiceAware
protected JDBCAdapter createAdapter() throws IOException
IOException
public void setAdapter(JDBCAdapter adapter)
public WireFormat getWireFormat()
public void setWireFormat(WireFormat wireFormat)
public TransactionContext getTransactionContext(ConnectionContext context) throws IOException
IOException
public TransactionContext getTransactionContext() throws IOException
IOException
public void beginTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
IOException
public void commitTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter#beginTransaction()
public void rollbackTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter#beginTransaction()
public int getCleanupPeriod()
public void setCleanupPeriod(int cleanupPeriod)
public void deleteAllMessages() throws IOException
PersistenceAdapter
deleteAllMessages
in interface PersistenceAdapter
IOException
public boolean isUseExternalMessageReferences()
isUseExternalMessageReferences
in interface PersistenceAdapter
public void setUseExternalMessageReferences(boolean useExternalMessageReferences)
setUseExternalMessageReferences
in interface PersistenceAdapter
public boolean isCreateTablesOnStartup()
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
public boolean isUseDatabaseLock()
public void setUseDatabaseLock(boolean useDatabaseLock)
public static void log(String msg, SQLException e)
public Statements getStatements()
public void setStatements(Statements statements)
public void setUsageManager(UsageManager usageManager)
setUsageManager
in interface PersistenceAdapter
usageManager
- The UsageManager that is controlling the destination's memory usage.protected void databaseLockKeepAlive()
protected void stopBroker()
protected DatabaseLocker createDatabaseLocker() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |