org.apache.jackrabbit.core.state
Class AbstractPersistenceManager

java.lang.Object
  extended byorg.apache.jackrabbit.core.state.AbstractPersistenceManager
All Implemented Interfaces:
PersistenceManager
Direct Known Subclasses:
InMemPersistenceManager, ObjectPersistenceManager, SimpleDbPersistenceManager, XMLPersistenceManager

public abstract class AbstractPersistenceManager
extends Object
implements PersistenceManager

Implementation PersistenceManager that handles some concepts.


Constructor Summary
AbstractPersistenceManager()
           
 
Method Summary
 NodeState createNew(NodeId id)
          Creates a new node state instance with the given id.
 PropertyState createNew(PropertyId id)
          Creates a new property state instance with the given id.
protected abstract  void destroy(NodeReferences refs)
          Destroy a node references object.
protected abstract  void destroy(NodeState state)
          Destroy a node state.
protected abstract  void destroy(PropertyState state)
          Destroy a property state.
 void store(ChangeLog changeLog)
          Right now, this iterates over all items in the changelog and calls the individual methods that handle single item states or node references objects.
protected abstract  void store(NodeReferences refs)
          Store a references object.
protected abstract  void store(NodeState state)
          Store a node state.
protected abstract  void store(PropertyState state)
          Store a property state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.core.state.PersistenceManager
close, exists, exists, exists, init, load, load, load
 

Constructor Detail

AbstractPersistenceManager

public AbstractPersistenceManager()
Method Detail

createNew

public NodeState createNew(NodeId id)
Creates a new node state instance with the given id.

Specified by:
createNew in interface PersistenceManager
Parameters:
id - node id
Returns:
node state instance

createNew

public PropertyState createNew(PropertyId id)
Creates a new property state instance with the given id.

Specified by:
createNew in interface PersistenceManager
Parameters:
id - property id
Returns:
property state instance

store

public void store(ChangeLog changeLog)
           throws ItemStateException
Right now, this iterates over all items in the changelog and calls the individual methods that handle single item states or node references objects. Properly implemented, this method should ensure that changes are either written completely to the underlying persistence layer, or not at all. Atomically saves the given set of changes.

Specified by:
store in interface PersistenceManager
Parameters:
changeLog - change log containing states that were changed
Throws:
ItemStateException - if the changes could not be saved

store

protected abstract void store(NodeState state)
                       throws ItemStateException
Store a node state. Subclass responsibility.

Parameters:
state - node state to store
Throws:
ItemStateException - if an error occurs

store

protected abstract void store(PropertyState state)
                       throws ItemStateException
Store a property state. Subclass responsibility.

Parameters:
state - property state to store
Throws:
ItemStateException - if an error occurs

store

protected abstract void store(NodeReferences refs)
                       throws ItemStateException
Store a references object. Subclass responsibility.

Parameters:
refs - references object to store
Throws:
ItemStateException - if an error occurs

destroy

protected abstract void destroy(NodeState state)
                         throws ItemStateException
Destroy a node state. Subclass responsibility.

Parameters:
state - node state to destroy
Throws:
ItemStateException - if an error occurs

destroy

protected abstract void destroy(PropertyState state)
                         throws ItemStateException
Destroy a property state. Subclass responsibility.

Parameters:
state - property state to destroy
Throws:
ItemStateException - if an error occurs

destroy

protected abstract void destroy(NodeReferences refs)
                         throws ItemStateException
Destroy a node references object. Subclass responsibility.

Parameters:
refs - node references object to destroy
Throws:
ItemStateException - if an error occurs


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.