net.jinx.db
Class LockingXMLHierarchy

java.lang.Object
  extended by net.jinx.db.Hierarchy
      extended by net.jinx.db.SimpleHierarchy
          extended by net.jinx.db.MemoryHierarchy
              extended by net.jinx.db.XMLHierarchy
                  extended by net.jinx.db.LockingXMLHierarchy
All Implemented Interfaces:
java.io.Serializable

public class LockingXMLHierarchy
extends XMLHierarchy

Extension of XMLHierarchy that creates an additional file and then locks it so that any JVM trying to access the files via the same configuration will fail.
Note: This class uses adds a shutdown hook in it's static initializer. It uses this to clean up it's lock files. However, this isn't really all that critical, so if it cannot be added and the JVM exits suddenly, it will leave them behind. They're harmless, empty files and can be deleted. NOTE: Instances of this class cannot be serialized, unlike the super-classes.

API Stability: Alpha.

See Also:
Serialized Form

Constructor Summary
LockingXMLHierarchy(java.io.File xf)
           
LockingXMLHierarchy(java.io.File xf, java.io.File lf)
           
LockingXMLHierarchy(java.io.File xf, java.io.File lf, java.io.File lockFile)
           
LockingXMLHierarchy(java.lang.String xf)
           
LockingXMLHierarchy(java.lang.String xf, java.lang.String lf)
           
LockingXMLHierarchy(java.lang.String xf, java.lang.String lf, java.lang.String lockFile)
           
 
Method Summary
 void close()
          Closes this XMLHierarchy.
protected  void finalize()
           
static boolean isLocked(java.io.File f)
           
 
Methods inherited from class net.jinx.db.XMLHierarchy
commit, main
 
Methods inherited from class net.jinx.db.MemoryHierarchy
getLog, rollback
 
Methods inherited from class net.jinx.db.SimpleHierarchy
attributes, clearAttributes, clearNodes, createNode, deleteNode, getAttributeObject, getNode, hasAttribute, nodes, removeAttribute, setAttributeObject
 
Methods inherited from class net.jinx.db.Hierarchy
addListener, clear, copyTo, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, parseFromProperties, parseFromXML, propertyChanged, removeListener, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, storeToProperties, storeToXML
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockingXMLHierarchy

public LockingXMLHierarchy(java.lang.String xf)

LockingXMLHierarchy

public LockingXMLHierarchy(java.lang.String xf,
                           java.lang.String lf)

LockingXMLHierarchy

public LockingXMLHierarchy(java.lang.String xf,
                           java.lang.String lf,
                           java.lang.String lockFile)

LockingXMLHierarchy

public LockingXMLHierarchy(java.io.File xf)

LockingXMLHierarchy

public LockingXMLHierarchy(java.io.File xf,
                           java.io.File lf)

LockingXMLHierarchy

public LockingXMLHierarchy(java.io.File xf,
                           java.io.File lf,
                           java.io.File lockFile)
Method Detail

finalize

protected void finalize()
                 throws java.io.IOException
Overrides:
finalize in class java.lang.Object
Throws:
java.io.IOException

close

public void close()
Description copied from class: XMLHierarchy
Closes this XMLHierarchy. Further commits will only commit to the in-memeory commit/rollback log.

Overrides:
close in class XMLHierarchy

isLocked

public static boolean isLocked(java.io.File f)