org.apache.activemq.kaha.impl.async
Class ControlFile
java.lang.Object
org.apache.activemq.kaha.impl.async.ControlFile
public final class ControlFile
- extends Object
Use to reliably store fixed sized state data. It stores the state in record
that is versioned and repeated twice in the file so that a failure in the
middle of the write of the first or second record do not not result in an
unknown state.
- Version:
- $Revision: 1.1 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlFile
public ControlFile(File file,
int recordSize)
throws IOException
- Throws:
IOException
lock
public void lock()
throws IOException
- Locks the control file.
- Throws:
IOException
unlock
public void unlock()
throws IOException
- Un locks the control file.
- Throws:
IOException
dispose
public void dispose()
load
public ByteSequence load()
throws IOException
- Throws:
IOException
store
public void store(ByteSequence data,
boolean sync)
throws IOException
- Throws:
IOException
isDisposed
public boolean isDisposed()
Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.