|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.journal.AbstractJournal
org.apache.jackrabbit.core.journal.FileJournal
public class FileJournal
File-based journal implementation that appends journal records to a single file.
It is configured through the following properties:directory
: the directory where to keep the journal file as
well as the rotated files; this is a required property with no default valuebasename
: the basename of journal files; the default
value is DEFAULT_BASENAME
maximumSize
: the maximum size of an active journal file
before rotating it: the default value is DEFAULT_MAXSIZE
Constructor Summary | |
---|---|
FileJournal()
|
Method Summary | |
---|---|
protected void |
append(AppendRecord record,
InputStream in,
int length)
Append a record backed by a file. |
void |
close()
Close this journal. |
protected void |
doLock()
Lock the journal revision. |
protected void |
doUnlock(boolean successful)
Unlock the journal revision. |
String |
getBasename()
|
String |
getDirectory()
Bean getters |
int |
getMaximumSize()
|
protected RecordIterator |
getRecords(long startRevision)
Return an iterator over all records after the specified revision. |
protected long |
getRevision()
|
void |
init(String id,
NamespaceResolver resolver)
Initialize journal. |
void |
setBasename(String basename)
|
void |
setDirectory(String directory)
Bean setters |
void |
setMaximumSize(int maximumSize)
|
Methods inherited from class org.apache.jackrabbit.core.journal.AbstractJournal |
---|
appending, createProducer, doSync, getConsumer, getId, getNamePathResolver, getProducer, getResolver, lockAndSync, register, sync, unlock, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileJournal()
Method Detail |
---|
public void init(String id, NamespaceResolver resolver) throws JournalException
init
in interface Journal
init
in class AbstractJournal
id
- id this journal should use to write its own recordsresolver
- resolver used when reading/writing records
JournalException
- if an error occursprotected long getRevision() throws JournalException
JournalException
protected RecordIterator getRecords(long startRevision) throws JournalException
getRecords
in class AbstractJournal
startRevision
- start point (exlusive)
JournalException
- if an error occursprotected void doLock() throws JournalException
doLock
in class AbstractJournal
JournalException
- if an error occursprotected void append(AppendRecord record, InputStream in, int length) throws JournalException
append
in class AbstractJournal
record
- record to appendin
- input streamlength
- number of bytes in input stream
JournalException
- if an error occursprotected void doUnlock(boolean successful)
doUnlock
in class AbstractJournal
successful
- flag indicating whether the update process was
successfulpublic void close()
public String getDirectory()
public String getBasename()
public int getMaximumSize()
public void setDirectory(String directory)
public void setBasename(String basename)
public void setMaximumSize(int maximumSize)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |