Interface CallbackInitializable<R>


  • public interface CallbackInitializable<R>
    • Method Detail

      • initialize

        void initialize​(R resource)
      • onInitializationFailureCleanup

        default void onInitializationFailureCleanup​(R resource,
                                                    Throwable initFailure)
        If #initialize(R) failing can result in a state where cleanup is necessary, override this method.
        Parameters:
        resource - the resource used in initialization.
        initFailure - the Throwable causing the failure in initialization.
      • singleAttemptCallback

        default Callback<R> singleAttemptCallback()
        Returns a Callback that runs initialize only once. On initialization failure, executes the specified cleanup and then wraps and throws the cause.
      • retryUnlessCleanupThrowsCallback

        default Callback<R> retryUnlessCleanupThrowsCallback()
        Returns a Callback that will retry initialization on failure, unless the cleanup task also throws, in which case the exception thrown by the cleanup task is propagated.