diff options
author | Sven Gothel <[email protected]> | 2010-04-19 01:40:20 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-19 01:40:20 +0200 |
commit | a01cb3d59715a41153380f1977ec75263b762dc6 (patch) | |
tree | 0fc31f9e9b60d23c088ae8049b5c8d456398bc9f /src/java/com/jogamp/common/jvm/JNILibLoaderBase.java | |
parent | c7630f35befa1b8dbd365984f08c4efbc04488c1 (diff) |
Importing files from JOGL (preserving history)
git mv src/nativewindow/native/JVM_Tool.c src/native/common/JVM_Tool.c
git mv src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeLibLoaderBase.java src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
git mv src/nativewindow/classes/com/jogamp/nativewindow/impl/jvm/JVMUtil.java src/java/com/jogamp/common/jvm/JVMUtil.java
git mv src/nativewindow/classes/com/jogamp/nativewindow/impl/NWReflection.java src/java/com/jogamp/common/util/ReflectionUtil.java
Adding own JogampRuntimeException and Debug class
Diffstat (limited to 'src/java/com/jogamp/common/jvm/JNILibLoaderBase.java')
-rw-r--r-- | src/java/com/jogamp/common/jvm/JNILibLoaderBase.java | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java index c4f1d7e..b89cc8a 100644 --- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java +++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java @@ -37,18 +37,21 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.jogamp.nativewindow.impl; +package com.jogamp.common.jvm; // FIXME: refactor Java SE dependencies //import java.awt.Toolkit; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.AccessController; +import java.security.AccessControlContext; import java.security.PrivilegedAction; import java.util.HashSet; +import com.jogamp.common.impl.Debug; -public class NativeLibLoaderBase { - public static final boolean DEBUG = Debug.debug("NativeLibLoader"); +public class JNILibLoaderBase { + public static final boolean DEBUG = Debug.debug("JNILibLoader"); + private static final AccessControlContext localACC = AccessController.getContext(); public interface LoaderAction { /** @@ -127,16 +130,6 @@ public class NativeLibLoaderBase { } } - public static void loadNativeWindow(final String ossuffix) { - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - loadLibrary("nativewindow_"+ossuffix, null, false); - return null; - } - }); - } - - private static final Class customLauncherClass; private static final Method customLoadLibraryMethod; @@ -145,7 +138,7 @@ public class NativeLibLoaderBase { Class launcherClass = null; Method loadLibraryMethod = null; - if ( Debug.getBooleanProperty("sun.jnlp.applet.launcher", false) ) { + if ( Debug.getBooleanProperty("sun.jnlp.applet.launcher", false, localACC) ) { try { launcherClass = Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher"); loadLibraryMethod = launcherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class }); @@ -162,7 +155,7 @@ public class NativeLibLoaderBase { } if(null==launcherClass) { - String launcherClassName = Debug.getProperty("jnlp.launcher.class", false); + String launcherClassName = Debug.getProperty("jnlp.launcher.class", false, localACC); if(null!=launcherClassName) { try { launcherClass = Class.forName(launcherClassName); |