org.apache.jackrabbit.core.journal
Interface Journal

All Known Implementing Classes:
AbstractJournal, DatabaseJournal, FileJournal, JNDIDatabaseJournal, MSSqlDatabaseJournal, OracleDatabaseJournal

public interface Journal

Generic journal interface.


Method Summary
 void close()
          Close this journal.
 InstanceRevision getInstanceRevision()
          Gets the instance that manages the cluster node's local revision.
 RecordProducer getProducer(String identifier)
          Return the record producer for a given identifier.
 void init(String id, NamespaceResolver resolver)
          Initialize journal.
 void register(RecordConsumer consumer)
          Register a record consumer.
 void sync()
          Synchronize contents from journal.
 boolean unregister(RecordConsumer consumer)
          Unregister a record processor.
 

Method Detail

init

void init(String id,
          NamespaceResolver resolver)
          throws JournalException
Initialize journal.

Parameters:
id - id this journal should use to write its own records
resolver - resolver used when reading/writing records
Throws:
JournalException - if an error occurs

register

void register(RecordConsumer consumer)
              throws JournalException
Register a record consumer.

Parameters:
consumer - record consumer
Throws:
JournalException - if an error occurs

unregister

boolean unregister(RecordConsumer consumer)
Unregister a record processor.

Parameters:
consumer - record processor to unregister
Returns:
true if the consumer was previously registered; false otherwise

sync

void sync()
          throws JournalException
Synchronize contents from journal. This will compare the journal's revision with the revisions of all registered consumers and invoke their RecordConsumer.consume(org.apache.jackrabbit.core.journal.Record) method when their identifier matches the one found in the records.

Throws:
JournalException - if an error occurs

getProducer

RecordProducer getProducer(String identifier)
                           throws JournalException
Return the record producer for a given identifier.

Parameters:
identifier - identifier
Throws:
JournalException - if an error occurs

close

void close()
Close this journal. This should release any resources still held by this journal.


getInstanceRevision

InstanceRevision getInstanceRevision()
                                     throws JournalException
Gets the instance that manages the cluster node's local revision.

Returns:
the InstanceRevision manager
Throws:
JournalException - on error


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.