|
||||||||||
| 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.
| Field Summary | |
|---|---|
protected Scheduler |
scheduler
|
| Constructor Summary | |
|---|---|
JournalPersistenceAdapter()
|
|
JournalPersistenceAdapter(org.apache.activeio.journal.Journal journal,
PersistenceAdapter longTermPersistence,
TaskRunnerFactory taskRunnerFactory)
|
|
| Method Summary | |
|---|---|
void |
beginTransaction(ConnectionContext context)
|
void |
checkpoint(boolean sync)
|
void |
checkpoint(boolean sync,
boolean fullCheckpoint)
When we checkpoint we move all the journalled data to long term storage. |
void |
commitTransaction(ConnectionContext context)
|
MessageStore |
createQueueMessageStore(ActiveMQQueue destination)
|
protected java.io.IOException |
createRecoveryFailedException(java.lang.Exception e)
|
TopicMessageStore |
createTopicMessageStore(ActiveMQTopic destinationName)
|
TransactionStore |
createTransactionStore()
|
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()
|
boolean |
doCheckpoint()
This does the actual checkpoint. |
java.util.Set<ActiveMQDestination> |
getDestinations()
|
java.io.File |
getDirectory()
|
long |
getLastMessageBrokerSequenceId()
|
long |
getLastProducerSequenceId(ProducerId id)
|
PersistenceAdapter |
getLongTermPersistence()
|
int |
getMaxCheckpointMessageAddSize()
|
int |
getMaxCheckpointWorkers()
|
JournalTransactionStore |
getTransactionStore()
|
SystemUsage |
getUsageManager()
|
WireFormat |
getWireFormat()
|
boolean |
isUseExternalMessageReferences()
|
void |
onUsageChanged(Usage usage,
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 |
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)
|
void |
setBrokerName(java.lang.String brokerName)
|
void |
setBrokerService(BrokerService brokerService)
|
void |
setDirectory(java.io.File dir)
|
void |
setJournal(org.apache.activeio.journal.Journal journal)
|
void |
setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
|
void |
setMaxCheckpointWorkers(int maxCheckpointWorkers)
|
void |
setPersistenceAdapter(PersistenceAdapter longTermPersistence)
|
void |
setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
|
void |
setUsageManager(SystemUsage usageManager)
|
void |
setUseExternalMessageReferences(boolean enable)
|
long |
size()
|
void |
start()
|
void |
stop()
|
ByteSequence |
toByteSequence(org.apache.activeio.packet.Packet packet)
|
org.apache.activeio.packet.Packet |
toPacket(ByteSequence sequence)
|
java.lang.String |
toString()
|
org.apache.activeio.journal.RecordLocation |
writeCommand(DataStructure command,
boolean sync)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Scheduler scheduler
| Constructor Detail |
|---|
public JournalPersistenceAdapter()
public JournalPersistenceAdapter(org.apache.activeio.journal.Journal journal,
PersistenceAdapter longTermPersistence,
TaskRunnerFactory taskRunnerFactory)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
public void setJournal(org.apache.activeio.journal.Journal journal)
public void setPersistenceAdapter(PersistenceAdapter longTermPersistence)
public void setUsageManager(SystemUsage usageManager)
setUsageManager in interface PersistenceAdapterusageManager - The UsageManager that is controlling the
destination's memory usage.public java.util.Set<ActiveMQDestination> getDestinations()
getDestinations in interface PersistenceAdapter
public MessageStore createQueueMessageStore(ActiveMQQueue destination)
throws java.io.IOException
createQueueMessageStore in interface PersistenceAdapterjava.io.IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destinationName)
throws java.io.IOException
createTopicMessageStore 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 forget
public TransactionStore createTransactionStore()
throws java.io.IOException
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
beginTransaction in interface PersistenceAdapterjava.io.IOException
public void commitTransaction(ConnectionContext context)
throws java.io.IOException
commitTransaction in interface PersistenceAdapterjava.io.IOException
public void rollbackTransaction(ConnectionContext context)
throws java.io.IOException
rollbackTransaction in interface PersistenceAdapterjava.io.IOException
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.JournalEventListenerjournal.JournalEventListener
public void checkpoint(boolean sync,
boolean fullCheckpoint)
public void checkpoint(boolean sync)
checkpoint in interface PersistenceAdapterpublic 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 onUsageChanged(Usage usage,
int oldPercentUsage,
int newPercentUsage)
onUsageChanged in interface UsageListenerpublic JournalTransactionStore getTransactionStore()
public void deleteAllMessages()
throws java.io.IOException
deleteAllMessages in interface PersistenceAdapterjava.io.IOExceptionpublic SystemUsage getUsageManager()
public int getMaxCheckpointMessageAddSize()
public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
public int getMaxCheckpointWorkers()
public void setMaxCheckpointWorkers(int maxCheckpointWorkers)
public boolean isUseExternalMessageReferences()
public void setUseExternalMessageReferences(boolean enable)
public org.apache.activeio.packet.Packet toPacket(ByteSequence sequence)
public ByteSequence toByteSequence(org.apache.activeio.packet.Packet packet)
public void setBrokerName(java.lang.String brokerName)
setBrokerName in interface PersistenceAdapterpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setDirectory(java.io.File dir)
setDirectory in interface PersistenceAdapterpublic java.io.File getDirectory()
getDirectory in interface PersistenceAdapterpublic long size()
size in interface PersistenceAdapterpublic void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic long getLastProducerSequenceId(ProducerId id)
getLastProducerSequenceId in interface PersistenceAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||