net.jinx.db
Class MemoryHierarchy

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

public class MemoryHierarchy
extends SimpleHierarchy

Extension of SimpleHierarchy that adds functional commit() and rollback() methods that store and retrieve data from an in-memory backup.

API Stability: Alpha.

See Also:
Serialized Form

Constructor Summary
MemoryHierarchy()
          Constructs a MemoryHierarchy object.
MemoryHierarchy(java.io.File file)
          Utility constructor to read in the contents of an XML File.
 
Method Summary
 void close()
          Does nothing.
 void commit()
          Commits changes to the commit/rollback log.
protected  Hierarchy getLog()
          Provides the Hierarchy that is used to store the commit/rollback log.
 void rollback()
          Rolls this Hierarchy back to the last committed state.
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryHierarchy

public MemoryHierarchy()
Constructs a MemoryHierarchy object.


MemoryHierarchy

public MemoryHierarchy(java.io.File file)
Utility constructor to read in the contents of an XML File. This calls commit() after the file has been successfully parsed.

Parameters:
file - the File object pointing to the file to parse.
Throws:
HierarchyException - if an error occurs while reading the file.
Method Detail

getLog

protected Hierarchy getLog()
Provides the Hierarchy that is used to store the commit/rollback log.

Returns:
the log Hierarchy.

close

public void close()
Does nothing.

Overrides:
close in class SimpleHierarchy

commit

public void commit()
Commits changes to the commit/rollback log.

Overrides:
commit in class SimpleHierarchy

rollback

public void rollback()
Rolls this Hierarchy back to the last committed state.

Overrides:
rollback in class SimpleHierarchy