diff options
author | kbr <[email protected]> | 2007-06-28 23:04:24 +0000 |
---|---|---|
committer | kbr <[email protected]> | 2007-06-28 23:04:24 +0000 |
commit | 9f39a3c23f127d02dbcf51800cd88b40ceed7329 (patch) | |
tree | ddd63253028d8069cdbd9ac8c223bbc69d1cbd59 /src/java/net | |
parent | 7f2ce67b36470786f6720763486e7ea4c1bc66fa (diff) |
Added support for the new JNLPAppletLauncher (http://applet-launcher.dev.java.net/)
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@555 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src/java/net')
-rwxr-xr-x | src/java/net/java/games/joal/impl/NativeLibLoader.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/java/net/java/games/joal/impl/NativeLibLoader.java b/src/java/net/java/games/joal/impl/NativeLibLoader.java index 8a240a1..1720825 100755 --- a/src/java/net/java/games/joal/impl/NativeLibLoader.java +++ b/src/java/net/java/games/joal/impl/NativeLibLoader.java @@ -36,6 +36,7 @@ package net.java.games.joal.impl; +import java.lang.reflect.Method; import java.security.*; import com.sun.gluegen.runtime.*; @@ -66,12 +67,12 @@ public class NativeLibLoader { // implementations like nvopenal.dll and "*oal.dll". // joal.dll matches this wildcard and a bug in OpenAL32.dll // causes a call through a null function pointer. - System.loadLibrary("joal_native"); + loadLibraryInternal("joal_native"); // Workaround for 4845371. // Make sure the first reference to the JNI GetDirectBufferAddress is done // from a privileged context so the VM's internal class lookups will succeed. - // FIXME: need to figure out an appropriate entry point to call + // FIXME: need to figure out an appropriate entry point to call for JOAL // JAWT jawt = new JAWT(); // JAWTFactory.JAWT_GetAWT(jawt); @@ -82,4 +83,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); + } + } } |