Interface CustomFailurePolicy<K,V>


public interface CustomFailurePolicy<K,V>
Used for implementing custom policies in case of communication failures with a remote site. The handle methods are allowed to throw instances of BackupFailureException to signal that they want the intra-site operation to fail as well. If handle methods don't throw any exception then the operation will succeed in the local cluster. For convenience, there is a support implementation of this class: AbstractCustomFailurePolicy

Lifecycle: the same instance is invoked during the lifecycle of a cache so it is allowed to hold state between invocations.

Threadsafety: instances of this class might be invoked from different threads and they should be synchronized.

Since:
5.2
Author:
Mircea Markus
See Also:
  • BackupFailureException
  • Method Details

    • init

      void init(Cache<K,V> cache)
      Invoked during the initialization phase.
    • handlePutFailure

      void handlePutFailure(String site, K key, V value, boolean putIfAbsent)
    • handleRemoveFailure

      void handleRemoveFailure(String site, K key, V oldValue)
    • handleReplaceFailure

      void handleReplaceFailure(String site, K key, V oldValue, V newValue)
    • handleComputeFailure

      default void handleComputeFailure(String site, K key, BiFunction<? super K,? super V,? extends V> remappingFunction, boolean computeIfPresent)
    • handleComputeIfAbsentFailure

      default void handleComputeIfAbsentFailure(String site, K key, Function<? super K,? extends V> mappingFunction)
    • handleReadWriteKeyFailure

      default void handleReadWriteKeyFailure(String site, K key)
    • handleReadWriteKeyValueFailure

      default void handleReadWriteKeyValueFailure(String site, K key)
    • handleWriteOnlyKeyFailure

      default void handleWriteOnlyKeyFailure(String site, K key)
    • handleWriteOnlyKeyValueFailure

      default void handleWriteOnlyKeyValueFailure(String site, K key)
    • handleReadWriteManyFailure

      default void handleReadWriteManyFailure(String site, Collection<? extends K> keys)
    • handleReadWriteManyEntriesFailure

      default void handleReadWriteManyEntriesFailure(String site, Map<? extends K,? extends V> keys)
    • handleWriteOnlyManyFailure

      default void handleWriteOnlyManyFailure(String site, Collection<? extends K> key)
    • handleWriteOnlyManyEntriesFailure

      default void handleWriteOnlyManyEntriesFailure(String site, Map<? extends K,? extends V> key)
    • handleClearFailure

      void handleClearFailure(String site)
    • handlePutAllFailure

      void handlePutAllFailure(String site, Map<K,V> map)
    • handlePrepareFailure

      void handlePrepareFailure(String site, javax.transaction.Transaction transaction)
    • handleRollbackFailure

      void handleRollbackFailure(String site, javax.transaction.Transaction transaction)
    • handleCommitFailure

      void handleCommitFailure(String site, javax.transaction.Transaction transaction)