public abstract class AbstractDispatcher extends Object implements Dispatch
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractDispatcher.DispatchRunnable<T>
The runnable handling the dispatch.
|
Constructor and Description |
---|
AbstractDispatcher()
Create a (stateless) dispatcher.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
asyncDispatch(Request<T> pRequest)
Generate a response and and dispatch it in a new (separate) thread.
|
<T> void |
asyncDispatchInEDT(Request<T> pRequest)
Generate a response in a new (separate) thread and dispatch the
response in the EDT (event dispatch thread).
|
protected abstract void |
doDispatch(Runnable pRunnable)
The callback method to switch to the "right" UI thread.
|
<T> void |
syncDispatch(Request<T> pRequest)
Generate a response and and dispatch it in the current thread.
|
<T> Response<T> |
syncExecute(Request<T> pRequest)
Generate a response (includes delegate handling) but doesn't dispatch the response.
|
public <T> void asyncDispatch(Request<T> pRequest)
asyncDispatch
in interface Dispatch
T
- Generic type of the pRequest
.pRequest
- the requestpublic <T> void asyncDispatchInEDT(Request<T> pRequest)
asyncDispatchInEDT
in interface Dispatch
T
- Generic type of the pRequest
.pRequest
- the requestpublic <T> Response<T> syncExecute(Request<T> pRequest)
syncExecute
in interface Dispatch
T
- Generic type of the pRequest
.pRequest
- the requestpublic <T> void syncDispatch(Request<T> pRequest)
syncDispatch
in interface Dispatch
T
- Generic type of the pRequest
.pRequest
- the requestprotected abstract void doDispatch(Runnable pRunnable)
pRunnable
- the runnable containing the result, must not be nullCopyright © 2017 Jürgen Zeller (privat). All rights reserved.