public class WaveHandler extends Object implements LinkMessages
| Modifier and Type | Field and Description |
|---|---|
private Method |
defaultMethod
The default method to call, will been used when annotation is put on a method, otherwise could be null.
|
private static JRLogger |
LOGGER
The class logger.
|
private WaveChecker |
waveChecker
The wave checker taht check if the wave could be handled, could be null.
|
private WaveReady<?> |
waveReady
The wave ready component that will handle the wave.
|
CALL_ANNOTATED_METHOD_ERROR, COMMAND_NOT_FOUND_ERROR, COMMAND_NOT_FOUND_MESSAGE, COMPONENT_INJECTION_FAILURE, CUSTOM_METHOD_NOT_FOUND, LISTEN_WAVE_TYPE, MODEL_NOT_FOUND_ERROR, MODEL_NOT_FOUND_MESSAGE, NO_WAVE_LISTENER, NOTIFIER_CONSUMES, SEND_WAVE, SERVICE_NOT_FOUND_ERROR, SERVICE_NOT_FOUND_MESSAGE, UNLISTEN_WAVE_TYPE, USE_DEFAULT_WAVE_HANDLER, WAVE_BEAN_CREATION_ERROR, WAVE_DISPATCH_ERROR, WAVE_HANDLING_ERROR, WAVE_LOST, WAVE_LOST_CONTEXT, WAVE_SENDING_ERROR| Constructor and Description |
|---|
WaveHandler(WaveReady<?> waveReady,
WaveChecker waveChecker,
Method defaultMethod)
Instantiates a new wave handler.
|
| Modifier and Type | Method and Description |
|---|---|
private JRebirthRunnable |
buildWaveRunnable(Wave wave,
Method customMethod,
RunnablePriority priority)
Build the wave runnable handler that will handle the wave into the right thread.
|
boolean |
check(Wave wave)
Check the wave if the wave checker is not null anf if it returns true.
|
WaveReady<?> |
getWaveReady()
Gets the wave ready.
|
void |
handle(Wave wave)
Handle the wave into JAT for model component or into current thread for others.
|
private void |
performHandle(Wave wave,
Method method)
Perform the handle independently of thread used.
|
private Method |
retrieveCustomMethod(Wave wave)
Retrieve the custom wave handler method.
|
private static final JRLogger LOGGER
private final WaveReady<?> waveReady
private final Method defaultMethod
private final WaveChecker waveChecker
public WaveHandler(WaveReady<?> waveReady, WaveChecker waveChecker, Method defaultMethod)
waveReady - the wave ready component that will handle the wavewaveChecker - the wave checker, could be nulldefaultMethod - the default method to call, could be nullpublic boolean check(Wave wave)
wave - the wave to checkpublic WaveReady<?> getWaveReady()
public void handle(Wave wave) throws WaveException
wave - the wave to manageWaveException - if an error occurred while processing the waveprivate JRebirthRunnable buildWaveRunnable(Wave wave, Method customMethod, RunnablePriority priority)
wave - the wave to handlecustomMethod - the custom method to call (could be null)priority - the runnable priority to useprivate Method retrieveCustomMethod(Wave wave)
wave - the wave to be handledprivate void performHandle(Wave wave, Method method) throws WaveException
wave - the wave to managemethod - the handler method to call, could be nullWaveException - if an error occurred while processing the waveCopyright © 2011–2014 JRebirth OSS. All rights reserved.