Class ApplicationInstance
java.lang.Object
net.sourceforge.jnlp.runtime.ApplicationInstance
- Direct Known Subclasses:
AppletInstance
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 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate static final Stringprivate static final Stringprivate final JNLPFilethe fileprivate final ThreadGroupthe thread groupprivate booleanwhether or not this application is signedprivate final EventListenerListlist of application listenersprivate final JNLPClassLoaderthe classloaderprivate static final Loggerprivate booleanwhether the application has stopped runningweak list of windows opened by the application -
Constructor Summary
ConstructorsConstructorDescriptionApplicationInstance(JNLPFile file, ThreadGroup group, JNLPClassLoader loader) Create an application instance for the file. -
Method Summary
Modifier and TypeMethodDescription(package private) voidAdds a window that this application opened.private List<PropertyDesc> collectPropertiesFromJnlpHierarchy(List<PropertyDesc> props, JNLPFile jnlpFile) Collects properties from the full hierarchy of JNLP filesvoiddestroy()Stop the application and destroy its resources.voidfinalize()Releases the application's resources before it is collected.private voidNotify listeners that the application has been terminated.Returns the classloader.Returns the jnlpfile on which is this application basedReturns the thread group.getTitle()Returns the application title.voidInitialize the application's environment (installs environment variables, etc).private voidInstall the environment variables.booleanReturns whether the application is running.booleanisSigned()private voidprivate voidsetSystemProperty(PropertyDesc propDesc)
-
Field Details
-
LOG
-
DEPLOYMENT_SYSPROP
- See Also:
-
DEPLOYMENT_SYSPROP_VALUE
- See Also:
-
BLACKLIST_FOR_JNLP_PROPERTIES
- See Also:
-
BLACKLISTED_PROPERTIES_SEPARATOR
- See Also:
-
file
the file -
group
the thread group -
loader
the classloader -
stopped
private boolean stoppedwhether the application has stopped running -
weakWindows
-
listeners
list of application listeners -
isSigned
private boolean isSignedwhether or not this application is signed
-
-
Constructor Details
-
ApplicationInstance
Create an application instance for the file. This should be done in the appropriateThreadGrouponly.- Parameters:
file- jnlpfile for which the instance do existsgroup- thread group to which it belongsloader- loader for this application
-
-
Method Details
-
getBlackListedJnlpProperties
-
fireDestroyed
private void fireDestroyed()Notify listeners that the application has been terminated. -
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). -
installEnvironment
private void installEnvironment()Install the environment variables. -
setSystemPropertiesFromJnlp
private void setSystemPropertiesFromJnlp() -
setSystemProperty
-
getJNLPFile
Returns the jnlpfile on which is this application based- Returns:
- JNLP file for this task.
-
getTitle
-
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
Returns the thread group.- Returns:
- thread group of this application, unless it is stopped
- Throws:
IllegalStateException- if the app is not running
-
getClassLoader
Returns the classloader.- Returns:
- the classloader of this application, unless it is stopped
- Throws:
IllegalStateException- if the app is not running
-
getMainClassName
- Throws:
IOException
-
addWindow
Adds a window that this application opened. When the application is disposed, these windows will also be disposed.- Parameters:
window- to be added
-
isSigned
public boolean isSigned()- Returns:
- whether or not this application is signed.
-
collectPropertiesFromJnlpHierarchy
private List<PropertyDesc> collectPropertiesFromJnlpHierarchy(List<PropertyDesc> props, JNLPFile jnlpFile) Collects properties from the full hierarchy of JNLP files- Parameters:
props- a list of all properties collected so farjnlpFile- the current tip of the jnlp hierarchy- Returns:
- a list of properties collected from the full hierarchy of JNLP files
-