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.
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
initMutex
mutex to wait on, for initialization
|
static java.lang.String |
STDERR_FILE |
static java.lang.String |
STDOUT_FILE |
Constructor and Description |
---|
JNLPRuntime() |
Modifier and Type | Method and Description |
---|---|
static void |
disableExit()
Disables applets from calling exit.
|
static ApplicationInstance |
getApplication()
Return the current Application, or null if none can be
determined.
|
static DeploymentConfiguration |
getConfiguration()
Gets the Configuration associated with this runtime
|
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 boolean |
getForksAllowed()
Returns true if the current runtime will fork
|
static java.util.List<java.lang.String> |
getInitialArguments() |
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 SecurityDialogMessageHandler |
getSecurityDialogHandler() |
static java.awt.Image |
getWindowIcon()
Returns the window icon.
|
static void |
initialize(boolean isApplication)
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 boolean |
isTrustAll() |
static boolean |
isUnix() |
static boolean |
isVerifying()
Returns whether we are verifying code signing.
|
static boolean |
isWebstartApplication()
Returns true if a webstart application has been initialized, and false
for a plugin applet.
|
static boolean |
isWindows() |
static void |
markNetxRunning()
Indicate that netx is running by creating the
JNLPRuntime#INSTANCE_FILE and
acquiring a shared lock on it |
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 |
setForksAllowed(boolean value) |
static void |
setHeadless(boolean enabled)
Sets whether the JNLP client will use any AWT/Swing
components.
|
static void |
setInitialArgments(java.util.List<java.lang.String> args) |
static void |
setRedirectStreams(boolean redirect)
Sets whether the standard output/error streams should be redirected to
the loggging files.
|
static void |
setSecurityEnabled(boolean enabled)
Sets whether to enable the secure runtime environment.
|
static void |
setVerify(boolean enabled)
Sets whether we will verify code signing.
|
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 java.lang.Object initMutex
public static final java.lang.String STDERR_FILE
public static final java.lang.String STDOUT_FILE
public static boolean isInitialized()
public static void initialize(boolean isApplication) throws java.lang.IllegalStateException
This method should be called from the main AppContext/Thread.
This method cannot be called more than once. Once initialized, methods that alter the runtime can only be called by the exit class.
isApplication
- is true if a webstart application is being initializedjava.lang.IllegalStateException
- if the runtime was previously initializedpublic static DeploymentConfiguration getConfiguration()
DeploymentConfiguration
object that can be queried to
find relevant configuration settingspublic static boolean isWebstartApplication()
public 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 boolean isVerifying()
public static void setHeadless(boolean enabled)
java.awt.headless=true
).java.lang.IllegalStateException
- if the runtime was previously initializedpublic static void setVerify(boolean enabled)
java.lang.IllegalStateException
- if the runtime was previously initializedpublic static boolean isSecurityEnabled()
public static void setSecurityEnabled(boolean enabled)
enabled
- whether security should be enabledjava.lang.IllegalStateException
- if the runtime is already initializedpublic static SecurityDialogMessageHandler getSecurityDialogHandler()
SecurityDialogMessageHandler
that should be used to
post security dialog messagespublic static void setExitClass(java.lang.Class exitClass)
java.lang.IllegalStateException
- if caller is not the exit classpublic static void disableExit()
public static ApplicationInstance getApplication()
public static boolean isDebug()
public static void setDebug(boolean enabled)
java.lang.IllegalStateException
- if caller is not the exit classpublic static void setRedirectStreams(boolean redirect)
java.lang.IllegalStateException
- if the runtime has already been initializedpublic 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 stringpublic static boolean getForksAllowed()
public static void setForksAllowed(boolean value)
public static boolean isWindows()
public static boolean isUnix()
public static void setInitialArgments(java.util.List<java.lang.String> args)
public static java.util.List<java.lang.String> getInitialArguments()
public static void markNetxRunning()
JNLPRuntime#INSTANCE_FILE
and
acquiring a shared lock on itpublic static boolean isTrustAll()