@Override
 public void close() throws IOException {
   if (destroyExecutor) {
     executorService.shutdown();
   }
   if (endpoint != null)
     try {
       endpoint.close();
     } catch (IOException e) {
       // ignore
     }
   if (destroyExecutor) {
     executorService.shutdownNow();
   }
 }
  public void stop() throws IOException {
    log.infof("Stopping JMX Remoting Server %s", Version.getVersionString());

    // Services using an existing Remoting installation only need to stop the JMXConnectorServer
    // to disassociate it from Remoting.
    if (connectorServer != null) {
      connectorServer.stop();
    }
    if (server != null) {
      server.close();
    }

    if (endpoint != null) {
      endpoint.close();
    }
  }
 public synchronized void close() {
   try {
     if (connection != null) {
       connection.close();
     }
   } catch (IOException e) {
     AppClientLogger.ROOT_LOGGER.exceptionClosingConnection(e);
   }
   try {
     if (endpoint != null) {
       endpoint.close();
     }
   } catch (IOException e) {
     AppClientLogger.ROOT_LOGGER.exceptionClosingConnection(e);
   }
 }
 private void stopServer() throws IOException {
   remoteNamingService.stop();
   server.close();
   endpoint.close();
   serverStopped = true;
 }