|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Instance of this class holds information about a ThreadGroup associated sun.awt.AppContext.
More...
Public Member Functions | |
| AppContextInfo (final String info) | |
| final boolean | isValid () |
Returns true if this instance has valid sun.awt.AppContext information, i.e. More... | |
| final ThreadGroup | getCachedThreadGroup () |
Returns the ThreadGroup belonging to the last known sun.awt.AppContext as queried via update(String). More... | |
| RunnableTask | invokeOnAppContextThread (final boolean waitUntilDone, final Runnable runnable, final String threadBaseName) |
Invokes runnable on a Thread belonging to the sun.awt.AppContext ThreadGroup, see getCachedThreadGroup(). More... | |
| final boolean | update (final String info) |
Update sun.awt.AppContext information for the current ThreadGroup if uninitialized or sun.awt.AppContext changed. More... | |
Instance of this class holds information about a ThreadGroup associated sun.awt.AppContext.
Non intrusive workaround for Bug 983 and Bug 1004, see getCachedThreadGroup().
Definition at line 20 of file AppContextInfo.java.
| com.jogamp.nativewindow.awt.AppContextInfo.AppContextInfo | ( | final String | info | ) |
| final ThreadGroup com.jogamp.nativewindow.awt.AppContextInfo.getCachedThreadGroup | ( | ) |
Returns the ThreadGroup belonging to the last known sun.awt.AppContext as queried via update(String).
Returns null if no sun.awt.AppContext has been queried.
The returned ThreadGroup allows users to create a custom thread belonging to it and hence mitigating Bug 983 and Bug 1004.
update(String) should be called from a thread belonging to the desired sun.awt.AppContext, i.e. early from within the special threaded application.
E.g. JAWTWindow issues update(String) in it's constructor.
Definition at line 79 of file AppContextInfo.java.
| RunnableTask com.jogamp.nativewindow.awt.AppContextInfo.invokeOnAppContextThread | ( | final boolean | waitUntilDone, |
| final Runnable | runnable, | ||
| final String | threadBaseName | ||
| ) |
Invokes runnable on a Thread belonging to the sun.awt.AppContext ThreadGroup, see getCachedThreadGroup().
update(String) is issued first, which returns true if the current thread belongs to an AppContext ThreadGroup. In this case the runnable is invoked on the current thread, otherwise a new Thread will be started.
If a new Thread is required, the AppContext ThreadGroup is being used if available, otherwise the default system ThreadGroup.
| waitUntilDone | if true, waits until runnable execution is completed, otherwise returns immediately. |
| runnable | the Runnable to be executed. If waitUntilDone is true, the runnable must exist, i.e. not loop forever. |
| threadBaseName | the base name for the new thread if required. The resulting thread name will have either '-OnAppContextTG' or '-OnSystemTG' appended |
Thread used to invoke the runnable, which may be the current Thread or a newly created one, see above. Definition at line 105 of file AppContextInfo.java.
| final boolean com.jogamp.nativewindow.awt.AppContextInfo.isValid | ( | ) |
Returns true if this instance has valid sun.awt.AppContext information, i.e.
getCachedThreadGroup() returns not null.
Definition at line 57 of file AppContextInfo.java.
| final boolean com.jogamp.nativewindow.awt.AppContextInfo.update | ( | final String | info | ) |
Update sun.awt.AppContext information for the current ThreadGroup if uninitialized or sun.awt.AppContext changed.
See getCachedThreadGroup() for usage.
| info | informal string for logging purposes |
true if the current ThreadGroup is mapped to an sun.awt.AppContext and the information is good, otherwise false. Definition at line 132 of file AppContextInfo.java.