|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.store.kahadaptor.KahaPersistenceAdapter
public class KahaPersistenceAdapter
| Field Summary | |
|---|---|
protected ConcurrentHashMap<ActiveMQDestination,MessageStore> |
messageStores
|
protected ConcurrentHashMap<ActiveMQQueue,MessageStore> |
queues
|
protected ConcurrentHashMap<ActiveMQTopic,TopicMessageStore> |
topics
|
protected KahaTransactionStore |
transactionStore
|
protected OpenWireFormat |
wireFormat
|
| Constructor Summary | |
|---|---|
KahaPersistenceAdapter()
|
|
KahaPersistenceAdapter(AtomicLong size)
|
|
| 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 |
checkpoint(boolean sync)
checkpoint any |
void |
commitTransaction(ConnectionContext context)
Commit a persistence transaction |
protected Marshaller<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. |
String |
getBrokerName()
|
Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the ActiveMQDestination
objects that the persistence store is aware exist. |
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(Object id,
String containerName)
|
protected MapContainer<MessageId,Message> |
getMapContainer(Object id,
String containerName)
|
long |
getMaxDataFileLength()
|
protected Store |
getStore()
|
protected MapContainer |
getSubsMapContainer(Object id,
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(Object id)
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction |
void |
setBrokerName(String brokerName)
Set the name of the broker using the adapter |
void |
setBrokerService(BrokerService brokerService)
|
void |
setDirectory(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()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected OpenWireFormat wireFormat
protected KahaTransactionStore transactionStore
protected ConcurrentHashMap<ActiveMQTopic,TopicMessageStore> topics
protected ConcurrentHashMap<ActiveMQQueue,MessageStore> queues
protected ConcurrentHashMap<ActiveMQDestination,MessageStore> messageStores
| Constructor Detail |
|---|
public KahaPersistenceAdapter(AtomicLong size)
public KahaPersistenceAdapter()
| Method Detail |
|---|
public Set<ActiveMQDestination> getDestinations()
PersistenceAdapterActiveMQDestination
objects that the persistence store is aware exist.
getDestinations in interface PersistenceAdapter
public MessageStore createQueueMessageStore(ActiveMQQueue destination)
throws IOException
PersistenceAdapter
createQueueMessageStore in interface PersistenceAdapterIOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
throws IOException
PersistenceAdapter
createTopicMessageStore in interface PersistenceAdapterIOExceptionpublic void removeQueueMessageStore(ActiveMQQueue destination)
removeQueueMessageStore in interface PersistenceAdapterdestination - Destination to forgetpublic void removeTopicMessageStore(ActiveMQTopic destination)
removeTopicMessageStore in interface PersistenceAdapterdestination - Destination to forgetprotected MessageStore retrieveMessageStore(Object id)
public TransactionStore createTransactionStore()
throws IOException
PersistenceAdapter
createTransactionStore in interface PersistenceAdapterIOExceptionpublic void beginTransaction(ConnectionContext context)
PersistenceAdapter
beginTransaction in interface PersistenceAdapter
public void commitTransaction(ConnectionContext context)
throws IOException
PersistenceAdapter
commitTransaction in interface PersistenceAdapterIOExceptionPersistenceAdapter.beginTransaction(ConnectionContext context)public void rollbackTransaction(ConnectionContext context)
PersistenceAdapter
rollbackTransaction in interface PersistenceAdapterPersistenceAdapter.beginTransaction(ConnectionContext context)
public void start()
throws Exception
start in interface ServiceException
public void stop()
throws Exception
stop in interface ServiceException
public long getLastMessageBrokerSequenceId()
throws IOException
getLastMessageBrokerSequenceId in interface PersistenceAdapterIOException
public void deleteAllMessages()
throws IOException
PersistenceAdapter
deleteAllMessages in interface PersistenceAdapterIOException
protected MapContainer<MessageId,Message> getMapContainer(Object id,
String containerName)
throws IOException
IOException
protected MapContainer getSubsMapContainer(Object id,
String containerName)
throws IOException
IOExceptionprotected Marshaller<Object> createMessageMarshaller()
protected ListContainer<TopicSubAck> getListContainer(Object id,
String containerName)
throws IOException
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 getStore()
throws IOException
IOException
protected final Store createStore()
throws IOException
IOExceptionpublic String toString()
toString in class Objectpublic void setBrokerName(String brokerName)
PersistenceAdapter
setBrokerName in interface PersistenceAdapterpublic String getBrokerName()
public File getDirectory()
getDirectory in interface PersistenceAdapterpublic void setDirectory(File directory)
PersistenceAdapter
setDirectory in interface PersistenceAdapter
public void checkpoint(boolean sync)
throws IOException
PersistenceAdapter
checkpoint in interface PersistenceAdapterIOExceptionpublic long size()
PersistenceAdapter
size in interface PersistenceAdapterpublic void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic long getLastProducerSequenceId(ProducerId id)
PersistenceAdapter
getLastProducerSequenceId in interface PersistenceAdapterid - the producerId to find a sequenceId for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||