netx.jnlp.runtime
public class JNLPRuntime extends java.lang.Object
The JNLP runtime can be locked to prevent further changes to the runtime environment except by a specified class. If set, only instances of the exit class can exit the JVM or change the JNLP runtime settings once the runtime has been initialized.
Constructor and Description |
---|
JNLPRuntime() |
Modifier and Type | Method and Description |
---|---|
static ApplicationInstance |
getApplication()
Return the current Application, or null if none can be
determined.
|
static java.io.File |
getBaseDir()
Return the base directory containing the cache, persistence
store, etc.
|
static java.io.File |
getDefaultBaseDir()
Returns the system default base dir for or if not set,
prompts the user for the location.
|
static DownloadIndicator |
getDefaultDownloadIndicator()
Returns the default download indicator.
|
static LaunchHandler |
getDefaultLaunchHandler()
Returns the default launch handler.
|
static UpdatePolicy |
getDefaultUpdatePolicy()
Returns the default update policy.
|
static java.lang.String |
getMessage(java.lang.String key)
Returns the localized resource string identified by the
specified key.
|
static java.lang.String |
getMessage(java.lang.String key,
java.lang.Object[] args)
Returns the localized resource string using the specified
arguments.
|
static PropertiesFile |
getProperties()
Return a PropertiesFile object backed by the runtime's
properties file.
|
static java.awt.Image |
getWindowIcon()
Returns the window icon.
|
static void |
initialize()
Initialize the JNLP runtime environment by installing the
security manager and security policy, initializing the JNLP
standard services, etc.
|
static boolean |
isDebug()
Return whether debug statements for the JNLP client code
should be printed.
|
static boolean |
isHeadless()
Returns whether the JNLP client will use any AWT/Swing
components.
|
static boolean |
isInitialized()
Returns whether the JNLP runtime environment has been
initialized.
|
static boolean |
isSecurityEnabled()
Returns whether the secure runtime environment is enabled.
|
static void |
setBaseDir(java.io.File baseDirectory)
Sets the base directory containing the cache, persistence
store, etc.
|
static void |
setDebug(boolean enabled)
Sets whether debug statements for the JNLP client code
should be printed to the standard output.
|
static void |
setDefaultDownloadIndicator(DownloadIndicator indicator)
Sets the default download indicator.
|
static void |
setDefaultLaunchHandler(LaunchHandler handler)
Sets the default launch handler.
|
static void |
setDefaultUpdatePolicy(UpdatePolicy policy)
Sets the default update policy.
|
static void |
setExitClass(java.lang.Class exitClass)
Set a class that can exit the JVM; if not set then any class
can exit the JVM.
|
static void |
setHeadless(boolean enabled)
Sets whether the JNLP client will use any AWT/Swing
components.
|
static void |
setSecurityEnabled(boolean enabled)
Sets whether to enable the secure runtime environment.
|
static void |
setWindowIcon(java.awt.Image image)
Sets the window icon that is displayed in Java applications
and applets instead of the default Java icon.
|
public static boolean isInitialized()
public static void initialize() throws java.lang.IllegalStateException
This method cannot be called more than once. Once initialized, methods that alter the runtime can only be called by the exit class.
java.lang.IllegalStateException
- if the runtime was previously initializedpublic static java.awt.Image getWindowIcon()
public static void setWindowIcon(java.awt.Image image)
java.lang.IllegalStateException
- if caller is not the exit classpublic static boolean isHeadless()
public static void setHeadless(boolean enabled)
java.awt.headless=true
).java.lang.IllegalStateException
- if the runtime was previously initializedpublic static java.io.File getBaseDir()
public static void setBaseDir(java.io.File baseDirectory)
java.lang.IllegalStateException
- if caller is not the exit classpublic static boolean isSecurityEnabled()
public static void setSecurityEnabled(boolean enabled)
enabled
- whether security should be enabledjava.lang.IllegalStateException
- if the runtime is already initializedpublic static java.io.File getDefaultBaseDir()
java.io.IOException
- if there was an io exceptionpublic static void setExitClass(java.lang.Class exitClass)
java.lang.IllegalStateException
- if caller is not the exit classpublic static ApplicationInstance getApplication()
public static PropertiesFile getProperties()
public static boolean isDebug()
public static void setDebug(boolean enabled)
java.lang.IllegalStateException
- if caller is not the exit classpublic static void setDefaultUpdatePolicy(UpdatePolicy policy)
java.lang.IllegalStateException
- if caller is not the exit classpublic static UpdatePolicy getDefaultUpdatePolicy()
public static void setDefaultLaunchHandler(LaunchHandler handler)
public static LaunchHandler getDefaultLaunchHandler()
public static void setDefaultDownloadIndicator(DownloadIndicator indicator)
java.lang.IllegalStateException
- if caller is not the exit classpublic static DownloadIndicator getDefaultDownloadIndicator()
public static java.lang.String getMessage(java.lang.String key)
public static java.lang.String getMessage(java.lang.String key, java.lang.Object[] args)
args
- the formatting arguments to the resource string