| Modifier and Type | Field and Description |
|---|---|
| private static final RuntimeUtil | instance
the singleton instance of this class |
| private static final Log | runtimeLog
runtime package log |
| private final ScheduledThreadPoolExecutor | scheduler
thread pool for scheduling delayed tasks |
| private static final int | schedulerThreads
number of scheduler threads |
| private static final ThreadGroup | systemThreadGroup
Cached reference to the system (root) thread group. |
| private static final ThreadGroup | userThreadGroup
Special child of the system thread group for running tasks that may execute user code. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static RuntimeUtil | |
| public ScheduledThreadPoolExecutor | |
| public static Thread | Returns: the newly created threadthe thread's task runnable, String the thread's name, which will be prefixed with "RMI " name, boolean whether the thread should be a daemon daemon)Creates and returns, but does not start, a new thread with the given settings. |
| private static Thread | Returns: the newly created threadthe thread group, should be systemThreadGroup or userThreadGroup group, Runnable the thread's task runnable, String the thread's name, which will be prefixed with "RMI " name, boolean whether the thread should be a daemon daemon)Internal method to create a new thread with the given settings. |
| public static Thread | Returns: the newly created threadthe thread's task runnable, String the thread's name, which will be prefixed with "RMI " name, boolean whether the thread should be a daemon daemon)Creates and returns, but does not start, a new thread with the given settings. |
| instance | back to summary |
|---|---|
| private static final RuntimeUtil instance the singleton instance of this class | |
| runtimeLog | back to summary |
|---|---|
| private static final Log runtimeLog runtime package log | |
| scheduler | back to summary |
|---|---|
| private final ScheduledThreadPoolExecutor scheduler thread pool for scheduling delayed tasks | |
| schedulerThreads | back to summary |
|---|---|
| private static final int schedulerThreads number of scheduler threads | |
| systemThreadGroup | back to summary |
|---|---|
| private static final ThreadGroup systemThreadGroup Cached reference to the system (root) thread group. | |
| userThreadGroup | back to summary |
|---|---|
| private static final ThreadGroup userThreadGroup Special child of the system thread group for running tasks that may execute user code. The need for a separate thread group may be a vestige of it having had a different security policy from the system thread group, so this might no longer be necessary. | |
| RuntimeUtil | back to summary |
|---|---|
| private RuntimeUtil() Creates the single instance of RuntimeUtil. Note that this is called from a static initializer, and it has a ThreadFactory that calls static methods on this class, possibly from other threads. This should be ok, as the ScheduledThreadPoolExecutor constructor returns immediately without blocking on the creation of threads by the factory. | |
| getInstance | back to summary |
|---|---|
| public static RuntimeUtil getInstance() | |
| getScheduler | back to summary |
|---|---|
| public ScheduledThreadPoolExecutor getScheduler() Returns the shared thread pool for scheduling delayed tasks. Note that the returned pool has limited concurrency, so submitted tasks should be short-lived and should not block. | |
| newSystemThread | back to summary |
|---|---|
| public static Thread newSystemThread(Runnable runnable, String name, boolean daemon) Creates and returns, but does not start, a new thread with the given settings. The thread will be in the system ("root") thread group. | |
| newThread | back to summary |
|---|---|
| private static Thread newThread(ThreadGroup group, Runnable runnable, String name, boolean daemon) Internal method to create a new thread with the given settings.
| |
| newUserThread | back to summary |
|---|---|
| public static Thread newUserThread(Runnable runnable, String name, boolean daemon) Creates and returns, but does not start, a new thread with the given settings. The thread will be in the RMI user thread group. | |