public class KahaPersistenceAdapter extends java.lang.Object implements PersistenceAdapter, BrokerServiceAware
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ConcurrentHashMap<ActiveMQDestination,MessageStore> |
messageStores |
protected java.util.concurrent.ConcurrentHashMap<ActiveMQQueue,MessageStore> |
queues |
protected java.util.concurrent.ConcurrentHashMap<ActiveMQTopic,TopicMessageStore> |
topics |
protected KahaTransactionStore |
transactionStore |
protected OpenWireFormat |
wireFormat |
| Constructor and Description |
|---|
KahaPersistenceAdapter() |
KahaPersistenceAdapter(java.util.concurrent.atomic.AtomicLong size) |
| Modifier and Type | Method and Description |
|---|---|
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
|
protected Marshaller<java.lang.Object> |
createMessageMarshaller() |
MessageStore |
createQueueMessageStore(ActiveMQQueue destination)
Factory method to create a new queue message store with the given destination name
|
protected Store |
createStore() |
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.lang.String |
getBrokerName() |
java.util.Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the
ActiveMQDestination
objects that the persistence store is aware exist. |
java.io.File |
getDirectory() |
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
|
protected ListContainer<TopicSubAck> |
getListContainer(java.lang.Object id,
java.lang.String containerName) |
protected MapContainer<MessageId,Message> |
getMapContainer(java.lang.Object id,
java.lang.String containerName) |
long |
getMaxDataFileLength() |
protected Store |
getStore() |
protected MapContainer |
getSubsMapContainer(java.lang.Object id,
java.lang.String containerName) |
boolean |
isPersistentIndex() |
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
|
protected MessageStore |
retrieveMessageStore(java.lang.Object id) |
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction
|
void |
setBrokerName(java.lang.String brokerName)
Set the name of the broker using the adapter
|
void |
setBrokerService(BrokerService brokerService) |
void |
setDirectory(java.io.File directory)
Set the directory where any data files should be created
|
void |
setMaxDataFileLength(long maxDataFileLength)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
|
void |
setPersistentIndex(boolean persistentIndex) |
void |
setUsageManager(SystemUsage usageManager) |
long |
size()
A hint to return the size of the store on disk
|
void |
start() |
void |
stop() |
java.lang.String |
toString() |
protected OpenWireFormat wireFormat
protected KahaTransactionStore transactionStore
protected java.util.concurrent.ConcurrentHashMap<ActiveMQTopic,TopicMessageStore> topics
protected java.util.concurrent.ConcurrentHashMap<ActiveMQQueue,MessageStore> queues
protected java.util.concurrent.ConcurrentHashMap<ActiveMQDestination,MessageStore> messageStores
public KahaPersistenceAdapter(java.util.concurrent.atomic.AtomicLong size)
public KahaPersistenceAdapter()
public java.util.Set<ActiveMQDestination> getDestinations()
PersistenceAdapterActiveMQDestination
objects that the persistence store is aware exist.getDestinations in interface PersistenceAdapterpublic MessageStore createQueueMessageStore(ActiveMQQueue destination) throws java.io.IOException
PersistenceAdaptercreateQueueMessageStore in interface PersistenceAdapterjava.io.IOExceptionpublic TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws java.io.IOException
PersistenceAdaptercreateTopicMessageStore in interface PersistenceAdapterjava.io.IOExceptionpublic void removeQueueMessageStore(ActiveMQQueue destination)
removeQueueMessageStore in interface PersistenceAdapterdestination - Destination to forgetpublic void removeTopicMessageStore(ActiveMQTopic destination)
removeTopicMessageStore in interface PersistenceAdapterdestination - Destination to forgetprotected MessageStore retrieveMessageStore(java.lang.Object id)
public TransactionStore createTransactionStore() throws java.io.IOException
PersistenceAdaptercreateTransactionStore in interface PersistenceAdapterjava.io.IOExceptionpublic void beginTransaction(ConnectionContext context)
PersistenceAdapterbeginTransaction in interface PersistenceAdapterpublic void commitTransaction(ConnectionContext context) throws java.io.IOException
PersistenceAdaptercommitTransaction in interface PersistenceAdapterjava.io.IOExceptionPersistenceAdapter.beginTransaction(ConnectionContext context)public void rollbackTransaction(ConnectionContext context)
PersistenceAdapterrollbackTransaction in interface PersistenceAdapterPersistenceAdapter.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 PersistenceAdapterjava.io.IOExceptionpublic void deleteAllMessages() throws java.io.IOException
PersistenceAdapterdeleteAllMessages in interface PersistenceAdapterjava.io.IOExceptionprotected MapContainer<MessageId,Message> getMapContainer(java.lang.Object id, java.lang.String containerName) throws java.io.IOException
java.io.IOExceptionprotected MapContainer getSubsMapContainer(java.lang.Object id, java.lang.String containerName) throws java.io.IOException
java.io.IOExceptionprotected Marshaller<java.lang.Object> createMessageMarshaller()
protected ListContainer<TopicSubAck> getListContainer(java.lang.Object id, java.lang.String containerName) throws java.io.IOException
java.io.IOExceptionpublic void setUsageManager(SystemUsage usageManager)
setUsageManager in interface PersistenceAdapterusageManager - The UsageManager that is controlling the broker's
memory usage.public long getMaxDataFileLength()
public boolean isPersistentIndex()
public void setPersistentIndex(boolean persistentIndex)
public void setMaxDataFileLength(long maxDataFileLength)
protected final Store createStore() throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setBrokerName(java.lang.String brokerName)
PersistenceAdaptersetBrokerName in interface PersistenceAdapterpublic java.lang.String getBrokerName()
public java.io.File getDirectory()
getDirectory in interface PersistenceAdapterpublic void setDirectory(java.io.File directory)
PersistenceAdaptersetDirectory in interface PersistenceAdapterpublic void checkpoint(boolean sync) throws java.io.IOException
PersistenceAdaptercheckpoint in interface PersistenceAdapterjava.io.IOExceptionpublic long size()
PersistenceAdaptersize in interface PersistenceAdapterpublic void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic long getLastProducerSequenceId(ProducerId id)
PersistenceAdaptergetLastProducerSequenceId in interface PersistenceAdapterid - the producerId to find a sequenceId forCopyright © 2005-2012. All Rights Reserved.