public void stop ( ) { Preconditions . checkState ( running , "Cannot stop if it's not running" ) ; synchronized ( this ) { log . atInfo ( ) . log ( "stopping client background thread and flushing the report aggregator" ) ; for ( ReportRequest req : reportAggregator . clear ( ) ) { try { transport . services ( ) . report ( serviceName , req ) . execute ( ) ; } catch ( IOException e ) { log . atSevere ( ) . withCause ( e ) . log ( "direct send of a report request failed" ) ; } } this . stopped = true ; // the scheduler thread will set running to false if ( isRunningSchedulerDirectly ( ) ) { resetIfStopped ( ) ; } this . scheduler = null ; } }
Stops processing .