From 6b6d9f290242deabed6db03717d07f1889d17a8c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Dec 2011 16:46:33 +0100 Subject: Add TempJarCache usage --- .../jogamp/openal/ALDynamicLibraryBundleInfo.java | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'src/java/jogamp') diff --git a/src/java/jogamp/openal/ALDynamicLibraryBundleInfo.java b/src/java/jogamp/openal/ALDynamicLibraryBundleInfo.java index 3185f2b..e7791ba 100644 --- a/src/java/jogamp/openal/ALDynamicLibraryBundleInfo.java +++ b/src/java/jogamp/openal/ALDynamicLibraryBundleInfo.java @@ -28,14 +28,30 @@ package jogamp.openal; +import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.DynamicLibraryBundleInfo; +import com.jogamp.common.os.Platform; +import com.jogamp.common.util.cache.TempJarCache; + +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.*; public class ALDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { - private static List/**/ glueLibNames; + private static List glueLibNames; static { - glueLibNames = new ArrayList(); - + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + Platform.initSingleton(); + + if(TempJarCache.isInitialized()) { + JNILibLoaderBase.addNativeJarLibs(ALDynamicLibraryBundleInfo.class, "joal", null); + } + return null; + } + }); + + glueLibNames = new ArrayList(); glueLibNames.add("joal"); } @@ -48,14 +64,14 @@ public class ALDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { /** default **/ public boolean shallLookupGlobal() { return false; } - public final List/**/ getGlueLibNames() { + public final List getGlueLibNames() { return glueLibNames; } - public List getToolLibNames() { - List/**/ libNamesList = new ArrayList(); + public List> getToolLibNames() { + List> libNamesList = new ArrayList>(); - List/**/ alLibNames = new ArrayList(); + List alLibNames = new ArrayList(); // this is the default AL lib name, according to the spec alLibNames.add("libopenal.so.1"); // unix @@ -76,8 +92,8 @@ public class ALDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo { return libNamesList; } - public final List getToolGetProcAddressFuncNameList() { - List res = new ArrayList(); + public final List getToolGetProcAddressFuncNameList() { + List res = new ArrayList(); res.add("alGetProcAddress"); return res; } -- cgit v1.2.3