当前位置: 首页>>代码示例>>Java>>正文


Java Counter.addAndGet方法代码示例

本文整理汇总了Java中io.vertx.core.shareddata.Counter.addAndGet方法的典型用法代码示例。如果您正苦于以下问题:Java Counter.addAndGet方法的具体用法?Java Counter.addAndGet怎么用?Java Counter.addAndGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.shareddata.Counter的用法示例。


在下文中一共展示了Counter.addAndGet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openCircuitBreakerAndHandleError

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void openCircuitBreakerAndHandleError(
    Consumer<Throwable> errorHandler,
    ThrowableErrorConsumer<Throwable, T> onFailureRespond,
    Consumer<Throwable> errorMethodHandler,
    Consumer<ExecutionResult<T>> resultConsumer,
    AsyncResult<T> event,
    Lock lock,
    Counter counter) {
  counter.addAndGet(
      LOCK_VALUE,
      val -> {
        lock.release();
        errorHandling(
            errorHandler,
            onFailureRespond,
            errorMethodHandler,
            resultConsumer,
            Future.failedFuture(event.cause()));
      });
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:21,代码来源:StepExecution.java

示例2: openCircuitBreakerAndHandleError

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void openCircuitBreakerAndHandleError(
    Future<ExecutionResult<T>> _blockingHandler,
    Consumer<Throwable> _errorHandler,
    ThrowableFunction<Throwable, T> _onFailureRespond,
    Consumer<Throwable> _errorMethodHandler,
    VxmsShared vxmsShared,
    Throwable e,
    Lock lck,
    Counter counter) {
  counter.addAndGet(
      LOCK_VALUE,
      val -> {
        lck.release();
        final Vertx vertx = vxmsShared.getVertx();
        vertx.executeBlocking(
            bhandler -> {
              T result = handleError(_errorHandler, _onFailureRespond, _errorMethodHandler, e);
              if (!_blockingHandler.isComplete()) {
                _blockingHandler.complete(new ExecutionResult<>(result, true, true, null));
              }
            },
            false,
            res -> {});
      });
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:26,代码来源:ResponseBlockingExecution.java

示例3: openCircuitBreakerAndHandleError

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void openCircuitBreakerAndHandleError(
    Future<ExecutionResult<T>> _resultHandler,
    Consumer<Throwable> _errorHandler,
    ThrowableFunction<Throwable, T> _onFailureRespond,
    Consumer<Throwable> _errorMethodHandler,
    VxmsShared vxmsShared,
    Throwable e,
    Lock lck,
    Counter counter) {
  counter.addAndGet(
      LOCK_VALUE,
      val -> {
        lck.release();
        final Vertx vertx = vxmsShared.getVertx();
        vertx.executeBlocking(
            bhandler -> {
              T result = handleError(_errorHandler, _onFailureRespond, _errorMethodHandler, e);
              if (!_resultHandler.isComplete()) {
                _resultHandler.complete(new ExecutionResult<>(result, true, true, null));
              }
            },
            false,
            res -> {});
      });
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:26,代码来源:StepExecution.java

示例4: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    int _retry,
    long _timeout,
    ThrowableFutureConsumer<T> _userOperation,
    VxmsShared vxmsShared,
    Future<T> operationResult,
    Lock lock,
    Counter counter) {
  final long initialRetryCounterValue = (long) (_retry + 1);
  counter.addAndGet(
      initialRetryCounterValue,
      rHandler ->
          executeDefaultState(_timeout, _userOperation, vxmsShared, operationResult, lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:15,代码来源:ResponseExecution.java

示例5: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T, V> void executeInitialState(
    int _retry,
    long _timeout,
    ThrowableFutureBiConsumer<T, V> step,
    T inputValue,
    VxmsShared vxmsShared,
    Future<V> operationResult,
    Lock lock,
    Counter counter) {
  final long initialRetryCounterValue = (long) (_retry + 1);
  counter.addAndGet(
      initialRetryCounterValue,
      rHandler ->
          executeDefaultState(_timeout, step, inputValue, vxmsShared, operationResult, lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:16,代码来源:StepExecution.java

示例6: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    String _methodId,
    ThrowableSupplier<T> _supplier,
    Future<ExecutionResult<T>> _blockingHandler,
    Consumer<Throwable> _errorHandler,
    ThrowableFunction<Throwable, T> _onFailureRespond,
    Consumer<Throwable> _errorMethodHandler,
    VxmsShared vxmsShared,
    Throwable _t,
    int _retry,
    long _timeout,
    long _circuitBreakerTimeout,
    long _delay,
    Lock lock,
    Counter counter) {
  final long initialRetryCounterValue = (long) (_retry + 1);
  counter.addAndGet(
      initialRetryCounterValue,
      rHandler ->
          executeDefault(
              _methodId,
              _supplier,
              _blockingHandler,
              _errorHandler,
              _onFailureRespond,
              _errorMethodHandler,
              vxmsShared,
              _t,
              _retry,
              _timeout,
              _circuitBreakerTimeout,
              _delay,
              lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:35,代码来源:ResponseBlockingExecution.java

示例7: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    int retry,
    long timeout,
    ThrowableFutureConsumer<T> _userOperation,
    VxmsShared vxmsShared,
    Future<T> operationResult,
    Lock lock,
    Counter counter) {
  final long initialRetryCounterValue = (long) (retry + 1);
  counter.addAndGet(
      initialRetryCounterValue,
      rHandler ->
          executeDefaultState(timeout, _userOperation, vxmsShared, operationResult, lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:15,代码来源:ResponseExecution.java

示例8: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T, V> void executeInitialState(
    int retry,
    long timeout,
    ThrowableFutureBiConsumer<T, V> _step,
    T _inputValue,
    VxmsShared vxmsShared,
    Future<V> operationResult,
    Lock lock,
    Counter counter) {
  final long initialRetryCounterValue = (long) (retry + 1);
  counter.addAndGet(
      initialRetryCounterValue,
      rHandler ->
          executeDefaultState(timeout, _step, _inputValue, vxmsShared, operationResult, lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:16,代码来源:StepExecution.java

示例9: openCircuitAndHandleError

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void openCircuitAndHandleError(
    String methodId,
    VxmsShared vxmsShared,
    Consumer<Throwable> errorMethodHandler,
    RoutingContext context,
    Map<String, String> headers,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableErrorConsumer<Throwable, T> onFailureRespond,
    int httpStatusCode,
    int httpErrorCode,
    int retryCount,
    long timeout,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    AsyncResult<Message<Object>> event,
    Lock lock,
    Counter counter) {
  final Vertx vertx = vxmsShared.getVertx();
  vertx.setTimer(
      circuitBreakerTimeout,
      timer -> counter.addAndGet(Integer.valueOf(retryCount + 1).longValue(), val -> {}));
  counter.addAndGet(
      LOCK_VALUE,
      val -> {
        final Throwable cause = event.cause();
        handleError(
            methodId,
            vxmsShared,
            errorMethodHandler,
            context,
            headers,
            encoder,
            errorHandler,
            onFailureRespond,
            httpStatusCode,
            httpErrorCode,
            retryCount,
            timeout,
            circuitBreakerTimeout,
            executor,
            lock,
            cause);
      });
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:46,代码来源:EventbusExecution.java

示例10: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    String methodId,
    String id,
    Object message,
    ThrowableFunction<AsyncResult<Message<Object>>, T> function,
    DeliveryOptions deliveryOptions,
    VxmsShared vxmsShared,
    Throwable t,
    Consumer<Throwable> errorMethodHandler,
    RoutingContext context,
    Map<String, String> headers,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableFunction<Throwable, T> onFailureRespond,
    int httpStatusCode,
    int httpErrorCode,
    int retryCount,
    long timeout,
    long delay,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    RetryExecutor<T> retry,
    Lock lock,
    Counter counter) {
  counter.addAndGet(
      Integer.valueOf(retryCount + 1).longValue(),
      rHandler ->
          executeDefaultState(
              methodId,
              id,
              message,
              function,
              deliveryOptions,
              vxmsShared,
              t,
              errorMethodHandler,
              context,
              headers,
              encoder,
              errorHandler,
              onFailureRespond,
              httpStatusCode,
              httpErrorCode,
              retryCount,
              timeout,
              delay,
              circuitBreakerTimeout,
              executor,
              retry,
              lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:52,代码来源:EventbusExecution.java

示例11: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    String methodId,
    String targetId,
    Object message,
    ThrowableFutureBiConsumer<AsyncResult<Message<Object>>, T> objectFunction,
    DeliveryOptions requestDeliveryOptions,
    VxmsShared vxmsShared,
    Consumer<Throwable> errorMethodHandler,
    Message<Object> requestMessage,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableErrorConsumer<Throwable, T> onFailureRespond,
    DeliveryOptions responseDeliveryOptions,
    int retryCount,
    long timeout,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    RetryExecutor<T> retry,
    Lock lock,
    Counter counter) {
  int incrementCounter = retryCount + 1;
  counter.addAndGet(
      Integer.valueOf(incrementCounter).longValue(),
      rHandler ->
          executeDefaultState(
              methodId,
              targetId,
              message,
              objectFunction,
              requestDeliveryOptions,
              vxmsShared,
              errorMethodHandler,
              requestMessage,
              encoder,
              errorHandler,
              onFailureRespond,
              responseDeliveryOptions,
              retryCount,
              timeout,
              circuitBreakerTimeout,
              executor,
              retry,
              lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:45,代码来源:EventbusBridgeExecution.java

示例12: lockAndHandle

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static void lockAndHandle(
    Counter counter, Handler<AsyncResult<Long>> asyncResultHandler) {
  counter.addAndGet(LOCK_VALUE, asyncResultHandler);
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:5,代码来源:EventbusBridgeExecution.java

示例13: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    String methodId,
    String targetId,
    Object message,
    ThrowableFunction<AsyncResult<Message<Object>>, T> byteFunction,
    DeliveryOptions deliveryOptions,
    VxmsShared vxmsShared,
    Consumer<Throwable> errorMethodHandler,
    Message<Object> requestMessage,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableFunction<Throwable, T> onFailureRespond,
    DeliveryOptions responseDeliveryOptions,
    int retryCount,
    long timeout,
    long delay,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    RetryExecutor<T> retry,
    Lock lock,
    Counter counter) {
  int incrementCounter = retryCount + 1;
  counter.addAndGet(
      Integer.valueOf(incrementCounter).longValue(),
      rHandler ->
          executeDefaultState(
              methodId, targetId,
              message,
              byteFunction,
              deliveryOptions,
              vxmsShared,
              errorMethodHandler,
              requestMessage,
              encoder,
              errorHandler,
              onFailureRespond,
              responseDeliveryOptions,
              retryCount,
              timeout,
              delay,
              circuitBreakerTimeout,
              executor,
              retry,
              lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:46,代码来源:EventbusBridgeExecution.java

示例14: openCircuitAndHandleError

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void openCircuitAndHandleError(
    String methodId,
    VxmsShared vxmsShared,
    Consumer<Throwable> errorMethodHandler,
    RoutingContext context,
    Map<String, String> headers,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableFunction<Throwable, T> onFailureRespond,
    int httpStatusCode,
    int httpErrorCode,
    int retryCount,
    long timeout,
    long delay,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    AsyncResult<Message<Object>> event,
    Lock lock,
    Counter counter) {
  final Vertx vertx = vxmsShared.getVertx();
  vertx.setTimer(
      circuitBreakerTimeout,
      timer -> counter.addAndGet(Integer.valueOf(retryCount + 1).longValue(), val -> {}));
  counter.addAndGet(
      LOCK_VALUE,
      val -> {
        final Throwable cause = event.cause();
        handleError(
            methodId,
            vxmsShared,
            errorMethodHandler,
            context,
            headers,
            encoder,
            errorHandler,
            onFailureRespond,
            httpStatusCode,
            httpErrorCode,
            retryCount,
            timeout,
            delay,
            circuitBreakerTimeout,
            executor,
            lock,
            cause);
      });
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:48,代码来源:EventbusExecution.java

示例15: executeInitialState

import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static <T> void executeInitialState(
    String methodId,
    String id,
    Object message,
    ThrowableFutureBiConsumer<AsyncResult<Message<Object>>, T> stringFunction,
    DeliveryOptions deliveryOptions,
    VxmsShared vxmsShared,
    Throwable t,
    Consumer<Throwable> errorMethodHandler,
    RoutingContext context,
    Map<String, String> headers,
    Encoder encoder,
    Consumer<Throwable> errorHandler,
    ThrowableErrorConsumer<Throwable, T> onFailureRespond,
    int httpStatusCode,
    int httpErrorCode,
    int retryCount,
    long timeout,
    long circuitBreakerTimeout,
    RecursiveExecutor<T> executor,
    RetryExecutor<T> retry,
    Lock lock,
    Counter counter) {
  counter.addAndGet(
      Integer.valueOf(retryCount + 1).longValue(),
      rHandler ->
          executeDefaultState(
              methodId,
              id,
              message,
              stringFunction,
              deliveryOptions,
              vxmsShared,
              t,
              errorMethodHandler,
              context,
              headers,
              encoder,
              errorHandler,
              onFailureRespond,
              httpStatusCode,
              httpErrorCode,
              retryCount,
              timeout,
              circuitBreakerTimeout,
              executor,
              retry,
              lock));
}
 
开发者ID:amoAHCP,项目名称:vxms,代码行数:50,代码来源:EventbusExecution.java


注:本文中的io.vertx.core.shareddata.Counter.addAndGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。