Interface CustomFailurePolicy<K,​V>

  • All Known Implementing Classes:

    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.

    Mircea Markus
    See Also:
    • Method Detail

      • init

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

        void handlePutFailure​(java.lang.String site,
                              K key,
                              V value,
                              boolean putIfAbsent)
      • handleRemoveFailure

        void handleRemoveFailure​(java.lang.String site,
                                 K key,
                                 V oldValue)
      • handleReplaceFailure

        void handleReplaceFailure​(java.lang.String site,
                                  K key,
                                  V oldValue,
                                  V newValue)
      • handleComputeFailure

        default void handleComputeFailure​(java.lang.String site,
                                          K key,
                                          java.util.function.BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                          boolean computeIfPresent)
      • handleComputeIfAbsentFailure

        default void handleComputeIfAbsentFailure​(java.lang.String site,
                                                  K key,
                                                  java.util.function.Function<? super K,​? extends V> mappingFunction)
      • handleReadWriteKeyFailure

        default void handleReadWriteKeyFailure​(java.lang.String site,
                                               K key)
      • handleReadWriteKeyValueFailure

        default void handleReadWriteKeyValueFailure​(java.lang.String site,
                                                    K key)
      • handleWriteOnlyKeyFailure

        default void handleWriteOnlyKeyFailure​(java.lang.String site,
                                               K key)
      • handleWriteOnlyKeyValueFailure

        default void handleWriteOnlyKeyValueFailure​(java.lang.String site,
                                                    K key)
      • handleReadWriteManyFailure

        default void handleReadWriteManyFailure​(java.lang.String site,
                                                java.util.Collection<? extends K> keys)
      • handleReadWriteManyEntriesFailure

        default void handleReadWriteManyEntriesFailure​(java.lang.String site,
                                                       java.util.Map<? extends K,​? extends V> keys)
      • handleWriteOnlyManyFailure

        default void handleWriteOnlyManyFailure​(java.lang.String site,
                                                java.util.Collection<? extends K> key)
      • handleWriteOnlyManyEntriesFailure

        default void handleWriteOnlyManyEntriesFailure​(java.lang.String site,
                                                       java.util.Map<? extends K,​? extends V> key)
      • handleClearFailure

        void handleClearFailure​(java.lang.String site)
      • handlePutAllFailure

        void handlePutAllFailure​(java.lang.String site,
                                 java.util.Map<K,​V> map)
      • handlePrepareFailure

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

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

        void handleCommitFailure​(java.lang.String site,
                                 javax.transaction.Transaction transaction)