summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/runtime
diff options
context:
space:
mode:
authorKenneth Russel <kbrussel@alum.mit.edu>2007-07-04 01:15:31 +0000
committerKenneth Russel <kbrussel@alum.mit.edu>2007-07-04 01:15:31 +0000
commit65d923c910b4d90b91407f6d5fe266bc8e6571b1 (patch)
tree8a16a9cbd27befa010a9b620a146e33113f3525b /src/java/com/sun/gluegen/runtime
parentf031bb43a8e4e81abd85eca265023c70d14cc76d (diff)
Updated NativeLibLoader to work with JNLPAppletLauncher
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@67 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src/java/com/sun/gluegen/runtime')
-rwxr-xr-xsrc/java/com/sun/gluegen/runtime/NativeLibLoader.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/java/com/sun/gluegen/runtime/NativeLibLoader.java b/src/java/com/sun/gluegen/runtime/NativeLibLoader.java
index 4d57867..a879683 100755
--- a/src/java/com/sun/gluegen/runtime/NativeLibLoader.java
+++ b/src/java/com/sun/gluegen/runtime/NativeLibLoader.java
@@ -39,6 +39,7 @@
package com.sun.gluegen.runtime;
+import java.lang.reflect.Method;
import java.security.*;
/** Class providing control over whether GlueGen loads the native code
@@ -65,7 +66,7 @@ public class NativeLibLoader {
didLoading = true;
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- System.loadLibrary("gluegen-rt");
+ loadLibraryInternal("gluegen-rt");
return null;
}
});
@@ -73,4 +74,21 @@ public class NativeLibLoader {
}
}
}
+
+ private static void loadLibraryInternal(String libraryName) {
+ String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher");
+ boolean usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue();
+
+ if (usingJNLPAppletLauncher) {
+ try {
+ Class jnlpAppletLauncherClass = Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher");
+ Method jnlpLoadLibraryMethod = jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class });
+ jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ System.loadLibrary(libraryName);
+ }
+ }
}