Class SafePersistenceWrappers

java.lang.Object
com.tangosol.persistence.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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    FailureContinuationFactory encapsulates failure continuations to handle unexpected exceptions thrown by implementations of the various persistence layers.
    static class 
    SafePersistenceEnvironment is a wrapper PersistenceEnvironment implementation which protects all operations on the underlying environment (and any PersistenceManger or PersistentStore instances opened through this environment) from unexpected failures, delegating the exception handling to a failure Continuation.
    static class 
    SafePersistenceManager is a wrapper PersistenceManager implementation which protects all operations on the underlying manager (and any PersistentStore instances opened by the manager) from unexpected failures, delegating the exception handling to a failure Continuation.
    static class 
    SafePersistentStore is a wrapper PersistentStore implementation which protects all synchronous operations on the underlying store from unexpected failures, delegating the exception handling to a failure Continuation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Default failure continuation factory that provides null continuations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static <R> com.oracle.coherence.persistence.PersistenceEnvironment<R>
    unwrap(com.oracle.coherence.persistence.PersistenceEnvironment<R> env)
    Return the underlying (non-"Safe") PersistenceEnvironment.
    static <R> com.oracle.coherence.persistence.PersistenceManager<R>
    unwrap(com.oracle.coherence.persistence.PersistenceManager<R> mgr)
    Return the underlying (non-"Safe") PersistenceManager.
    static <R> com.oracle.coherence.persistence.PersistentStore<R>
    unwrap(com.oracle.coherence.persistence.PersistentStore<R> store)
    Return the underlying (non-"Safe") PersistentStore.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SafePersistenceWrappers

      public SafePersistenceWrappers()
  • Method Details

    • 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 Throwable> SafePersistenceWrappers.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