|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.store.journal.JournalPersistenceAdapter
public class JournalPersistenceAdapter
An implementation of PersistenceAdapter designed for use with a
Journal and then check pointing asynchronously on a timeout with some
other long term persistent storage.
| Constructor Summary | |
|---|---|
JournalPersistenceAdapter(org.apache.activeio.journal.Journal journal,
PersistenceAdapter longTermPersistence,
TaskRunnerFactory taskRunnerFactory)
|
|
| 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,
boolean fullCheckpoint)
When we checkpoint we move all the journalled data to long term storage. |
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 |
protected java.io.IOException |
createRecoveryFailedException(java.lang.Exception e)
|
TopicMessageStore |
createTopicMessageStore(ActiveMQTopic destinationName)
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 java.io.IOException |
createWriteException(DataStructure packet,
java.lang.Exception e)
|
protected java.io.IOException |
createWriteException(java.lang.String command,
java.lang.Exception e)
|
void |
deleteAllMessages()
Delete's all the messages in the persistent store. |
boolean |
doCheckpoint()
This does the actual checkpoint. |
java.util.Set |
getDestinations()
Returns a set of all the ActiveMQDestination
objects that the persistence store is aware exist. |
long |
getLastMessageBrokerSequenceId()
|
PersistenceAdapter |
getLongTermPersistence()
|
int |
getMaxCheckpointMessageAddSize()
|
int |
getMaxCheckpointWorkers()
|
JournalTransactionStore |
getTransactionStore()
|
UsageManager |
getUsageManager()
|
WireFormat |
getWireFormat()
|
boolean |
isUseExternalMessageReferences()
|
void |
onMemoryUseChanged(UsageManager memoryManager,
int oldPercentUsage,
int newPercentUsage)
|
void |
overflowNotification(org.apache.activeio.journal.RecordLocation safeLocation)
The Journal give us a call back so that we can move old data out of the journal. |
DataStructure |
readCommand(org.apache.activeio.journal.RecordLocation location)
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction |
void |
setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
|
void |
setMaxCheckpointWorkers(int maxCheckpointWorkers)
|
void |
setUsageManager(UsageManager usageManager)
|
void |
setUseExternalMessageReferences(boolean enable)
|
void |
start()
|
void |
stop()
|
ByteSequence |
toByteSequence(org.apache.activeio.packet.Packet packet)
|
org.apache.activeio.packet.Packet |
toPacket(ByteSequence sequence)
|
org.apache.activeio.journal.RecordLocation |
writeCommand(DataStructure command,
boolean sync)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JournalPersistenceAdapter(org.apache.activeio.journal.Journal journal,
PersistenceAdapter longTermPersistence,
TaskRunnerFactory taskRunnerFactory)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setUsageManager(UsageManager usageManager)
setUsageManager in interface PersistenceAdapterusageManager - The UsageManager that is controlling the destination's memory usage.public java.util.Set getDestinations()
PersistenceAdapterActiveMQDestination
objects that the persistence store is aware exist.
getDestinations in interface PersistenceAdapter
public MessageStore createQueueMessageStore(ActiveMQQueue destination)
throws java.io.IOException
PersistenceAdapter
createQueueMessageStore in interface PersistenceAdapterjava.io.IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destinationName)
throws java.io.IOException
PersistenceAdapter
createTopicMessageStore in interface PersistenceAdapterjava.io.IOException
public TransactionStore createTransactionStore()
throws java.io.IOException
PersistenceAdapter
createTransactionStore in interface PersistenceAdapterjava.io.IOException
public long getLastMessageBrokerSequenceId()
throws java.io.IOException
getLastMessageBrokerSequenceId in interface PersistenceAdapterjava.io.IOException
public void beginTransaction(ConnectionContext context)
throws java.io.IOException
PersistenceAdapter
beginTransaction in interface PersistenceAdapterjava.io.IOException
public void commitTransaction(ConnectionContext context)
throws java.io.IOException
PersistenceAdapter
commitTransaction in interface PersistenceAdapterjava.io.IOExceptionPersistenceAdapter#beginTransaction()
public void rollbackTransaction(ConnectionContext context)
throws java.io.IOException
PersistenceAdapter
rollbackTransaction in interface PersistenceAdapterjava.io.IOExceptionPersistenceAdapter#beginTransaction()
public void start()
throws java.lang.Exception
start in interface Servicejava.lang.Exception
public void stop()
throws java.lang.Exception
stop in interface Servicejava.lang.Exceptionpublic PersistenceAdapter getLongTermPersistence()
public WireFormat getWireFormat()
public void overflowNotification(org.apache.activeio.journal.RecordLocation safeLocation)
overflowNotification in interface org.apache.activeio.journal.JournalEventListenerorg.apache.activemq.journal.JournalEventListener#overflowNotification(org.apache.activemq.journal.RecordLocation)
public void checkpoint(boolean sync,
boolean fullCheckpoint)
stopping - b - public boolean doCheckpoint()
public DataStructure readCommand(org.apache.activeio.journal.RecordLocation location)
throws java.io.IOException
location -
java.io.IOException
protected java.io.IOException createWriteException(DataStructure packet,
java.lang.Exception e)
protected java.io.IOException createWriteException(java.lang.String command,
java.lang.Exception e)
protected java.io.IOException createRecoveryFailedException(java.lang.Exception e)
public org.apache.activeio.journal.RecordLocation writeCommand(DataStructure command,
boolean sync)
throws java.io.IOException
command - sync -
java.io.IOException
public void onMemoryUseChanged(UsageManager memoryManager,
int oldPercentUsage,
int newPercentUsage)
onMemoryUseChanged in interface UsageListenerpublic JournalTransactionStore getTransactionStore()
public void deleteAllMessages()
throws java.io.IOException
PersistenceAdapter
deleteAllMessages in interface PersistenceAdapterjava.io.IOExceptionpublic UsageManager getUsageManager()
public int getMaxCheckpointMessageAddSize()
public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
public int getMaxCheckpointWorkers()
public void setMaxCheckpointWorkers(int maxCheckpointWorkers)
public boolean isUseExternalMessageReferences()
isUseExternalMessageReferences in interface PersistenceAdapterpublic void setUseExternalMessageReferences(boolean enable)
setUseExternalMessageReferences in interface PersistenceAdapterpublic org.apache.activeio.packet.Packet toPacket(ByteSequence sequence)
public ByteSequence toByteSequence(org.apache.activeio.packet.Packet packet)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||