Package com.facebook.soloader
Class NativeLibrary
- java.lang.Object
-
- com.facebook.soloader.NativeLibrary
-
public abstract class NativeLibrary extends java.lang.ObjectThis is the base class for all the classes representing certain native library. For loading native libraries we should always inherit from this class and provide relevant information (libraries to load, code to test native call, dependencies?).This instances should be singletons provided by DI.
This is a basic template but could be improved if we find the need.
-
-
Method Summary
Modifier and Type Method Description voidensureLoaded()loads libraries (if not loaded yet), throws on failurejava.lang.UnsatisfiedLinkErrorgetError()booleanloadLibraries()safe loading of native libs
-
-
-
Method Detail
-
loadLibraries
@Nullable public boolean loadLibraries()
safe loading of native libs- Returns:
- true if native libs loaded properly, false otherwise
-
ensureLoaded
public void ensureLoaded() throws java.lang.UnsatisfiedLinkErrorloads libraries (if not loaded yet), throws on failure- Throws:
java.lang.UnsatisfiedLinkError- UnsatisfiedLinkError
-
getError
@Nullable public java.lang.UnsatisfiedLinkError getError()
-
-