private AsyncFuture<ModelNode> executeAsync(
     ModelNode operation,
     OperationAttachments attachments,
     OperationMessageHandler messageHandler) {
   final int batchId = ManagementBatchIdManager.DEFAULT.createBatchId();
   try {
     return new DelegatingCancellableAsyncFuture(
         new ExecuteRequest(batchId, true, operation, messageHandler, attachments)
             .execute(executor, getClientChannelStrategy()),
         batchId);
   } catch (Exception e) {
     ManagementBatchIdManager.DEFAULT.freeBatchId(batchId);
     if (e instanceof RuntimeException) {
       throw (RuntimeException) e;
     }
     throw new RuntimeException(e);
   }
 }
  private ModelNode executeSynch(
      ModelNode operation, OperationAttachments attachments, OperationMessageHandler messageHandler)
      throws IOException {
    final int batchId = ManagementBatchIdManager.DEFAULT.createBatchId();

    try {
      return new ExecuteRequest(batchId, false, operation, messageHandler, attachments)
          .executeForResult(executor, getClientChannelStrategy());
    } catch (Exception e) {
      ManagementBatchIdManager.DEFAULT.freeBatchId(batchId);
      Throwable cause = e;
      if (e instanceof ExecutionException) {
        cause = e.getCause();
      }
      if (cause instanceof IOException) {
        throw (IOException) cause;
      }
      if (cause instanceof RuntimeException) {
        throw (RuntimeException) cause;
      }
      throw new IOException(cause);
    }
  }