public class NotifierBase extends AbstractGlobalReady implements Notifier, LinkMessages
| Modifier and Type | Class and Description |
|---|---|
private static class |
NotifierBase.LoopBuilder
The class LoopBuilder.
|
| Modifier and Type | Field and Description |
|---|---|
private static JRLogger |
LOGGER
The class logger.
|
private Map<WaveType,WaveSubscription> |
notifierMap
The map that store link between wave type and objects interested.
|
private UnprocessedWaveHandler |
unprocessedWaveHandler
The handler used to handle unprocessed waves.
|
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 |
|---|
NotifierBase(GlobalFacade globalFacade)
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
callCommand(Wave wave)
Call dynamically a command.
|
private void |
displayUi(Wave wave)
Display dynamically an Ui model.
|
void |
listen(WaveReady<?> linkedObject,
WaveChecker waveChecker,
Method method,
WaveType... waveTypes)
Start to listen a defined type of wave.
|
private void |
processUndefinedWave(Wave wave)
Dispatch a standard wave which could be handled by a custom method of the component.
|
private void |
returnData(Wave wave)
Call a service method by using a task worker.
|
void |
sendWave(Wave wave)
Send wave to all facade.
|
void |
unlisten(WaveReady<?> linkedObject,
WaveType... waveTypes)
Stop to listen a defined type of wave.
|
void |
unlistenAll(WaveReady<?> linkedObject)
Stop to listen all waveType listened by the component.
|
getGlobalFacadeprivate static final JRLogger LOGGER
private final Map<WaveType,WaveSubscription> notifierMap
private final UnprocessedWaveHandler unprocessedWaveHandler
public NotifierBase(GlobalFacade globalFacade)
globalFacade - the global facade of the applicationpublic void sendWave(Wave wave) throws JRebirthThreadException
sendWave in interface Notifierwave - the object that information dataJRebirthThreadException - if called outside the JRebirthThreadprivate void callCommand(Wave wave)
wave - the wave that contains all informationsprivate void returnData(Wave wave)
wave - the wave that contains all informationsprivate void displayUi(Wave wave)
wave - the wave that contains all informationsprivate void processUndefinedWave(Wave wave) throws WaveException
wave - the wave that contains all informationWaveException - if wave dispatching failspublic void listen(WaveReady<?> linkedObject, WaveChecker waveChecker, Method method, WaveType... waveTypes) throws JRebirthThreadException
listen in interface NotifierlinkedObject - an object that can process the content of a wavewaveChecker - the wave checker to filter unwanted wave to be processed by other componentsmethod - the default method to callwaveTypes - the type(s) of wave that interests the object (one or many)JRebirthThreadException - if called outside the JRebirthThreadpublic void unlisten(WaveReady<?> linkedObject, WaveType... waveTypes) throws JRebirthThreadException
unlisten in interface NotifierlinkedObject - an object that can process the content of a wavewaveTypes - the type of wave that doesn't interest the object anymore (one or many)JRebirthThreadException - if called outside the JRebirthThreadpublic void unlistenAll(WaveReady<?> linkedObject) throws JRebirthThreadException
unlistenAll in interface NotifierlinkedObject - an object that can process the content of a waveJRebirthThreadException - if called outside the JRebirthThreadCopyright © 2011–2014 JRebirth OSS. All rights reserved.