org.apache.ojb.otm
Interface EditingContext

All Known Implementing Classes:
ConcreteEditingContext

public interface EditingContext

The EditingContext contains and manages the set of object read/edited within the context of a transaction. Logically, this could be considered similar to a document that is being edited. During commit, all objects within this transaction that are marked as being written to (ones with a write lock) are written back to the persistent store.

Author:
Raghu Rajah

Method Summary
 Collection getAllObjectsInContext()
           
 void insert(Identity oid, Object userObject, int lock)
          Insert the given object into the EditingContext, acquiring the specified lock.
 Object lookup(Identity oid)
          Lookup object with the given oid in the Context.
 State lookupState(Identity oid)
          lookup the state of an object, given the oid, in the context
 void refresh(Identity oid, Object object)
          Rollback all changes made during this transaction to the given object.
 void remove(Identity oid)
          Remove a managed object from the management of this EditingContext.
 void setState(Identity oid, State state)
           
 

Method Detail

insert

void insert(Identity oid,
            Object userObject,
            int lock)
            throws LockingException
Insert the given object into the EditingContext, acquiring the specified lock.

Parameters:
oid - the identity of the object to be inserted
userObject - the object to insert, for user operations
lock - the lock to be acquired.
Throws:
LockingException - thrown by the Lock Manager to avoid deadlocks. The insertion could be re-attempted if the lock fails.

remove

void remove(Identity oid)
Remove a managed object from the management of this EditingContext. All edits on the object will be lost. All locks kept by this object will be released.

Parameters:
oid - the Identity of the object to be removed from this context.

lookup

Object lookup(Identity oid)
              throws LockingException
Lookup object with the given oid in the Context.

Parameters:
oid - the oid of the object to lookup
Throws:
LockingException

lookupState

State lookupState(Identity oid)
                  throws LockingException
lookup the state of an object, given the oid, in the context

Parameters:
oid -
Returns:
the state of that object in the context, null if the object is not in the context
Throws:
LockingException

setState

void setState(Identity oid,
              State state)

getAllObjectsInContext

Collection getAllObjectsInContext()

refresh

void refresh(Identity oid,
             Object object)
Rollback all changes made during this transaction to the given object.



Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.