Callee - The type of the originalResult - The type of the result of the process.public interface Callback<Callee,Result>
Callback is used, to convey that result from the executor of the
process (the callee) back to the initiator of the process (the caller).
Depending on the concrete scenario, the caller may reuse the same instance of
Callback for multiple processes and even for the same callee..
In most scenarios, the callee must eventually call
onResult(Object, Object), at least once.
A useful exception to this rule is, when the callee can ensure, that the
result wont't be needed by the caller, because the caller itself is not
needed anymore. This is usually implemented by placing the Callback
in a WeakReference. Because using anonymous instances of
Callback will most likely fail in this situation, it should be noted
in the contract of the method, that takes the Callback as an
argument.
The callee may call onResult(Object, Object), more than
once, depending o the concrete scenario, to convey partial or updated
results. This should be noted in the contract of the method, takes the
Callback as an argument.
The callee must not call onResult(Object, Object) more than
once for the same result.
| Modifier and Type | Method and Description |
|---|---|
void |
onResult(Callee callee,
Result result)
Called by the callee if and when a result is available.
|
Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.