|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.uadetector.internal.util.ExecutorServices
public final class ExecutorServices
This utility is intended to provide predefined ExecutorService
s which runs in background and can be easily
shut-downed within shutdownAll()
if necessary.
Field Summary | |
---|---|
static long |
SHUTDOWN_DURATION
Timeout (in seconds) to shutdown all available executors at the latest |
Method Summary | |
---|---|
static java.util.concurrent.ExecutorService |
createBackgroundExecutor()
Creates a single-threaded executor that is registered by this class in order to shut it down later (when it becomes necessary). |
static java.util.concurrent.ScheduledExecutorService |
createScheduler()
Creates a single-threaded scheduler that is registered by this class in order to shut it down later (when it becomes necessary). |
static void |
shutdown(java.util.concurrent.ExecutorService executorService)
Shutdowns the given ExecutorService as soon as possible, but not later than the specified default time
(which is 5L seconds). |
static void |
shutdown(java.util.concurrent.ExecutorService executorService,
long duration,
java.util.concurrent.TimeUnit unit)
Shutdowns the given ExecutorService as soon as possible, but not later than the specified time. |
static void |
shutdownAll()
Shuts down all registered scheduler and background workers as soon as possible, but at the latest in specified SHUTDOWN_DURATION seconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long SHUTDOWN_DURATION
Method Detail |
---|
public static java.util.concurrent.ExecutorService createBackgroundExecutor()
public static java.util.concurrent.ScheduledExecutorService createScheduler()
public static void shutdown(@Nonnull java.util.concurrent.ExecutorService executorService)
ExecutorService
as soon as possible, but not later than the specified default time
(which is 5L seconds).
executorService
- executor to stoppublic static void shutdown(@Nonnull java.util.concurrent.ExecutorService executorService, @Nonnegative long duration, @Nonnull java.util.concurrent.TimeUnit unit)
ExecutorService
as soon as possible, but not later than the specified time.
executorService
- executor to stopduration
- duration as a numerical valueunit
- duration unitpublic static void shutdownAll()
SHUTDOWN_DURATION
seconds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |