public class SResultListener
extends java.lang.Object
Constructor and Description |
---|
SResultListener() |
Modifier and Type | Method and Description |
---|---|
static <E> CounterResultListener<E> |
countResults(int num,
IFunctionalResultListener<java.lang.Void> countReachedListener)
Creates an
CounterResultListener . |
static <E> CounterResultListener<E> |
countResults(int num,
IFunctionalResultListener<java.lang.Void> countReachedListener,
IFunctionalExceptionListener exListener)
Creates an
CounterResultListener . |
static <E> CounterResultListener<E> |
countResults(int num,
IFunctionalResultListener<java.lang.Void> countReachedListener,
IFunctionalResultListener<E> intermediateListener,
IFunctionalExceptionListener exListener)
Creates an
CounterResultListener . |
static <E> IResultListener<E> |
createResultListener(IFunctionalResultListener<E> sucListener)
Creates an
IResultListener that delegates results to the given
SuccessListener and uses default exception handling. |
static <E> IResultListener<E> |
createResultListener(IFunctionalResultListener<E> sucListener,
boolean defaultExceptionHandling)
Creates an
IResultListener that delegates results to the given
SuccessListener. |
static <E> IResultListener<E> |
createResultListener(IFunctionalResultListener<E> sucListener,
IFunctionalExceptionListener exceptionListener)
Creates an
IResultListener that delegates results to the given
SuccessListener and Exceptions to the given ExceptionListener. |
static <E> IResultListener<E> |
delegate(Future<E> delegate)
Creates an
IResultListener that delegates results and exceptions to a given Future. |
static <E> IResultListener<E> |
delegate(Future<E> delegate,
boolean undone)
Creates an
IResultListener that delegates results and exceptions to a given Future. |
static <E> IResultListener<E> |
delegate(Future<E> delegate,
boolean undone,
IFunctionalResultListener<E> customResultListener)
Creates an
IResultListener that delegates results and exceptions to a given Future. |
static <E> IResultListener<E> |
delegate(Future<E> delegate,
IFunctionalResultListener<E> customResultListener)
Creates an
IResultListener that delegates results and exceptions to a given Future. |
static <E> IIntermediateResultListener<E> |
delegate(IntermediateFuture<E> delegate)
Creates an
IIntermediateResultListener that delegates results and exceptions to a given IntermediateFuture. |
static <E> IIntermediateResultListener<E> |
delegate(IntermediateFuture<E> delegate,
boolean undone)
Creates an
IIntermediateResultListener that delegates results and exceptions to a given IntermediateFuture. |
static <E> IIntermediateResultListener<E> |
delegate(IntermediateFuture<E> delegate,
boolean undone,
IFunctionalResultListener<java.util.Collection<E>> customResultListener,
IFunctionalIntermediateResultListener<E> customIntermediateResultListener)
Creates an
IIntermediateResultListener that delegates results and exceptions to a given IntermediateFuture. |
static <E,F> ITuple2ResultListener<E,F> |
delegate(Tuple2Future<E,F> delegate)
Creates an
ITuple2ResultListener that delegates results and exceptions to a given Future. |
static <E,T> IResultListener<E> |
delegateExceptions(Future<T> delegate,
boolean undone,
IFunctionalResultListener<E> customResultListener)
Creates an
IResultListener that delegates exceptions to a given Future
and results to a given SuccessListener. |
static <E,T> IResultListener<E> |
delegateExceptions(Future<T> delegate,
IFunctionalResultListener<E> customResultListener)
Creates an
IResultListener that delegates exceptions to a given Future
and results to a given SuccessListener. |
static <E> void |
delegateFromTo(IFuture<E> source,
Future<E> target)
Creates a delegation from source to target, respecting future types.
|
static IFunctionalExceptionListener |
ignoreExceptions()
Returns an OnExceptionListener that ignores all results.
|
static <E> IFunctionalResultListener<E> |
ignoreResults()
Returns a SuccessListener that ignores all results.
|
static IFunctionalExceptionListener |
printExceptions()
Returns an OnExceptionListener that logs exceptions to console.
|
public static final <E> IFunctionalResultListener<E> ignoreResults()
IFunctionalResultListener
public static final IFunctionalExceptionListener ignoreExceptions()
IFunctionalExceptionListener
public static final IFunctionalExceptionListener printExceptions()
IFunctionalExceptionListener
public static <E> void delegateFromTo(IFuture<E> source, Future<E> target)
source
- Delegation source.target
- Delegation target.public static <E> IResultListener<E> delegate(Future<E> delegate)
IResultListener
that delegates results and exceptions to a given Future.
Supports creating delegations for Future, IntermediateFuture and Tuple2Future.delegate
- The future used for success delegation.IResultListener
public static <E> IResultListener<E> delegate(Future<E> delegate, boolean undone)
IResultListener
that delegates results and exceptions to a given Future.delegate
- The future used for success delegation.undone
- Flag if undone methods should be used.IResultListener
public static <E> IResultListener<E> delegate(Future<E> delegate, IFunctionalResultListener<E> customResultListener)
IResultListener
that delegates results and exceptions to a given Future.delegate
- The future used for success delegation.customResultListener
- Custom result listener that overwrites the delegation behaviour.IResultListener
public static <E> IResultListener<E> delegate(Future<E> delegate, boolean undone, IFunctionalResultListener<E> customResultListener)
IResultListener
that delegates results and exceptions to a given Future.delegate
- The future used for success delegation.undone
- Flag if undone methods should be used.customResultListener
- Custom result listener that overwrites the delegation behaviour.IResultListener
public static <E> IIntermediateResultListener<E> delegate(IntermediateFuture<E> delegate)
IIntermediateResultListener
that delegates results and exceptions to a given IntermediateFuture.delegate
- The future used for intermediate and final result delegation.IntermediateDelegationResultListener
public static <E> IIntermediateResultListener<E> delegate(IntermediateFuture<E> delegate, boolean undone)
IIntermediateResultListener
that delegates results and exceptions to a given IntermediateFuture.delegate
- The future used for intermediate and final result delegation.undone
- Flag if undone methods should be used.IntermediateDelegationResultListener
public static <E> IIntermediateResultListener<E> delegate(IntermediateFuture<E> delegate, boolean undone, IFunctionalResultListener<java.util.Collection<E>> customResultListener, IFunctionalIntermediateResultListener<E> customIntermediateResultListener)
IIntermediateResultListener
that delegates results and exceptions to a given IntermediateFuture.delegate
- The future used for intermediate and final result delegation.undone
- Flag if undone methods should be used.customResultListener
- Custom result listener that overwrites the delegation behaviour.customIntermediateResultListener
- Custom intermediate result listener that overwrites the delegation behaviour.IntermediateDelegationResultListener
public static <E,F> ITuple2ResultListener<E,F> delegate(Tuple2Future<E,F> delegate)
ITuple2ResultListener
that delegates results and exceptions to a given Future.
Supports creating delegations for Tuple2Future.delegate
- The future used for success delegation.IResultListener
public static <E,T> IResultListener<E> delegateExceptions(Future<T> delegate, IFunctionalResultListener<E> customResultListener)
IResultListener
that delegates exceptions to a given Future
and results to a given SuccessListener.delegate
- The future used for exception delegation.customResultListener
- The SuccessListener.IResultListener
public static <E,T> IResultListener<E> delegateExceptions(Future<T> delegate, boolean undone, IFunctionalResultListener<E> customResultListener)
IResultListener
that delegates exceptions to a given Future
and results to a given SuccessListener.delegate
- The future used for exception delegation.undone
- Flag if undone methods should be used.customResultListener
- The SuccessListener.IResultListener
public static <E> CounterResultListener<E> countResults(int num, IFunctionalResultListener<java.lang.Void> countReachedListener)
CounterResultListener
.num
- The number of sub callbacks.countReachedListener
- Listener to be called when the given number is reached.CounterResultListener
public static <E> CounterResultListener<E> countResults(int num, IFunctionalResultListener<java.lang.Void> countReachedListener, IFunctionalExceptionListener exListener)
CounterResultListener
.num
- The number of sub callbacks.countReachedListener
- Listener to be called when the given number is reached.exListener
- Listener to be called for exceptions.CounterResultListener
public static <E> CounterResultListener<E> countResults(int num, IFunctionalResultListener<java.lang.Void> countReachedListener, IFunctionalResultListener<E> intermediateListener, IFunctionalExceptionListener exListener)
CounterResultListener
.num
- The number of sub callbacks.countReachedListener
- Listener to be called when the given number is reached.intermediateListener
- Listener to be called for intermediate Results.exListener
- Listener to be called for exceptions.CounterResultListener
public static <E> IResultListener<E> createResultListener(IFunctionalResultListener<E> sucListener)
IResultListener
that delegates results to the given
SuccessListener and uses default exception handling.sucListener
- The SuccessListener.IResultListener
public static <E> IResultListener<E> createResultListener(IFunctionalResultListener<E> sucListener, boolean defaultExceptionHandling)
IResultListener
that delegates results to the given
SuccessListener.sucListener
- The SuccessListener.defaultExceptionHandling
- Specifies whether to use a default
handling for exceptions or not.IResultListener
public static <E> IResultListener<E> createResultListener(IFunctionalResultListener<E> sucListener, IFunctionalExceptionListener exceptionListener)
IResultListener
that delegates results to the given
SuccessListener and Exceptions to the given ExceptionListener.sucListener
- The SuccessListener.exceptionListener
- The ExceptionListener. If null
, exceptions are logged.IResultListener