Exemplo n.º 1
0
  @Override
  public java.util.concurrent.Future<ListAliasesResult> listAliasesAsync(
      final ListAliasesRequest request,
      final com.amazonaws.handlers.AsyncHandler<ListAliasesRequest, ListAliasesResult>
          asyncHandler) {

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

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

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
Exemplo n.º 2
0
  @Override
  public java.util.concurrent.Future<GenerateRandomResult> generateRandomAsync(
      final GenerateRandomRequest request,
      final com.amazonaws.handlers.AsyncHandler<GenerateRandomRequest, GenerateRandomResult>
          asyncHandler) {

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

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

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
Exemplo n.º 3
0
  @Override
  public java.util.concurrent.Future<CancelKeyDeletionResult> cancelKeyDeletionAsync(
      final CancelKeyDeletionRequest request,
      final com.amazonaws.handlers.AsyncHandler<CancelKeyDeletionRequest, CancelKeyDeletionResult>
          asyncHandler) {

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

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

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
Exemplo n.º 4
0
  @Override
  public java.util.concurrent.Future<Void> enableKeyRotationAsync(
      final EnableKeyRotationRequest request,
      final com.amazonaws.handlers.AsyncHandler<EnableKeyRotationRequest, Void> asyncHandler) {

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

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

            if (asyncHandler != null) {
              asyncHandler.onSuccess(request, result);
            }
            return result;
          }
        });
  }
Exemplo n.º 5
0
 /**
  * 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();
 }