public synchronized void prepareShutdown() {
   shutdown = true;
   final List<ManagementChannelShutdownHandle> trackers = new ArrayList<>(this.trackers);
   for (final ManagementChannelShutdownHandle tracker : trackers) {
     tracker.shutdown();
   }
 }
 synchronized void stop() {
   shutdown = true;
   final List<ManagementChannelShutdownHandle> trackers = new ArrayList<>(this.trackers);
   for (final ManagementChannelShutdownHandle tracker : trackers) {
     tracker.shutdownNow();
   }
   this.trackers.clear();
   notifyAll();
 }
 public synchronized void registerTracker(final ManagementChannelShutdownHandle tracker) {
   if (!shutdown) {
     trackers.add(tracker);
   } else {
     tracker.shutdown();
   }
 }