@Override
  public java.util.concurrent.Future<ValidateTemplateResult> validateTemplateAsync(
      final ValidateTemplateRequest request,
      final com.amazonaws.handlers.AsyncHandler<ValidateTemplateRequest, ValidateTemplateResult>
          asyncHandler) {

    return executorService.submit(
        new java.util.concurrent.Callable<ValidateTemplateResult>() {
          @Override
          public ValidateTemplateResult call() throws Exception {
            ValidateTemplateResult result;

            try {
              result = validateTemplate(request);
            } catch (Exception ex) {
              if (asyncHandler != null) {
                asyncHandler.onError(ex);
              }
              throw ex;
            }

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
  @Override
  public java.util.concurrent.Future<ListStacksResult> listStacksAsync(
      final ListStacksRequest request,
      final com.amazonaws.handlers.AsyncHandler<ListStacksRequest, ListStacksResult> asyncHandler) {

    return executorService.submit(
        new java.util.concurrent.Callable<ListStacksResult>() {
          @Override
          public ListStacksResult call() throws Exception {
            ListStacksResult result;

            try {
              result = listStacks(request);
            } catch (Exception ex) {
              if (asyncHandler != null) {
                asyncHandler.onError(ex);
              }
              throw ex;
            }

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
  @Override
  public java.util.concurrent.Future<Void> signalResourceAsync(
      final SignalResourceRequest request,
      final com.amazonaws.handlers.AsyncHandler<SignalResourceRequest, Void> asyncHandler) {

    return executorService.submit(
        new java.util.concurrent.Callable<Void>() {
          @Override
          public Void call() throws Exception {
            Void result;

            try {
              signalResource(request);
              result = null;
            } catch (Exception ex) {
              if (asyncHandler != null) {
                asyncHandler.onError(ex);
              }
              throw ex;
            }

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
  @Override
  public java.util.concurrent.Future<DescribeStackResourceResult> describeStackResourceAsync(
      final DescribeStackResourceRequest request,
      final com.amazonaws.handlers.AsyncHandler<
              DescribeStackResourceRequest, DescribeStackResourceResult>
          asyncHandler) {

    return executorService.submit(
        new java.util.concurrent.Callable<DescribeStackResourceResult>() {
          @Override
          public DescribeStackResourceResult call() throws Exception {
            DescribeStackResourceResult result;

            try {
              result = describeStackResource(request);
            } catch (Exception ex) {
              if (asyncHandler != null) {
                asyncHandler.onError(ex);
              }
              throw ex;
            }

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
 /**
  * Shuts down the client, releasing all managed resources. This includes forcibly terminating all
  * pending asynchronous service calls. Clients who wish to give pending asynchronous service calls
  * time to complete should call {@code getExecutorService().shutdown()} followed by {@code
  * getExecutorService().awaitTermination()} prior to calling this method.
  */
 @Override
 public void shutdown() {
   super.shutdown();
   executorService.shutdownNow();
 }