org.apache.activemq.kaha.impl.async
Class ControlFile

java.lang.Object
  extended by 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.


Constructor Summary
ControlFile(File file, int recordSize)
           
 
Method Summary
 void dispose()
           
 boolean isDisposed()
           
 ByteSequence load()
           
 void lock()
          Locks the control file.
 void store(ByteSequence data, boolean sync)
           
 void unlock()
          Un locks the control file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlFile

public ControlFile(File file,
                   int recordSize)
            throws IOException
Throws:
IOException
Method Detail

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-2013 The Apache Software Foundation. All Rights Reserved.