See: Description
| Class | Description |
|---|---|
| Callback<L,R> |
A helper class to wrap a function and provide a name for logging purposes
|
| CallbackResult<R> |
A helper class to simplify the access the result of a callback (if any)
|
| CallbacksDispatcher<L> |
A helper to dispatch callbacks to a set of listeners.
|
| CallbacksDispatcher.CallbackResults<L,R> |
CallbacksDispatcher, they should all implement the same
interface. FunctionCallback which allows to assign a meaningful string to the
callback. Typically, this is the name of the callback and short description of any bound
arguments.
Note that callback instances as defined above can't take any arguments to be passed to the listeners. They should be viewed as a binding of the actual callback method call to a specific set of arguments.
For example, if we want to define a callback void onNewJob(JobSpec newJob) to
be sent to JobCatalogListener interface, we need:
NewJobCallback implements Callback
input.onNewJob(this.newJob)
CallbacksDispatcherCallbacksDispatcher.execCallbacks(com.google.common.base.Function)
to each of the above listeners.
CallbacksDispatcher.CallbackResults
for easier upstream processing.