netx.jnlp.runtime
Class ApplicationInstance
java.lang.Object
netx.jnlp.runtime.ApplicationInstance
public class ApplicationInstance
extends java.lang.Object
Represents a running instance of an application described in a
JNLPFile. This class provides a way to track the application's
resources and destroy the application.
ApplicationInstance
public ApplicationInstance(JNLPFile file,
ThreadGroup group,
ClassLoader loader)
Create an application instance for the file.
addApplicationListener
public void addApplicationListener(ApplicationListener listener)
Add an Application listener
addWindow
protected void addWindow(Window window)
Adds a window that this application opened. When the
application is disposed, these windows will also be disposed.
destroy
public void destroy()
Stop the application and destroy its resources.
finalize
public void finalize()
Releases the application's resources before it is collected.
Only collectable if classloader and thread group are
also collectable so basically is almost never called (an
application would have to close its windows and exit its
threads but not call System.exit).
fireDestroyed
protected void fireDestroyed()
Notify listeners that the application has been terminated.
getClassLoader
public ClassLoader getClassLoader()
throws IllegalStateException
Returns the classloader.
getJNLPFile
public JNLPFile getJNLPFile()
Returns the JNLP file for this task.
getThreadGroup
public ThreadGroup getThreadGroup()
throws IllegalStateException
Returns the thread group.
getTitle
public String getTitle()
Returns the application title.
initialize
public void initialize()
Initialize the application's environment (installs
environment variables, etc).
installEnvironment
(package private) void installEnvironment()
Install the environment variables.
isRunning
public boolean isRunning()
Returns whether the application is running.
removeApplicationListener
public void removeApplicationListener(ApplicationListener listener)
Remove an Application Listener