Class 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 Detail

      • ReachabilityAtCommitHandler

        public ReachabilityAtCommitHandler​(ExecutionContext ec)
        Constructor for a reachability-at-commit handler.
        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".
        oldID - The old id that it is registered with. If this is null then we do nothing
        newID - The new id to use in place
      • execute

        public void execute()
        Method to perform the "persistence-by-reachability" at commit.