public class Resulting<T> extends Invoker.Unit implements ResultListener<T>, InvocationService.ConfirmListener, InvocationService.ResultListener
ResultListener.NOOP<T>| Modifier and Type | Field and Description |
|---|---|
static Function<Object,Void> |
TO_VOID
A handy
Object -> Void function for when you wish to chain to a
ResultListener<Void>. |
queueStampNOOP| Constructor and Description |
|---|
Resulting(InvocationService.InvocationListener chain) |
Resulting(Resulting<T> chain) |
Resulting(ResultListener<Q> chain,
Function<? super T,? extends Q> xform) |
Resulting(ResultListener<T> chain) |
Resulting(String name) |
Resulting(String name,
InvocationService.InvocationListener chain) |
Resulting(String name,
Logger log,
Object... logArgs) |
Resulting(String name,
Resulting<T> chain) |
Resulting(String name,
ResultListener<Q> chain,
Function<? super T,? extends Q> xform) |
Resulting(String name,
ResultListener<T> chain) |
| Modifier and Type | Method and Description |
|---|---|
IntResultListener |
asIntResultListener()
Construct your
Resulting<Integer>, overriding what you need to, then call this to
adapt it. |
void |
handleResult() |
boolean |
invoke() |
T |
invokePersist()
Override this if you are using a Resulting as an Invoker unit.
|
void |
requestCompleted(T result)
Override this to handle a request completion in your own way.
|
void |
requestFailed(Exception cause)
Override this to handle a request failed in your own way.
|
void |
requestFailed(String error)
Called to report request failure.
|
void |
requestProcessed()
Indicates that the request was successfully processed.
|
void |
requestProcessed(Object result)
Indicates that the request was successfully processed.
|
getDetail, getLongThreshold, run, toStringpublic Resulting(String name)
public Resulting(String name, ResultListener<T> chain)
public Resulting(ResultListener<T> chain)
public Resulting(String name, InvocationService.InvocationListener chain)
public Resulting(InvocationService.InvocationListener chain)
public Resulting(String name, ResultListener<Q> chain, Function<? super T,? extends Q> xform)
public Resulting(ResultListener<Q> chain, Function<? super T,? extends Q> xform)
public final IntResultListener asIntResultListener()
Resulting<Integer>, overriding what you need to, then call this to
adapt it.public T invokePersist() throws Exception
Exceptionpublic final boolean invoke()
invoke in class Invoker.Unitpublic final void handleResult()
handleResult in class Invoker.Unitpublic final void requestFailed(String error)
InvocationService.InvocationListenerrequestFailed in interface InvocationService.InvocationListenerpublic final void requestProcessed()
InvocationService.ConfirmListenerrequestProcessed in interface InvocationService.ConfirmListenerpublic final void requestProcessed(Object result)
InvocationService.ResultListenerrequestProcessed in interface InvocationService.ResultListenerpublic void requestFailed(Exception cause)
requestFailed in interface ResultListener<T>public void requestCompleted(T result)
requestCompleted in interface ResultListener<T>Copyright © 2015. All rights reserved.