public class MemoryPersistenceAdapter extends java.lang.Object implements PersistenceAdapter
Constructor and Description |
---|
MemoryPersistenceAdapter() |
Modifier and Type | Method and Description |
---|---|
protected MemoryMessageStore |
asMemoryMessageStore(java.lang.Object value) |
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 |
checkpoint(boolean sync)
checkpoint any
|
void |
commitTransaction(ConnectionContext context)
Commit a persistence transaction
|
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
|
void |
deleteAllMessages()
Delete's all the messages in the persistent store.
|
java.util.Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the
ActiveMQDestination
objects that the persistence store is aware exist. |
long |
getLastMessageBrokerSequenceId() |
long |
getLastProducerSequenceId(ProducerId id)
return the last stored producer sequenceId for this producer Id
used to suppress duplicate sends on failover reconnect at the transport
when a reconnect occurs
|
boolean |
isUseExternalMessageReferences() |
static MemoryPersistenceAdapter |
newInstance(java.io.File file) |
void |
removeQueueMessageStore(ActiveMQQueue destination)
Cleanup method to remove any state associated with the given destination
|
void |
removeTopicMessageStore(ActiveMQTopic destination)
Cleanup method to remove any state associated with the given destination
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction
|
void |
setBrokerName(java.lang.String brokerName)
Set the name of the broker using the adapter
|
void |
setCreateTransactionStore(boolean create) |
void |
setDirectory(java.io.File dir)
Set the directory where any data files should be created
|
void |
setUsageManager(SystemUsage usageManager) |
void |
setUseExternalMessageReferences(boolean useExternalMessageReferences) |
long |
size()
A hint to return the size of the store on disk
|
void |
start() |
void |
stop() |
java.lang.String |
toString() |
public MemoryPersistenceAdapter()
public java.util.Set<ActiveMQDestination> getDestinations()
PersistenceAdapter
ActiveMQDestination
objects that the persistence store is aware exist.getDestinations
in interface PersistenceAdapter
public static MemoryPersistenceAdapter newInstance(java.io.File file)
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws java.io.IOException
PersistenceAdapter
createQueueMessageStore
in interface PersistenceAdapter
java.io.IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws java.io.IOException
PersistenceAdapter
createTopicMessageStore
in interface PersistenceAdapter
java.io.IOException
public void removeQueueMessageStore(ActiveMQQueue destination)
removeQueueMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic void removeTopicMessageStore(ActiveMQTopic destination)
removeTopicMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic TransactionStore createTransactionStore() throws java.io.IOException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
java.io.IOException
public void beginTransaction(ConnectionContext context)
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
public void commitTransaction(ConnectionContext context)
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void rollbackTransaction(ConnectionContext context)
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void start() throws java.lang.Exception
public void stop() throws java.lang.Exception
public long getLastMessageBrokerSequenceId() throws java.io.IOException
getLastMessageBrokerSequenceId
in interface PersistenceAdapter
java.io.IOException
public void deleteAllMessages() throws java.io.IOException
PersistenceAdapter
deleteAllMessages
in interface PersistenceAdapter
java.io.IOException
public boolean isUseExternalMessageReferences()
public void setUseExternalMessageReferences(boolean useExternalMessageReferences)
protected MemoryMessageStore asMemoryMessageStore(java.lang.Object value)
public void setUsageManager(SystemUsage usageManager)
setUsageManager
in interface PersistenceAdapter
usageManager
- The UsageManager that is controlling the broker's
memory usage.public java.lang.String toString()
toString
in class java.lang.Object
public void setBrokerName(java.lang.String brokerName)
PersistenceAdapter
setBrokerName
in interface PersistenceAdapter
public void setDirectory(java.io.File dir)
PersistenceAdapter
setDirectory
in interface PersistenceAdapter
public void checkpoint(boolean sync) throws java.io.IOException
PersistenceAdapter
checkpoint
in interface PersistenceAdapter
java.io.IOException
public long size()
PersistenceAdapter
size
in interface PersistenceAdapter
public void setCreateTransactionStore(boolean create) throws java.io.IOException
java.io.IOException
public long getLastProducerSequenceId(ProducerId id)
PersistenceAdapter
getLastProducerSequenceId
in interface PersistenceAdapter
id
- the producerId to find a sequenceId forCopyright © 2005-2012. All Rights Reserved.