Value - The type of the involved values.public interface Handler<Value>
Handler is used, to convey the involved
value from the executor of the process (hereafter: executor) back to the
initiator of the process (hereafter: initiator).
Depending on the concrete scenario, the initiator may reuse the same instance
of Handler for multiple processes and even for the same executor.
The executor may or may not call handle(Object).
A useful application to this rule is, when the executor can ensure, that the
result wont't be needed by the initiator, because the initiator itself is not
needed anymore. This is usually implemented by placing the Callback
in a WeakReference. Because using anonymous instances of
Handler will most likely fail in this situation, it should be noted
in the contract of the method, that takes the Handler as an argument.
The executor may call handle(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, that is used to convey the
Handler to the executor.
The executor must not call handle(Object) more than once for
the same subject.
| Modifier and Type | Method and Description |
|---|---|
void |
handle(Value value)
Called by the executor when an condition occurs.
|
void handle(Value value) throws HandlingException
Implementers should catch any exception and wrap them in a
HandlingException.
value - The involved value.HandlingException - If the handling failed.Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.