public enum ThreadWatchdogs extends Enum<ThreadWatchdogs>
| 限定符和类型 | 方法和说明 |
|---|---|
ThreadWatchdog |
newInstance(long interval,
long maxExecutionTime,
LongSupplier relativeTimeSupplier,
BiFunction<Long,Runnable,ScheduledFuture<?>> scheduler)
Returns an implementation that checks for each fixed interval if there are threads that have invoked
ThreadWatchdog.register()
and not ThreadWatchdog.unregister() and have been in this state for longer than the specified max execution interval and
then interrupts these threads. |
ThreadWatchdog |
noop() |
static ThreadWatchdogs |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static ThreadWatchdogs[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static ThreadWatchdogs[] values()
for (ThreadWatchdogs c : ThreadWatchdogs.values()) System.out.println(c);
public static ThreadWatchdogs valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public ThreadWatchdog newInstance(long interval, long maxExecutionTime, LongSupplier relativeTimeSupplier, BiFunction<Long,Runnable,ScheduledFuture<?>> scheduler)
ThreadWatchdog.register()
and not ThreadWatchdog.unregister() and have been in this state for longer than the specified max execution interval and
then interrupts these threads.interval - The fixed interval to check if there are threads to interruptmaxExecutionTime - The time a thread has the execute an operation.relativeTimeSupplier - A supplier that returns relative timescheduler - A scheduler that is able to execute a command for each fixed intervalpublic ThreadWatchdog noop()
Copyright © 2021. All rights reserved.