public class MemoryPersistenceAdapter extends Object implements PersistenceAdapter, NoLocalSubscriptionAware
| Constructor and Description |
|---|
MemoryPersistenceAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
allowIOResumption() |
protected MemoryMessageStore |
asMemoryMessageStore(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
|
JobSchedulerStore |
createJobSchedulerStore()
Creates and returns a new Job Scheduler store instance.
|
MessageStore |
createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
Factory method to create a new queue message store with the given
destination name
|
TopicMessageStore |
createTopicMessageStore(org.apache.activemq.command.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.
|
Set<org.apache.activemq.command.ActiveMQDestination> |
getDestinations()
Returns a set of all the
ActiveMQDestination objects that the
persistence store is aware exist. |
File |
getDirectory() |
long |
getLastMessageBrokerSequenceId() |
long |
getLastProducerSequenceId(org.apache.activemq.command.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 |
isPersistNoLocal() |
boolean |
isUseExternalMessageReferences() |
static MemoryPersistenceAdapter |
newInstance(File file) |
void |
removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
Cleanup method to remove any state associated with the given destination
|
void |
removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
Cleanup method to remove any state associated with the given destination
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction
|
void |
setBrokerName(String brokerName)
Set the name of the broker using the adapter
|
void |
setCreateTransactionStore(boolean create) |
void |
setDirectory(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() |
String |
toString() |
public MemoryPersistenceAdapter()
public Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
PersistenceAdapterActiveMQDestination objects that the
persistence store is aware exist.getDestinations in interface PersistenceAdapterpublic static MemoryPersistenceAdapter newInstance(File file)
public MessageStore createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination) throws IOException
PersistenceAdaptercreateQueueMessageStore in interface PersistenceAdapterIOExceptionpublic TopicMessageStore createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination) throws IOException
PersistenceAdaptercreateTopicMessageStore in interface PersistenceAdapterIOExceptionpublic void removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
removeQueueMessageStore in interface PersistenceAdapterdestination - Destination to forgetpublic void removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
removeTopicMessageStore in interface PersistenceAdapterdestination - Destination to forgetpublic TransactionStore createTransactionStore() throws IOException
PersistenceAdaptercreateTransactionStore in interface PersistenceAdapterIOExceptionpublic void beginTransaction(ConnectionContext context)
PersistenceAdapterbeginTransaction in interface PersistenceAdapterpublic void commitTransaction(ConnectionContext context)
PersistenceAdaptercommitTransaction in interface PersistenceAdapterPersistenceAdapter.beginTransaction(ConnectionContext context)public void rollbackTransaction(ConnectionContext context)
PersistenceAdapterrollbackTransaction in interface PersistenceAdapterPersistenceAdapter.beginTransaction(ConnectionContext context)public void start() throws Exception
start in interface org.apache.activemq.ServiceExceptionpublic void stop() throws Exception
stop in interface org.apache.activemq.ServiceExceptionpublic long getLastMessageBrokerSequenceId() throws IOException
getLastMessageBrokerSequenceId in interface PersistenceAdapterIOExceptionpublic void deleteAllMessages() throws IOException
PersistenceAdapterdeleteAllMessages in interface PersistenceAdapterIOExceptionpublic boolean isUseExternalMessageReferences()
public void setUseExternalMessageReferences(boolean useExternalMessageReferences)
protected MemoryMessageStore asMemoryMessageStore(Object value)
public void setUsageManager(SystemUsage usageManager)
setUsageManager in interface PersistenceAdapterusageManager - The UsageManager that is controlling the broker's memory usage.public void setBrokerName(String brokerName)
PersistenceAdaptersetBrokerName in interface PersistenceAdapterpublic void setDirectory(File dir)
PersistenceAdaptersetDirectory in interface PersistenceAdapterpublic File getDirectory()
getDirectory in interface PersistenceAdapterpublic void checkpoint(boolean sync) throws IOException
PersistenceAdaptercheckpoint in interface PersistenceAdapterIOExceptionpublic long size()
PersistenceAdaptersize in interface PersistenceAdapterpublic void setCreateTransactionStore(boolean create) throws IOException
IOExceptionpublic long getLastProducerSequenceId(org.apache.activemq.command.ProducerId id)
PersistenceAdaptergetLastProducerSequenceId in interface PersistenceAdapterid - the producerId to find a sequenceId forpublic void allowIOResumption()
allowIOResumption in interface PersistenceAdapterpublic JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
PersistenceAdaptercreateJobSchedulerStore in interface PersistenceAdapterIOException - If an error occurs while creating the new JobSchedulerStore.UnsupportedOperationException - If this adapter does not provide its own
scheduler store implementation.public boolean isPersistNoLocal()
isPersistNoLocal in interface NoLocalSubscriptionAwareCopyright © 2005–2020 The Apache Software Foundation. All rights reserved.