public class AppManager extends java.lang.Object implements Singleton
This is a fairly low-level facility; don't use it unless you know what you're doing. See AppLib for more user-friendly App methods.
Copyright 2004-2007 Partner Software, Inc.
| Modifier and Type | Method and Description |
|---|---|
void |
addShutdownTask(java.lang.Runnable newTask)
Adds a Runnable task that will be run before the system is shutdown.
|
boolean |
appExists(java.lang.String appName)
Returs true if the given String is a valid app name.
|
java.util.List<java.lang.String> |
listApps()
Lists available apps.
|
void |
popAppContext(java.lang.String contextName)
Pops the last named app context from the current thread's app stack.
|
void |
popGuiAppContext(java.lang.String contextName)
Removes a GUI app context from the list of active GUI contexts.
|
void |
pushAppContext(java.lang.String contextName)
Pushes a new, named app context onto the current thread's app stack.
|
void |
pushGuiAppContext(java.lang.String contextName)
Adds a new GUI app context to the list of active GUI contexts.
|
void |
runApp(java.lang.String appName)
Runs the named app script using runApp(Script).
|
void |
runAppAndThrowException(java.lang.String appName)
Runs the named app.
|
void |
runAppThreaded(Script runme)
Runs an app in a new thread.
|
void |
runAppThreaded(java.lang.String appName)
Runs the named app script in a separate thread.
|
void |
shutdown()
Shuts down all apps and exits the system.
|
static AppManager |
singleton()
The singleton instance of AppManager.
|
public static AppManager singleton()
public boolean appExists(java.lang.String appName)
public java.util.List<java.lang.String> listApps()
public void runApp(java.lang.String appName)
appName - name of app.java.lang.IllegalArgumentException - if there is no app of the given name.public void runAppAndThrowException(java.lang.String appName)
throws java.lang.Throwable
appName - name of app.java.lang.IllegalArgumentException - if there is no app of the given name.java.lang.Throwable - if anything whatsoever happenspublic void runAppThreaded(java.lang.String appName)
appName - name of app.java.lang.IllegalArgumentException - if there is no app of the given name.public void runAppThreaded(Script runme)
runme - script to runpublic void pushAppContext(java.lang.String contextName)
This method should only be used by classes in the app framework.
contextName - name of app context (usually the script name)public void popAppContext(java.lang.String contextName)
IF this is the last app context on the stack, AND there are no other app contexts on other threads, AND no other GUI app contexts running, THEN the Java VM will exit normally.
This method should only be used by classes in the app framework.
contextName - name of app context (usually the script name)public void pushGuiAppContext(java.lang.String contextName)
popGuiAppContext(String) method should be called when
the GUI closes (usually on window exit).
contextName - name of app context (usually the window or application name)public void popGuiAppContext(java.lang.String contextName)
pushGuiAppContext(String) method must have been called
previously. Call this method when the GUI closes (usually on window
exit). IF this is the last GUI app context in the list, AND
there are no other app contexts on other threads, THEN the Java VM
will exit normally.
contextName - name of app context (usually the window or application name)public void addShutdownTask(java.lang.Runnable newTask)
newTask - public void shutdown()