public class AppContextInfo extends Object
|Modifier and Type||Method and Description|
public AppContextInfo(String info)
public final boolean isValid()
trueif this instance has valid
public final ThreadGroup getCachedThreadGroup()
ThreadGroupbelonging to the last known
AppContextas queried via
null if no
AppContext has been queried.
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
AppContext, i.e. early from within the special threaded application.
public Thread invokeOnAppContextThread(boolean waitUntilDone, Runnable runnable, String threadBaseName)
Threadbelonging to the
update(String) is issued first, which returns
if the current thread belongs to an AppContext
In this case the
runnable is invoked on the current thread,
otherwise a new
Thread will be started.
true, waits until
runnableexecution is completed, otherwise returns immediately.
Runnableto be executed. If
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
Threadused to invoke the
runnable, which may be the current
Threador a newly created one, see above.
public final boolean update(String info)
AppContextinformation for the current ThreadGroup if uninitialized or
getCachedThreadGroup() for usage.
info- informal string for logging purposes
trueif the current ThreadGroup is mapped to an
AppContextand the information is good, otherwise false.
Copyright 2010 JogAmp Community.