public void close() {
   synchronized (mutex) {
     if (closed) {
       return;
     }
     closed = true;
     FutureUtils.cancel(nodesSamplerFuture);
     for (DiscoveryNode node : nodes) {
       transportService.disconnectFromNode(node);
     }
     for (DiscoveryNode listedNode : listedNodes) {
       transportService.disconnectFromNode(listedNode);
     }
     nodes = ImmutableList.of();
   }
 }
 @Override
 public <Request extends TransportRequest> void registerRequestHandler(
     String action,
     Supplier<Request> requestFactory,
     String executor,
     TransportRequestHandler<Request> handler) {
   super.registerRequestHandler(
       action, requestFactory, executor, new InterceptingRequestHandler<>(action, handler));
 }