@ SuppressWarnings ( "unchecked" ) private void returnData ( final Wave wave ) { // Use only the Service class to retrieve the same instance each time final Service service = globalFacade ( ) . serviceFacade ( ) . retrieve ( ( Class < Service > ) wave . componentClass ( ) ) ; if ( service == null ) { LOGGER . error ( SERVICE_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 ( SERVICE_NOT_FOUND_MESSAGE . getText ( ) , wave ) ; } else { // The inner task will be run into the JRebirth Thread Pool final ServiceTaskBase < ? > task = ( ServiceTaskBase < ? > ) service . returnData ( wave ) ; if ( task != null && CoreParameters . FOLLOW_UP_SERVICE_TASKS . get ( ) ) { globalFacade ( ) . serviceFacade ( ) . retrieve ( TaskTrackerService . class ) . trackTask ( task ) ; } } }
Call a service method by using a task worker .