类 Runnables
java.lang.Object
org.apache.pulsar.common.util.Runnables
-
方法概要
修饰符和类型方法说明static RunnablecatchingAndLoggingThrowables(Runnable runnable) Wraps a Runnable so that throwables are caught and logged when a Runnable is run.
-
方法详细资料
-
catchingAndLoggingThrowables
Wraps a Runnable so that throwables are caught and logged when a Runnable is run. The main usecase for this method is to be used inScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)calls to ensure that the scheduled task doesn't get cancelled as a result of an uncaught exception.- 参数:
runnable- The runnable to wrap- 返回:
- a wrapped Runnable
-