org.activeio.journal.active
Class ControlFile

java.lang.Object
  extended by org.activeio.journal.active.ControlFile
All Implemented Interfaces:
Disposable

public final class ControlFile
extends Object
implements Disposable

Control file holds the last known good state of the journal. 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 $

Constructor Summary
ControlFile(File fileName, int controlDataSize)
           
 
Method Summary
 void dispose()
          This method should not throw any exceptions.
 Packet getControlData()
           
 boolean load()
           
 void lock()
          Locks the control file.
 void store()
           
 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 fileName,
                   int controlDataSize)
            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

load

public boolean load()
             throws IOException
Throws:
IOException

store

public void store()
           throws IOException
Throws:
IOException

getControlData

public Packet getControlData()

dispose

public void dispose()
Description copied from interface: Disposable
This method should not throw any exceptions. Cleaning up a Disposable object should be easy of an end user therefore do not make him have to handle an Exception.

Specified by:
dispose in interface Disposable


Copyright © -2009 The ActiveIO Project. All Rights Reserved.