private synchronized void cleanupFutures(){
  if (schedulerFuture != null) {
    schedulerFuture.cancel(false);
    schedulerFuture=null;
  }
  if (monitorFuture != null) {
    monitorFuture.cancel(false);
    monitorFuture=null;
  }
}

private synchronized void cleanupFutures ( ) { if ( schedulerFuture != null ) { schedulerFuture . cancel ( false ) ; schedulerFuture = null ; } if ( monitorFuture != null ) { monitorFuture . cancel ( false ) ; monitorFuture = null ; } }
cleanup the scheduler and monitor tasks futures .
