Class ApplicationInstance

java.lang.Object
net.sourceforge.jnlp.runtime.ApplicationInstance
Direct Known Subclasses:
AppletInstance

public class ApplicationInstance extends 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.
Version:
$Revision: 1.15 $
Author:
Jon A. Maxwell (JAM) - initial author
  • Field Details

  • Constructor Details

    • ApplicationInstance

      public ApplicationInstance(JNLPFile file, ThreadGroup group, JNLPClassLoader loader)
      Create an application instance for the file. This should be done in the appropriate ThreadGroup only.
      Parameters:
      file - jnlpfile for which the instance do exists
      group - thread group to which it belongs
      loader - loader for this application
  • Method Details

    • getBlackListedJnlpProperties

      public static Set<String> getBlackListedJnlpProperties()
    • initialize

      public void initialize()
      Initialize the application's environment (installs environment variables, etc).
    • 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 JNLPRuntime.exit).
      Overrides:
      finalize in class Object
    • getJNLPFile

      public JNLPFile getJNLPFile()
      Returns the jnlpfile on which is this application based
      Returns:
      JNLP file for this task.
    • getTitle

      public String getTitle()
      Returns the application title.
      Returns:
      the title of this application
    • isRunning

      public boolean isRunning()
      Returns whether the application is running.
      Returns:
      state of application
    • destroy

      public void destroy()
      Stop the application and destroy its resources.
    • getThreadGroup

      public ThreadGroup getThreadGroup() throws IllegalStateException
      Returns the thread group.
      Returns:
      thread group of this application, unless it is stopped
      Throws:
      IllegalStateException - if the app is not running
    • getClassLoader

      public JNLPClassLoader getClassLoader() throws IllegalStateException
      Returns the classloader.
      Returns:
      the classloader of this application, unless it is stopped
      Throws:
      IllegalStateException - if the app is not running
    • getMainClassName

      public String getMainClassName() throws IOException
      Throws:
      IOException
    • isSigned

      public boolean isSigned()
      Returns:
      whether or not this application is signed.