private void processUndefinedWave ( final Wave wave ) throws WaveException { LOGGER . info ( NOTIFIER_CONSUMES , wave . toString ( ) ) ; wave . status ( Status . Consumed ) ; // Retrieve all interested object from the map if ( this . notifierMap . containsKey ( wave . waveType ( ) ) ) { final WaveSubscription ws = this . notifierMap . get ( wave . waveType ( ) ) ; // Filter and store all Wave handlers into the wave // They will be removed from the list when they are handled in order to know if there is any handler left before wave . setWaveHandlers ( ws . getWaveHandlers ( ) . stream ( ) . filter ( wh -> wh . check ( wave ) ) . collect ( Collectors . toList ( ) ) ) ; // For each object interested in that wave type, process the action // Make a defensive copy to protect from concurrent modification exception when the wavehandler will be removed from list for ( final WaveHandler waveHandler : new ArrayList <> ( wave . getWaveHandlers ( ) ) ) { // The handler will be performed in the right thread according to RunType annotation waveHandler . handle ( wave ) ; } } else { LOGGER . warn ( NO_WAVE_LISTENER , wave . waveType ( ) . toString ( ) ) ; if ( CoreParameters . DEVELOPER_MODE . get ( ) ) { this . unprocessedWaveHandler . manageUnprocessedWave ( NO_WAVE_LISTENER . getText ( wave . waveType ( ) . toString ( ) ) , wave ) ; } } // The current wave will be marked as Handled when all Wave Handlers will be terminated // if(!wave.isRelated()){ // LOGGER.info(NOTIFIER_HANDLES, wave.toString()); // wave.status(Status.Handled); // } }
Dispatch a standard wave which could be handled by a custom method of the component .