org.apache.activemq.kaha.impl.async
Class ControlFile
java.lang.Object
org.apache.activemq.kaha.impl.async.ControlFile
public final class ControlFile
- extends java.lang.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.
Constructor Summary |
ControlFile(java.io.File file,
int recordSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlFile
public ControlFile(java.io.File file,
int recordSize)
throws java.io.IOException
- Throws:
java.io.IOException
lock
public void lock()
throws java.io.IOException
- Locks the control file.
- Throws:
java.io.IOException
unlock
public void unlock()
throws java.io.IOException
- Un locks the control file.
- Throws:
java.io.IOException
dispose
public void dispose()
load
public ByteSequence load()
throws java.io.IOException
- Throws:
java.io.IOException
store
public void store(ByteSequence data,
boolean sync)
throws java.io.IOException
- Throws:
java.io.IOException
isDisposed
public boolean isDisposed()
Copyright © 2005-2012. All Rights Reserved.