@Override
  public java.util.concurrent.Future<UpdateTrailResult> updateTrailAsync(
      final UpdateTrailRequest request,
      final com.amazonaws.handlers.AsyncHandler<UpdateTrailRequest, UpdateTrailResult>
          asyncHandler) {

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

            try {
              result = updateTrail(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<StopLoggingResult> stopLoggingAsync(
      final StopLoggingRequest request,
      final com.amazonaws.handlers.AsyncHandler<StopLoggingRequest, StopLoggingResult>
          asyncHandler) {

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

            try {
              result = stopLogging(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();
 }