|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.store.journal.JournalPersistenceAdapter
public class JournalPersistenceAdapter
An implementation of PersistenceAdapter
designed for
use with a Journal
and then checkpointing asynchronously
on a timeout with some other long term persistent storage.
Field Summary | |
---|---|
static String |
DEFAULT_JOURNAL_TYPE
|
static String |
HOWL_JOURNAL_TYPE
|
Constructor Summary | |
---|---|
JournalPersistenceAdapter()
|
|
JournalPersistenceAdapter(File directory,
PersistenceAdapter longTermPersistence)
|
Method Summary | |
---|---|
void |
beginTransaction()
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 optimisation. |
void |
checkpoint(boolean sync)
When we checkpoint we move all the journaled data to long term storage. |
void |
commitTransaction()
Commit a persistence transaction |
protected org.activeio.journal.Journal |
createJournal()
|
MessageStore |
createQueueMessageStore(String destinationName)
Factory method to create a new queue message store with the given destination name |
protected JMSException |
createRecoveryFailedException(Exception e)
|
TopicMessageStore |
createTopicMessageStore(String 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 JMSException |
createWriteException(Packet packet,
Exception e)
|
protected JMSException |
createWriteException(String command,
Exception e)
|
boolean |
deadLetterAlreadySent(long seq,
boolean useLocking)
Verifies if a dead letter has already been sent for a message |
long |
getCheckpointInterval()
|
ClockDaemon |
getClockDaemon()
|
File |
getDirectory()
|
Map |
getInitialDestinations()
Returns a map, indexed by String name, of all the Destination
objects active on startup. |
String |
getJournalType()
|
int |
getLogFileCount()
|
int |
getLogFileSize()
|
PersistenceAdapter |
getLongTermPersistence()
|
JournalTransactionStore |
getTransactionStore()
|
WireFormat |
getWireFormat()
|
void |
overflowNotification(org.activeio.journal.RecordLocation safeLocation)
The Journal give us a call back so that we can move old data out of the journal. |
Packet |
readPacket(org.activeio.journal.RecordLocation location)
|
void |
rollbackTransaction()
Rollback a persistence transaction |
void |
setCheckpointInterval(long checkpointInterval)
|
void |
setClockDaemon(ClockDaemon clockDaemon)
|
void |
setDirectory(File directory)
|
void |
setJournalType(String journalType)
|
void |
setLogFileCount(int logFileCount)
|
void |
setLogFileSize(int logFileSize)
|
void |
setLongTermPersistence(PersistenceAdapter longTermPersistence)
|
void |
start()
Called to start the service |
void |
stop()
Called to shutdown the service |
org.activeio.journal.RecordLocation |
writeCommand(String command,
boolean sync)
|
org.activeio.journal.RecordLocation |
writePacket(String destination,
Packet packet,
boolean sync)
|
org.activeio.journal.RecordLocation |
writePacket(String destinationName,
String subscription,
MessageIdentity messageIdentity,
boolean sync)
|
org.activeio.journal.RecordLocation |
writeTxCommand(TxCommand command,
boolean sync)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_JOURNAL_TYPE
public static final String HOWL_JOURNAL_TYPE
Constructor Detail |
---|
public JournalPersistenceAdapter()
public JournalPersistenceAdapter(File directory, PersistenceAdapter longTermPersistence) throws IOException
IOException
Method Detail |
---|
public Map getInitialDestinations()
PersistenceAdapter
Destination
objects active on startup.
getInitialDestinations
in interface PersistenceAdapter
public MessageStore createQueueMessageStore(String destinationName) throws JMSException
PersistenceAdapter
createQueueMessageStore
in interface PersistenceAdapter
JMSException
public TopicMessageStore createTopicMessageStore(String destinationName) throws JMSException
PersistenceAdapter
createTopicMessageStore
in interface PersistenceAdapter
JMSException
public TransactionStore createTransactionStore() throws JMSException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
JMSException
public void beginTransaction() throws JMSException
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
JMSException
public void commitTransaction() throws JMSException
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
JMSException
PersistenceAdapter.beginTransaction()
public void rollbackTransaction()
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
PersistenceAdapter.beginTransaction()
public void start() throws JMSException
Service
start
in interface Service
JMSException
public void stop() throws JMSException
Service
stop
in interface Service
JMSException
public PersistenceAdapter getLongTermPersistence()
public void setLongTermPersistence(PersistenceAdapter longTermPersistence)
public File getDirectory()
public void setDirectory(File directory)
directory
- The directory to set.public WireFormat getWireFormat()
public String getJournalType()
public void setJournalType(String journalType)
protected org.activeio.journal.Journal createJournal() throws IOException
IOException
public void overflowNotification(org.activeio.journal.RecordLocation safeLocation)
overflowNotification
in interface org.activeio.journal.JournalEventListener
org.activemq.journal.JournalEventListener#overflowNotification(org.activemq.journal.RecordLocation)
public void checkpoint(boolean sync)
b
- public org.activeio.journal.RecordLocation writePacket(String destination, Packet packet, boolean sync) throws JMSException
destinationName
- message
- sync
-
JMSException
public org.activeio.journal.RecordLocation writeCommand(String command, boolean sync) throws JMSException
destinationName
- message
- sync
-
JMSException
public Packet readPacket(org.activeio.journal.RecordLocation location) throws JMSException
location
-
JMSException
protected JMSException createWriteException(Packet packet, Exception e)
protected JMSException createWriteException(String command, Exception e)
protected JMSException createRecoveryFailedException(Exception e)
public ClockDaemon getClockDaemon()
public void setClockDaemon(ClockDaemon clockDaemon)
public org.activeio.journal.RecordLocation writeTxCommand(TxCommand command, boolean sync) throws XAException
xid
-
XAException
public org.activeio.journal.RecordLocation writePacket(String destinationName, String subscription, MessageIdentity messageIdentity, boolean sync) throws JMSException
destinationName
- persistentKey
- messageIdentity
- b
-
JMSException
public JournalTransactionStore getTransactionStore()
public int getLogFileCount()
public void setLogFileCount(int logFileCount)
public int getLogFileSize()
public void setLogFileSize(int logFileSize)
public boolean deadLetterAlreadySent(long seq, boolean useLocking)
deadLetterAlreadySent
in interface PersistenceAdapter
seq
- useLocking
- to prevent concurrency/dups
public long getCheckpointInterval()
public void setCheckpointInterval(long checkpointInterval)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |