Package electrostatic4j.snaploader
Enum Class LoadingCriterion
- All Implemented Interfaces:
Serializable,Comparable<LoadingCriterion>,Constable
Represents an extraction/loading criterion type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExtracts the native binary to the extraction directory, ignoring its existence (the newly extracted binary will replace the current file).Extracts the native binary only if the current binary isn't present on the extraction directory.Commands to load a native dynamic library from the system directories. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadingCriterionReturns the enum constant of this class with the specified name.static LoadingCriterion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLEAN_EXTRACTION
Extracts the native binary to the extraction directory, ignoring its existence (the newly extracted binary will replace the current file). -
INCREMENTAL_LOADING
Extracts the native binary only if the current binary isn't present on the extraction directory. -
SYSTEM_LOAD
Commands to load a native dynamic library from the system directories.This criterion instructs the loader to search for the native library in predefined system locations, relying on the operating system's dynamic linker to resolve the library. The library must be pre-installed and accessible through standard system paths.
System Library Search PathsThe specific directories searched depend on the operating system:
- Linux: Searches in:
- Directories specified in
LD_LIBRARY_PATH. - System-wide library directories:
/lib/usr/lib/usr/local/lib- Paths configured in
/etc/ld.so.confand/etc/ld.so.conf.d/.
- Directories specified in
- Windows: Searches in:
- Directories listed in the
PATHenvironment variable. - System directories:
C:\Windows\System32(for 64-bit DLLs)C:\Windows\SysWOW64(for 32-bit DLLs on 64-bit Windows)- Current working directory of the running process.
- Directories listed in the
- macOS: Searches in:
- Directories specified in
DYLD_LIBRARY_PATH. - System library locations:
/usr/lib/usr/local/lib/System/Library/Frameworks/(for framework-based libraries).
- Directories specified in
- Android: Searches in:
- Application-specific native library directories:
/data/data/<package>/lib- Native library folders inside the APK:
/lib/armeabi-v7a//lib/arm64-v8a//lib/x86//lib/x86_64/
- System native library locations:
/system/lib(for 32-bit libraries)./system/lib64(for 64-bit libraries).
- Application-specific native library directories:
This approach requires the library to be present on the system beforehand. If the library is missing, the loading process will fail with an
UnsatisfiedLinkError. To ensure compatibility across different systems, consider providing a fallback mechanism to extract the library dynamically whenever required viaNativeBinaryLoadingListener.onLoadingFailure(NativeBinaryLoader, CallingStackMetaData). - Linux: Searches in:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-