|
||||||||||
| 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.MemoryJournal
public class MemoryJournal
Memory-based journal, useful for testing purposes only.
| Nested Class Summary | |
|---|---|
class |
MemoryJournal.MemoryRecord
Memory record. |
class |
MemoryJournal.MemoryRecordIterator
Record iterator implementation. |
| Constructor Summary | |
|---|---|
MemoryJournal()
|
|
| 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. |
InstanceRevision |
getInstanceRevision()
Gets the instance that manages the cluster node's local revision. |
long |
getReadDelay()
Return the read delay in milliseconds. |
RecordIterator |
getRecords()
Return an iterator over all available records in the journal. |
RecordIterator |
getRecords(long startRevision)
Return an iterator over all records after the specified revision. |
long |
getWriteDelay()
Return the write delay in milliseconds. |
void |
init(String id,
NamespaceResolver resolver)
Initialize journal. |
void |
setReadDelay(long readDelay)
Set the read delay in milliseconds. |
void |
setRecords(List<MemoryJournal.MemoryRecord> records)
Set records. |
void |
setWriteDelay(long writeDelay)
Set the write delay in milliseconds. |
| Methods inherited from class org.apache.jackrabbit.core.journal.AbstractJournal |
|---|
appending, createProducer, doSync, getConsumer, getId, getNamePathResolver, getProducer, getRepositoryHome, getResolver, getRevision, lockAndSync, register, setRepositoryHome, setRevision, sync, unlock, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryJournal()
| Method Detail |
|---|
public InstanceRevision getInstanceRevision()
throws JournalException
JournalException - on error
public void init(String id,
NamespaceResolver resolver)
throws JournalException
init in interface Journalinit in class AbstractJournalid - id this journal should use to write its own recordsresolver - resolver used when reading/writing records
JournalException - if an error occurs
protected void doLock()
throws JournalException
doLock in class AbstractJournalJournalException - if an error occurs
protected void append(AppendRecord record,
InputStream in,
int length)
throws JournalException
append in class AbstractJournalrecord - record to appendin - input streamlength - number of bytes in input stream
JournalException - if an error occursprotected void doUnlock(boolean successful)
doUnlock in class AbstractJournalsuccessful - flag indicating whether the update process was
successful
public RecordIterator getRecords(long startRevision)
throws JournalException
startRevision - start point (exlusive)
JournalException - if an error occurs
public RecordIterator getRecords()
throws JournalException
JournalException - if an error occurspublic void setRecords(List<MemoryJournal.MemoryRecord> records)
records - array list that should back up this memory journalpublic long getReadDelay()
public void setReadDelay(long readDelay)
readDelay - read delaypublic long getWriteDelay()
public void setWriteDelay(long writeDelay)
writeDelay - write delaypublic void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||