Class AistCVLoader

    • Method Detail

      • loadShared

        public static void loadShared()
        Exactly once per ClassLoader, attempt to load the native library (via System.loadLibrary(String) with Core.NATIVE_LIBRARY_NAME). If the first attempt fails, the native binary will be extracted from the classpath to a temporary location (which gets cleaned up on shutdown), that location is added to the java.library.path system property and ClassLoader.usr_paths, and then another call to load the library is made. Note this method uses reflection to gain access to private memory in ClassLoader as there's no documented method to augment the library path at runtime. Spurious calls are safe.
      • cleanupShared

        public static void cleanupShared()
        Removes the shared library path from the ClassLoader.usr_paths array, as well as to the java.library.path system property. Uses the reflection API to make the field accessible, and may be unsafe in environments with a security policy.
      • loadLocally

        public static void loadLocally()
        Exactly once per ClassLoader, extract the native binary from the classpath to a temporary location (which gets cleaned up on shutdown), and load that binary (via System.load(String)). Spurious calls are safe.