< prev index next >

modules/fxpackagerservices/src/main/java/jdk/packager/services/userjvmoptions/LauncherUserJvmOptions.java

Print this page
rev 9619 : imported patch 9-jake-fxpackager.patch


  35 
  36 /**
  37  *
  38  * Access the UserJVMOptions via a native library provided by the launcher.
  39  *
  40  * Do not instantiate this class directly, instead use
  41  * {@see jdk.packager.services.UserJvmOptionsService#getUserJVMDefaults()}
  42  * to get an instance.
  43  *
  44  * @since 8u40
  45  */
  46 final public class LauncherUserJvmOptions implements UserJvmOptionsService {
  47 
  48     private static final Object semaphore = new Object();
  49 
  50     static {
  51         try {
  52             checkAllPermissions();
  53             System.loadLibrary("packager");
  54         } catch (SecurityException se) {

  55             // fail to load, we will also throw on all public methods
  56         }
  57     }
  58 
  59     private static void checkAllPermissions() {
  60         final SecurityManager securityManager = System.getSecurityManager();
  61         if (securityManager != null) {
  62             securityManager.checkPermission(new AllPermission());
  63         }
  64     }
  65 
  66     /**
  67      * Access the default User JVM Option for a specific key
  68      *
  69      * @param option the key for the User JVM Option
  70      *
  71      * @return the default value of the user JVM Option.  Currently set user
  72      * values are not considered, and only the default is returned.  If there
  73      * is no default value then null is returned.
  74      */




  35 
  36 /**
  37  *
  38  * Access the UserJVMOptions via a native library provided by the launcher.
  39  *
  40  * Do not instantiate this class directly, instead use
  41  * {@see jdk.packager.services.UserJvmOptionsService#getUserJVMDefaults()}
  42  * to get an instance.
  43  *
  44  * @since 8u40
  45  */
  46 final public class LauncherUserJvmOptions implements UserJvmOptionsService {
  47 
  48     private static final Object semaphore = new Object();
  49 
  50     static {
  51         try {
  52             checkAllPermissions();
  53             System.loadLibrary("packager");
  54         } catch (SecurityException se) {
  55             se.printStackTrace(System.err);
  56             // fail to load, we will also throw on all public methods
  57         }
  58     }
  59 
  60     private static void checkAllPermissions() {
  61         final SecurityManager securityManager = System.getSecurityManager();
  62         if (securityManager != null) {
  63             securityManager.checkPermission(new AllPermission());
  64         }
  65     }
  66 
  67     /**
  68      * Access the default User JVM Option for a specific key
  69      *
  70      * @param option the key for the User JVM Option
  71      *
  72      * @return the default value of the user JVM Option.  Currently set user
  73      * values are not considered, and only the default is returned.  If there
  74      * is no default value then null is returned.
  75      */


< prev index next >