public class FileRevision extends Object implements InstanceRevision
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | closedFlag indicating whether this revision file is closed. | 
| protected RandomAccessFile | rafUnderlying random access file. | 
| protected boolean | syncFlag indicating whether to sync the file on every write. | 
| protected long | valueCached value. | 
| Constructor and Description | 
|---|
| FileRevision(File file,
            boolean sync)Creates a new file based revision counter. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Close file revision. | 
| long | get()Return current counter value. | 
| void | set(long value)Set current counter value. | 
protected final RandomAccessFile raf
protected final boolean sync
protected long value
protected boolean closed
public FileRevision(File file, boolean sync) throws JournalException
file - holding global countersync - whether to sync the file on every writeJournalException - if some error occurspublic long get()
         throws JournalException
get in interface InstanceRevisionJournalException - if some error occurspublic void set(long value)
         throws JournalException
set in interface InstanceRevisionvalue - new counter valueJournalException - if some error occurspublic void close()
close in interface InstanceRevisionCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.