public class TimeoutFactory extends Object
Constructor and Description |
---|
TimeoutFactory()
Constructs a new TimeoutFactory that uses the default thread pool
|
TimeoutFactory(ThreadPool threadPool)
Constructs a new TimeoutFactory that uses the provided ThreadPool
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels all submitted tasks, stops the worker
thread and clean-ups everything except for the
thread pool.
|
static Timeout |
createTimeout(long time,
TimeoutTarget target)
Schedules a new timeout using the singleton TimeoutFactory
|
static TimeoutFactory |
getSingleton() |
boolean |
isCancelled() |
Timeout |
schedule(long time,
Runnable run)
Schedules a new timeout.
|
Timeout |
schedule(long time,
TimeoutTarget target)
Schedules a new timeout.
|
public TimeoutFactory(ThreadPool threadPool)
threadPool
- public TimeoutFactory()
public static TimeoutFactory getSingleton()
public static Timeout createTimeout(long time, TimeoutTarget target)
time
- target
- public Timeout schedule(long time, TimeoutTarget target)
time
- absolute timetarget
- target to firepublic Timeout schedule(long time, Runnable run)
time
- absolute timerun
- runnable to runpublic void cancel()
public boolean isCancelled()
Copyright © 2018 JBoss by Red Hat. All rights reserved.