public class NativeLoader
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getLibraryPath(java.lang.String shortName)
Get the path of a loaded shared library.
|
static int |
getSoSourcesVersion()
Get the version of the loader used.
|
static void |
init(NativeLoaderDelegate delegate)
Initializes native code loading for this app.
|
static void |
initIfUninitialized(NativeLoaderDelegate delegate)
Perform an initialization only if
NativeLoader has not already been initialized. |
static boolean |
isInitialized()
Determine whether
NativeLoader has already been initialized. |
static boolean |
loadLibrary(java.lang.String shortName) |
static boolean |
loadLibrary(java.lang.String shortName,
int flags)
Load a shared library, initializing any JNI binding it contains.
|
public static boolean loadLibrary(java.lang.String shortName)
public static boolean loadLibrary(java.lang.String shortName,
int flags)
shortName - Name of library to find, without "lib" prefix or ".so" suffixflags - 0 for default behavior, otherwise NativeLoaderDelegate defines other behaviors.public static java.lang.String getLibraryPath(java.lang.String shortName)
throws java.io.IOException
shortName - Name of library to find, without "lib" prefix or ".so" suffixjava.io.IOExceptionpublic static int getSoSourcesVersion()
public static void init(NativeLoaderDelegate delegate)
loadLibrary(String).delegate - Delegate to use for all loadLibrary calls.public static boolean isInitialized()
NativeLoader has already been initialized. This method should not
normally be used, because initialization should be performed only once during app startup.
However, libraries that want to provide a default initialization for NativeLoader to
hide its existence from the app can use this method to avoid re-initializing.init(NativeLoaderDelegate) has been called.public static void initIfUninitialized(NativeLoaderDelegate delegate)
NativeLoader has not already been initialized. This
protects against race conditions where isInitialized and init are called by multiple threads
and both threads end up trying to perform an initialization