| 程序包 | 说明 |
|---|---|
| org.apache.ratis.util | |
| org.apache.ratis.util.function |
| 限定符和类型 | 方法和说明 |
|---|---|
static <THROWABLE extends Throwable> |
JavaUtils.attempt(CheckedRunnable<THROWABLE> runnable,
int numAttempts,
TimeDuration sleepTime,
String name,
org.slf4j.Logger log)
Attempt to run the given op multiple times.
|
<T extends Throwable> |
LifeCycle.checkStateAndClose(CheckedRunnable<T> closeMethod)
Check the current state and, if applicable, run the given close method.
|
default void |
TimeoutExecutor.onTimeout(TimeDuration timeout,
CheckedRunnable<?> task,
org.slf4j.Logger log,
Supplier<String> errorMessage)
When timeout, run the task.
|
<THROWABLE extends Throwable> |
TimeoutExecutor.onTimeout(TimeDuration timeout,
CheckedRunnable<THROWABLE> task,
Consumer<THROWABLE> errorHandler)
Schedule a timeout task.
|
<THROWABLE extends Throwable> |
TimeoutScheduler.onTimeout(TimeDuration timeout,
CheckedRunnable<THROWABLE> task,
Consumer<THROWABLE> errorHandler) |
<THROWABLE extends Throwable> |
TimeoutTimer.onTimeout(TimeDuration timeout,
CheckedRunnable<THROWABLE> task,
Consumer<THROWABLE> errorHandler) |
static <THROWABLE extends Throwable> |
LogUtils.runAndLog(org.slf4j.Logger log,
CheckedRunnable<THROWABLE> op,
Supplier<String> opName) |
static <T extends Throwable> |
JavaUtils.runAsUnchecked(CheckedRunnable<T> runnable) |
static <THROWABLE extends Throwable> |
JavaUtils.runAsUnchecked(CheckedRunnable<THROWABLE> runnable,
Function<THROWABLE,? extends RuntimeException> converter) |
<T extends Throwable> |
LifeCycle.startAndTransition(CheckedRunnable<T> startImpl,
Class<? extends Throwable>... exceptionClasses)
Run the given start method and transition the current state accordingly.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <THROWABLE extends Throwable> |
CheckedRunnable.asCheckedSupplier(CheckedRunnable<THROWABLE> runnable) |
Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.