diff options
author | Sven Gothel <[email protected]> | 2011-09-22 00:29:59 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-22 00:29:59 +0200 |
commit | 0a45d6ca9b9a8d92b5e4c147be94fad8de344816 (patch) | |
tree | 29a6aa0dad752529209abd4d56b7e4b65ba40aa3 /src/java/com/jogamp/common/jvm | |
parent | def691b009132463f8ec8efabd0d72768235dcf5 (diff) |
JNILibLoaderBase/TempJarCache: Prepare for loadLibrary(..) out of cached JARs
- JNILibLoaderBase: If TempJarCache is active, try find native library in cached JARs
- TempJarCache: Add bootstrabNativeLib(..) allowing bootstraping gluegen-rt from JAR w/o needing it
- JARUtil: minor edits (final)
Diffstat (limited to 'src/java/com/jogamp/common/jvm')
-rw-r--r-- | src/java/com/jogamp/common/jvm/JNILibLoaderBase.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java index 161f0c4..44cbd14 100644 --- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java +++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java @@ -44,6 +44,9 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.AccessControlContext; import java.util.HashSet; + +import com.jogamp.common.util.cache.TempJarCache; + import jogamp.common.Debug; public class JNILibLoaderBase { @@ -148,7 +151,6 @@ public class JNILibLoaderBase { // private static final Class<?> customLauncherClass; private static final Method customLoadLibraryMethod; - // FIXME centralize logging static { final String sunAppletLauncherProperty = "sun.jnlp.applet.launcher"; final String sunAppletLauncherClassName = "org.jdesktop.applet.util.JNLPAppletLauncher"; @@ -222,7 +224,22 @@ public class JNILibLoaderBase { throw (UnsatisfiedLinkError) new UnsatisfiedLinkError("can not load library "+libraryName).initCause(e); } } else { + if(TempJarCache.isInitialized()) { + final String fullLibraryName = TempJarCache.findLibrary(libraryName); + if(null != fullLibraryName) { + if(DEBUG) { + System.err.println("JNILibLoaderBase.loadLibraryInternal("+libraryName+") -> System.load("+fullLibraryName+") (TempJarCache)"); + } + System.load(fullLibraryName); + return; // done + } else if(DEBUG) { + System.err.println("JNILibLoaderBase.loadLibraryInternal("+libraryName+") -> TempJarCache not mapped"); + } + } // System.err.println("sun.boot.library.path=" + Debug.getProperty("sun.boot.library.path", false)); + if(DEBUG) { + System.err.println("JNILibLoaderBase.loadLibraryInternal("+libraryName+") -> System.loadLibrary("+libraryName+")"); + } System.loadLibrary(libraryName); } } |