netx.jnlp.runtime
Class JNLPRuntime

java.lang.Object
  |
  +--netx.jnlp.runtime.JNLPRuntime

public class JNLPRuntime
extends java.lang.Object

Configure and access the runtime environment. Provides methods to set the base directory where the cache and other information is stored and set the exit class. If an exit class is set, the JVM can only be exited by that class (all other calls attempt to shut down the calling JNLP application without stopping the JVM).

Version:
$Revision: 1.14 $
Author:
Jon A. Maxwell (JAM) - initial author

Constructor Summary
JNLPRuntime()
           
 
Method Summary
static ApplicationInstance getApplication()
          Return the current Application, or null if none can be determined.
static java.io.File getBaseDir()
          Return the base directory under which cache, persistence store, etc are to be stored.
static java.io.File getDefaultBaseDir()
          Returns the system default base dir for or if not set, prompts the user for the location.
static DownloadIndicator getDownloadIndicator()
          Returns the default download indicator.
static PropertiesFile getProperties()
          Return a PropertiesFile object backed by the runtime's properties file.
static UpdatePolicy getUpdatePolicy()
          Returns the default update policy.
static void initialize(java.io.File baseDir)
          Initialize the JNLP runtime environment (sets the security manager, security policy, etc).
static void initialize(java.io.File baseDir, boolean useSecurity)
          Initialize the JNLP runtime environment, optionally without the secure runtime environment; extreme caution should be exercised when disabling the secure runtime environment.
static boolean isDebug()
          Return whether debug statements for the JNLP client code should be printed.
static boolean isInitialized()
          Returns whether the JNLP runtime environment has been initialized.
static void setDownloadIndicator(DownloadIndicator indicator)
          Sets the default download indicator.
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 setUpdatePolicy(UpdatePolicy policy)
          Sets the default update policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNLPRuntime

public JNLPRuntime()
Method Detail

isInitialized

public static boolean isInitialized()
Returns whether the JNLP runtime environment has been initialized.

initialize

public static void initialize(java.io.File baseDir)
Initialize the JNLP runtime environment (sets the security manager, security policy, etc). This method cannot be called more than once.
Parameters:
baseDir - the director that contains the cache

initialize

public static void initialize(java.io.File baseDir,
                              boolean useSecurity)
Initialize the JNLP runtime environment, optionally without the secure runtime environment; extreme caution should be exercised when disabling the secure runtime environment. This method cannot be called more than once.
Parameters:
baseDir - the directory that contains the cache
useSecurity - whether to install the secure runtime environment

getDefaultBaseDir

public static java.io.File getDefaultBaseDir()
                                      throws java.io.IOException
Returns the system default base dir for or if not set, prompts the user for the location.
Returns:
the base dir, or null if the user canceled the dialog
Throws:
java.io.IOException - if there was an io exception

setExitClass

public 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. The exit class can only be set once.

getApplication

public static ApplicationInstance getApplication()
Return the current Application, or null if none can be determined.

getProperties

public static PropertiesFile getProperties()
Return a PropertiesFile object backed by the runtime's properties file.

getBaseDir

public static java.io.File getBaseDir()
Return the base directory under which cache, persistence store, etc are to be stored.

isDebug

public static boolean isDebug()
Return whether debug statements for the JNLP client code should be printed.

setUpdatePolicy

public static void setUpdatePolicy(UpdatePolicy policy)
Sets the default update policy.

getUpdatePolicy

public static UpdatePolicy getUpdatePolicy()
Returns the default update policy.

setDownloadIndicator

public static void setDownloadIndicator(DownloadIndicator indicator)
Sets the default download indicator.

getDownloadIndicator

public static DownloadIndicator getDownloadIndicator()
Returns the default download indicator.