com.jogamp.common.jvm
Class JNILibLoaderBase
java.lang.Object
com.jogamp.common.jvm.JNILibLoaderBase
public class JNILibLoaderBase
- extends Object
Field Summary |
static boolean |
DEBUG
|
Method Summary |
static void |
addLoaded(String libName)
|
static boolean |
addNativeJarLibs(Class<?> classFromJavaJar,
String nativeJarBaseName)
|
static boolean |
addNativeJarLibs(Class<?> classFromJavaJar,
String allNativeJarBaseName,
String[] atomicNativeJarBaseNames)
|
static void |
disableLoading()
|
static void |
enableLoading()
|
static boolean |
isLoaded(String libName)
|
protected static boolean |
loadLibrary(String libname,
boolean ignoreError,
ClassLoader cl)
Loads the library specified by libname, using the JNILibLoaderBase.LoaderAction set by setLoadingAction(LoaderAction) .
The implementation should ignore, if the library has been loaded already.
|
protected static void |
loadLibrary(String libname,
String[] preload,
boolean preloadIgnoreError,
ClassLoader cl)
Loads the library specified by libname, using the JNILibLoaderBase.LoaderAction set by setLoadingAction(LoaderAction) .
Optionally preloads the libraries specified by preload.
The implementation should ignore, if any library has been loaded already.
|
static void |
setLoadingAction(JNILibLoaderBase.LoaderAction action)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static final boolean DEBUG
JNILibLoaderBase
public JNILibLoaderBase()
isLoaded
public static boolean isLoaded(String libName)
addLoaded
public static void addLoaded(String libName)
disableLoading
public static void disableLoading()
enableLoading
public static void enableLoading()
setLoadingAction
public static void setLoadingAction(JNILibLoaderBase.LoaderAction action)
addNativeJarLibs
public static final boolean addNativeJarLibs(Class<?> classFromJavaJar,
String nativeJarBaseName)
- Parameters:
classFromJavaJar
- GLProfilenativeJarBaseName
- jogl-all
- Returns:
- true if the native JAR file loaded successful or were loaded already, false in case of an error
addNativeJarLibs
public static boolean addNativeJarLibs(Class<?> classFromJavaJar,
String allNativeJarBaseName,
String[] atomicNativeJarBaseNames)
- Parameters:
classFromJavaJar
- A class file to determine the base URL of the native JAR files, eg.: GLProfile.classallNativeJarBaseName
- Attempt to use the 'all' native JAR variant first, if exists. Eg. "jogl-all"atomicNativeJarBaseNames
- Fallback to use all the atomic native JAR files, eg. [ "nativewindow", "jogl", "newt" ]
- Returns:
- true if either the 'all' native JAR or all of the atomic native JARs loaded successful or were loaded already,
false in case of an error
loadLibrary
protected static boolean loadLibrary(String libname,
boolean ignoreError,
ClassLoader cl)
- Loads the library specified by libname, using the
JNILibLoaderBase.LoaderAction
set by setLoadingAction(LoaderAction)
.
The implementation should ignore, if the library has been loaded already.
- Parameters:
libname
- the library to loadignoreError
- if true, errors during loading the library should be ignoredcl
- optional ClassLoader, used to locate the library
- Returns:
- true if library loaded successful
loadLibrary
protected static void loadLibrary(String libname,
String[] preload,
boolean preloadIgnoreError,
ClassLoader cl)
- Loads the library specified by libname, using the
JNILibLoaderBase.LoaderAction
set by setLoadingAction(LoaderAction)
.
Optionally preloads the libraries specified by preload.
The implementation should ignore, if any library has been loaded already.
- Parameters:
libname
- the library to loadpreload
- the libraries to load before loading the main library if not nullpreloadIgnoreError
- if true, errors during loading the preload-libraries should be ignoredcl
- optional ClassLoader, used to locate the library