org.apache.jackrabbit.core.journal
Class FileRevision

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.FileRevision
All Implemented Interfaces:
InstanceRevision

public class FileRevision
extends Object
implements InstanceRevision

Maintains a file-based revision counter with locking, assuring uniqueness.


Constructor Summary
FileRevision(File file)
          Creates a new file based revision counter.
 
Method Summary
 void close()
          Close file revision.
 long get()
          Return current counter value.
 void set(long value)
          Set current counter value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRevision

public FileRevision(File file)
             throws JournalException
Creates a new file based revision counter.

Parameters:
file - holding global counter
Throws:
JournalException - if some error occurs
Method Detail

get

public long get()
         throws JournalException
Return current counter value.

Specified by:
get in interface InstanceRevision
Returns:
counter value
Throws:
JournalException - if some error occurs

set

public void set(long value)
         throws JournalException
Set current counter value.

Specified by:
set in interface InstanceRevision
Parameters:
value - new counter value
Throws:
JournalException - if some error occurs

close

public void close()
Close file revision. Closes underlying random access file.

Specified by:
close in interface InstanceRevision


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