本文整理汇总了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()));
});
}
示例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 -> {});
});
}
示例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 -> {});
});
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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);
});
}
示例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));
}
示例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));
}
示例12: lockAndHandle
import io.vertx.core.shareddata.Counter; //导入方法依赖的package包/类
private static void lockAndHandle(
Counter counter, Handler<AsyncResult<Long>> asyncResultHandler) {
counter.addAndGet(LOCK_VALUE, asyncResultHandler);
}
示例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));
}
示例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);
});
}
示例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));
}