ThreadGroup associated sun.awt.AppContext .
Non intrusive workaround for Bug 983 and Bug 1004, see getCachedThreadGroup().
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static final Method | |
| private static final Object | |
| private volatile WeakReference | |
| private volatile WeakReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static Object | |
| public final ThreadGroup | getCachedThreadGroup()
Returns the |
| public Thread | invokeOnAppContextThread(final boolean
if waitUntilDone, final Runnable true, waits until runnable execution is completed, otherwise returns immediately.the runnable, final String Runnable to be executed. If waitUntilDone is true,
the runnable must exist, i.e. not loop forever.the base name for the new thread if required.
The resulting thread name will have either '-OnAppContextTG' or '-OnSystemTG' appended threadBaseName)Invokes |
| public final boolean | isValid()
Returns |
| private static String | |
| public final boolean | Returns: true if the current ThreadGroup is mapped to an sun. and the information is good, otherwise false.informal string for logging purposes info)Update |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| getAppContextMethod | back to summary |
|---|---|
| private static final Method getAppContextMethod | |
| mainThreadAppContextLock | back to summary |
|---|---|
| private static final Object mainThreadAppContextLock | |
| mainThreadAppContextWR | back to summary |
|---|---|
| private volatile WeakReference<Object> mainThreadAppContextWR | |
| mainThreadGroupWR | back to summary |
|---|---|
| private volatile WeakReference<ThreadGroup> mainThreadGroupWR | |
| AppContextInfo | back to summary |
|---|---|
| public AppContextInfo(final String info) | |
| fetchAppContext | back to summary |
|---|---|
| private static Object fetchAppContext() | |
| getCachedThreadGroup | back to summary |
|---|---|
| public final ThreadGroup getCachedThreadGroup() Returns the
Returns
The returned
E.g. | |
| invokeOnAppContextThread | back to summary |
|---|---|
| public Thread invokeOnAppContextThread(final boolean waitUntilDone, final Runnable runnable, final String threadBaseName) Invokes
If a new
| |
| isValid | back to summary |
|---|---|
| public final boolean isValid() Returns | |
| toHexString | back to summary |
|---|---|
| private static String toHexString(final int i) | |
| update | back to summary |
|---|---|
| public final boolean update(final String info) Update
See
| |