private synchronized void shutdown(boolean now) {
      if (myService != null) {
        if (now) {
          myService.shutdownNow();
        }
        else {
          myService.shutdown();
        }
        myService = null;
      }
    }
private synchronized void shutdown(boolean now)