Package org.datanucleus
Class ReachabilityAtCommitHandler
- java.lang.Object
-
- org.datanucleus.ReachabilityAtCommitHandler
-
public class ReachabilityAtCommitHandler extends Object
Handler to process "persistence-by-reachability" at commit. This is a feature of the JDO spec that is enabled by default for that API. It runs a cursory check for objects that have been pulled in to be persisted by "persistence-by-reachability" (cascading) but that are no longer needing to be persisted maybe due to the cascading origin object being deleted.
-
-
Constructor Summary
Constructors Constructor Description ReachabilityAtCommitHandler(ExecutionContext ec)
Constructor for a reachability-at-commit handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDeletedObject(Object id)
void
addEnlistedObject(Object id)
void
addFlushedNewObject(Object id)
void
addPersistedObject(Object id)
void
clear()
Method to clear the stored ids of objects involved in the reachability process.void
execute()
Method to perform the "persistence-by-reachability" at commit.boolean
isExecuting()
boolean
isObjectDeleted(Object id)
boolean
isObjectEnlisted(Object id)
boolean
isObjectFlushedNew(Object id)
boolean
isObjectPersisted(Object id)
void
swapObjectId(Object oldID, Object newID)
Method that will allow swapping of an "id", for example when an object has recently been assigned its true "id".
-
-
-
Constructor Detail
-
ReachabilityAtCommitHandler
public ReachabilityAtCommitHandler(ExecutionContext ec)
Constructor for a reachability-at-commit handler.- Parameters:
ec
- ExecutionContext that it is for
-
-
Method Detail
-
clear
public void clear()
Method to clear the stored ids of objects involved in the reachability process.
-
isExecuting
public boolean isExecuting()
-
addEnlistedObject
public void addEnlistedObject(Object id)
-
isObjectEnlisted
public boolean isObjectEnlisted(Object id)
-
addPersistedObject
public void addPersistedObject(Object id)
-
isObjectPersisted
public boolean isObjectPersisted(Object id)
-
addDeletedObject
public void addDeletedObject(Object id)
-
isObjectDeleted
public boolean isObjectDeleted(Object id)
-
addFlushedNewObject
public void addFlushedNewObject(Object id)
-
isObjectFlushedNew
public boolean isObjectFlushedNew(Object id)
-
swapObjectId
public void swapObjectId(Object oldID, Object newID)
Method that will allow swapping of an "id", for example when an object has recently been assigned its true "id".- Parameters:
oldID
- The old id that it is registered with. If this is null then we do nothingnewID
- The new id to use in place
-
execute
public void execute()
Method to perform the "persistence-by-reachability" at commit.
-
-