Class IntermediateExceptionDelegationResultListener<E,​T>

    • Field Detail

      • future

        protected Future<T> future
        The future to which calls are delegated.
      • undone

        protected boolean undone
        The undone flag.
    • Constructor Detail

      • IntermediateExceptionDelegationResultListener

        public IntermediateExceptionDelegationResultListener​(Future<T> future,
                                                             IFunctionalResultListener<E> intermediateResultListener,
                                                             IFunctionalResultListener<java.lang.Void> finishedListener)
        Create a new listener.
        Parameters:
        future - The delegation target.
        intermediateResultListener - Functional intermediate result Listener. Can be null.
        finishedListener - Functional finished listener. Can be null.
      • IntermediateExceptionDelegationResultListener

        public IntermediateExceptionDelegationResultListener​(Future<T> future)
        Create a new listener.
    • Method Detail

      • resultAvailable

        public void resultAvailable​(java.util.Collection<E> result)
        Called when the result is available. This method is only called for non-intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method has not been called.
        Specified by:
        resultAvailable in interface IFunctionalResultListener<E>
        Parameters:
        result - The final result.
      • customResultAvailable

        public void customResultAvailable​(java.util.Collection<E> result)
        Called when the result is available.
        Parameters:
        result - The result.
      • exceptionOccurred

        public void exceptionOccurred​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurred in interface IFunctionalExceptionListener
        Parameters:
        exception - The exception.
      • resultAvailableIfUndone

        public void resultAvailableIfUndone​(java.util.Collection<E> result)
        Called when the result is available.
        Specified by:
        resultAvailableIfUndone in interface IUndoneResultListener<E>
        Parameters:
        result - The result.
      • exceptionOccurredIfUndone

        public void exceptionOccurredIfUndone​(java.lang.Exception exception)
        Called when an exception occurred.
        Specified by:
        exceptionOccurredIfUndone in interface IUndoneResultListener<E>
        Parameters:
        exception - The exception.
      • finishedIfUndone

        public void finishedIfUndone()
        Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.
        Specified by:
        finishedIfUndone in interface IUndoneIntermediateResultListener<E>
      • isUndone

        public boolean isUndone()
        Get the undone.
        Returns:
        The undone.