@ SuppressWarnings ( "unchecked" ) private void callCommand ( final Wave wave ) { // Use the Wave UID to guarantee that a new fresh command is built and used ! final Command command = wave . contains ( JRebirthWaves . REUSE_COMMAND ) && wave . get ( JRebirthWaves . REUSE_COMMAND ) ? globalFacade ( ) . commandFacade ( ) . retrieve ( ( Class < Command > ) wave . componentClass ( ) ) : globalFacade ( ) . commandFacade ( ) . retrieve ( ( Class < Command > ) wave . componentClass ( ) , wave . wUID ( ) ) ; if ( command == null ) { LOGGER . error ( COMMAND_NOT_FOUND_ERROR , wave . toString ( ) ) ; // When developer mode is activated an error will be thrown by logger // Otherwise the wave will be managed by UnprocessedWaveHandler this . unprocessedWaveHandler . manageUnprocessedWave ( COMMAND_NOT_FOUND_MESSAGE . getText ( ) , wave ) ; } else { // Run the command into the predefined thread command . run ( wave ) ; } }
Call dynamically a command .