Class NativeLibraryUtil
java.lang.Object
org.conscrypt.NativeLibraryUtil
A Utility to Call the
System.load(String)RESTRICTED or System.loadLibrary(String)RESTRICTED.
Because the System.load(String)RESTRICTED and System.loadLibrary(String)RESTRICTED are both
CallerSensitive, it will load the native library into its caller's ClassLoader.
In OSGi environment, we need this helper to delegate the calling to System.load(String)RESTRICTED
and it should be as simple as possible. It will be injected into the native library's
ClassLoader when it is undefined. And therefore, when the defined new helper is invoked,
the native library would be loaded into the native library's ClassLoader, not the
caller's ClassLoader.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NativeLibraryUtil
private NativeLibraryUtil()
-
-
Method Details
-
loadLibrary
- Parameters:
libName- - The native library path or nameabsolute- - Whether the native library will be loaded by path or by name
-