org.prevayler.implementation.journal
Class PersistentJournal

java.lang.Object
  extended by org.prevayler.implementation.journal.PersistentJournal
All Implemented Interfaces:
Journal

public class PersistentJournal
extends Object
implements Journal

A Journal that will write all transactions to .journal files.


Constructor Summary
PersistentJournal(PrevaylerDirectory directory, long journalSizeThresholdInBytes, long journalAgeThresholdInMillis, boolean journalDiskSync, String journalSuffix, Monitor monitor)
           
 
Method Summary
 void append(TransactionGuide guide)
           
 void close()
           
 long nextTransaction()
           
 void update(TransactionSubscriber subscriber, long initialTransactionWanted)
          IMPORTANT: This method cannot be called while the log() method is being called in another thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentJournal

public PersistentJournal(PrevaylerDirectory directory,
                         long journalSizeThresholdInBytes,
                         long journalAgeThresholdInMillis,
                         boolean journalDiskSync,
                         String journalSuffix,
                         Monitor monitor)
                  throws IOException
Parameters:
directory -
journalSizeThresholdInBytes - Size of the current journal file beyond which it is closed and a new one started. Zero indicates no size threshold. This is useful journal backup purposes.
journalAgeThresholdInMillis - Age of the current journal file beyond which it is closed and a new one started. Zero indicates no age threshold. This is useful journal backup purposes.
Throws:
IOException
Method Detail

append

public void append(TransactionGuide guide)
Specified by:
append in interface Journal

update

public void update(TransactionSubscriber subscriber,
                   long initialTransactionWanted)
            throws IOException,
                   ClassNotFoundException
IMPORTANT: This method cannot be called while the log() method is being called in another thread. If there are no journal files in the directory (when a snapshot is taken and all journal files are manually deleted, for example), the initialTransaction parameter in the first call to this method will define what the next transaction number will be. We have to find clearer/simpler semantics.

Specified by:
update in interface Journal
Throws:
IOException
ClassNotFoundException

close

public void close()
           throws IOException
Specified by:
close in interface Journal
Throws:
IOException

nextTransaction

public long nextTransaction()
Specified by:
nextTransaction in interface Journal


Copyright © 2001-2013. All Rights Reserved.