Class SafePersistenceWrappers


  • public class SafePersistenceWrappers
    extends Object
    SafePersistenceWrappers provides safe wrapper implementations of persistence layer interfaces that can be used to consolidate error handling across the various persistence layers.
    Since:
    Coherence 12.1.3
    Author:
    rhl/jh 2013.07.18
    • Constructor Detail

      • SafePersistenceWrappers

        public SafePersistenceWrappers()
    • Method Detail

      • unwrap

        public static <R> com.oracle.coherence.persistence.PersistenceEnvironment<R> unwrap​(com.oracle.coherence.persistence.PersistenceEnvironment<R> env)
        Return the underlying (non-"Safe") PersistenceEnvironment.
        Type Parameters:
        R - the type of a raw, environment specific object representation
        Parameters:
        env - a PersistenceEnvironment
        Returns:
        the underlying PersistenceEnvironment implementation
      • unwrap

        public static <R> com.oracle.coherence.persistence.PersistenceManager<R> unwrap​(com.oracle.coherence.persistence.PersistenceManager<R> mgr)
        Return the underlying (non-"Safe") PersistenceManager.
        Type Parameters:
        R - the type of a raw, environment specific object representation
        Parameters:
        mgr - a PersistenceManager
        Returns:
        the underlying PersistenceManager implementation
      • unwrap

        public static <R> com.oracle.coherence.persistence.PersistentStore<R> unwrap​(com.oracle.coherence.persistence.PersistentStore<R> store)
        Return the underlying (non-"Safe") PersistentStore.
        Type Parameters:
        R - the type of a raw, environment specific object representation
        Parameters:
        store - a PersistentStore
        Returns:
        the underlying PersistentStore implementation
      • getSimpleFactory

        protected static <R,​T extends ThrowableSafePersistenceWrappers.FailureContinuationFactory<R,​T> getSimpleFactory​(Continuation<? super T> cont)
        Return a simple FailureContinuationFactory that uses the specified failure continuation to handle failures at any layer of the persistence implementation.
        Type Parameters:
        R - the type of a raw, environment specific object representation
        T - the type of a Throwable failure to protect
        Parameters:
        cont - the failure continuation
        Returns:
        a simple FailureContinuationFactory that uses a single common failure continuation