org.mule.util.journal.queue
Class AbstractQueueTransactionJournal<T,K extends JournalEntry<T>>

java.lang.Object
  extended by org.mule.util.journal.queue.AbstractQueueTransactionJournal<T,K>
Type Parameters:
T - type of transaction identifier
K - type of the actual journal entry which must extend JournalEntry
Direct Known Subclasses:
LocalTxQueueTransactionJournal, XaTxQueueTransactionJournal

public abstract class AbstractQueueTransactionJournal<T,K extends JournalEntry<T>>
extends Object

Base implementation for a queue transaction journal.


Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractQueueTransactionJournal(String logFilesDirectory, JournalEntrySerializer journalEntrySerializer)
           
 
Method Summary
 void clear()
           
 void close()
           
protected abstract  K createCheckpointJournalEntry(T txId, byte operation)
          Creates a checkpoint JournalEntry.
protected abstract  K createUpdateJournalEntry(T txId, byte operation, String queueName, Serializable serialize)
          Creates a JournalEntry for an update operation in the queue.
 com.google.common.collect.Multimap<T,K> getAllLogEntries()
           
protected  TransactionJournal<T,K> getJournal()
           
 Collection<K> getLogEntriesForTx(T txId)
           
 void logAdd(T txId, QueueStore queue, Serializable value)
           
 void logAddFirst(T txId, QueueStore queue, Serializable item)
           
 void logCommit(T txId)
           
 void logRemove(T txId, QueueStore queue, Serializable value)
           
 void logRollback(T txId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient org.apache.commons.logging.Log logger
Constructor Detail

AbstractQueueTransactionJournal

public AbstractQueueTransactionJournal(String logFilesDirectory,
                                       JournalEntrySerializer journalEntrySerializer)
Method Detail

logAdd

public void logAdd(T txId,
                   QueueStore queue,
                   Serializable value)

logAddFirst

public void logAddFirst(T txId,
                        QueueStore queue,
                        Serializable item)

logRemove

public void logRemove(T txId,
                      QueueStore queue,
                      Serializable value)

logCommit

public void logCommit(T txId)

createUpdateJournalEntry

protected abstract K createUpdateJournalEntry(T txId,
                                              byte operation,
                                              String queueName,
                                              Serializable serialize)
Creates a JournalEntry for an update operation in the queue.

Parameters:
txId - transaction identifier
operation - operation done over the queue
queueName - queueName of the queue in which the operation has been done
serialize - value of the operation
Returns:
a new JournalEntry

createCheckpointJournalEntry

protected abstract K createCheckpointJournalEntry(T txId,
                                                  byte operation)
Creates a checkpoint JournalEntry.

Parameters:
txId - transaction identifier
operation - checkpoint operation
Returns:
a new JournalEntry

logRollback

public void logRollback(T txId)

close

public void close()

clear

public void clear()

getAllLogEntries

public com.google.common.collect.Multimap<T,K> getAllLogEntries()

getLogEntriesForTx

public Collection<K> getLogEntriesForTx(T txId)

getJournal

protected TransactionJournal<T,K> getJournal()


Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.