Helper class for easy dealing between threads when using RestCallback. More...
Public Member Functions | |
| Meta (RestCallback cb) | |
| RestCallback | getCallback () |
| void | setCallback (RestCallback cb) |
| abstract void | enqueue (Runnable runnable) |
| final void | on (final Request request, final Response response) |
Helper class for easy dealing between threads when using RestCallback.
This class implements RestCallback and encapsulates a given instance of RestCallback. Subclass must implement the abstract method enqueue(Runnable) for enqueueing the execution of the callback in another thread, let's call it thread T (for instance the GUI thread), so that the encapsulated RestCallback will be executed in thread T instead of the underlying spooler thread of RestManager.
| Meta | ( | RestCallback | cb | ) |
| cb | the REST callback to encapsulated |
|
abstract |
Enqueue an instance of java.lang.Runnable in another thread.
| runnable | the runnable to execute |
| RestCallback getCallback | ( | ) |
RestCallback implementation.
Implements RestCallback.
| void setCallback | ( | RestCallback | cb | ) |
Set the encapsulated REST callback by this instance.
| cb | the REST callback to encapsulated |