@Override
  public java.util.concurrent.Future<UploadLayerPartResult> uploadLayerPartAsync(
      final UploadLayerPartRequest request,
      final com.amazonaws.handlers.AsyncHandler<UploadLayerPartRequest, UploadLayerPartResult>
          asyncHandler) {

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

            try {
              result = uploadLayerPart(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<SetRepositoryPolicyResult> setRepositoryPolicyAsync(
      final SetRepositoryPolicyRequest request,
      final com.amazonaws.handlers.AsyncHandler<
              SetRepositoryPolicyRequest, SetRepositoryPolicyResult>
          asyncHandler) {

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

            try {
              result = setRepositoryPolicy(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<PutImageResult> putImageAsync(
      final PutImageRequest request,
      final com.amazonaws.handlers.AsyncHandler<PutImageRequest, PutImageResult> asyncHandler) {

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

            try {
              result = putImage(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<GetDownloadUrlForLayerResult> getDownloadUrlForLayerAsync(
      final GetDownloadUrlForLayerRequest request,
      final com.amazonaws.handlers.AsyncHandler<
              GetDownloadUrlForLayerRequest, GetDownloadUrlForLayerResult>
          asyncHandler) {

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

            try {
              result = getDownloadUrlForLayer(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<BatchCheckLayerAvailabilityResult>
      batchCheckLayerAvailabilityAsync(
          final BatchCheckLayerAvailabilityRequest request,
          final com.amazonaws.handlers.AsyncHandler<
                  BatchCheckLayerAvailabilityRequest, BatchCheckLayerAvailabilityResult>
              asyncHandler) {

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

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