public Future < String > sendRequest ( final String path , final ReportingHandler reportingHandler ) { return threadPool . submit ( new Callable < String > ( ) { @ Override public String call ( ) { String response = getResponse ( path ) ; if ( reportingHandler != null ) { reportingHandler . handleResponse ( response ) ; } return response ; } } ) ; }
Creates a future that will send a request to the reporting host and call the handler with the response