Class NativeUtils

java.lang.Object
org.apache.bookkeeper.common.util.nativelib.NativeUtils

public final class NativeUtils extends Object
Utility class to load jni library from inside a JAR.
  • Field Details

  • Method Details

    • loadLibraryFromJar

      public static void loadLibraryFromJar(String path) throws Exception
      loads given library from the this jar. ie: this jar contains: /lib/pulsar-checksum.jnilib
      Parameters:
      path - : absolute path of the library in the jar
      if this jar contains: /lib/pulsar-checksum.jnilib then provide the same absolute path as input
      Throws:
      Exception
    • libType

      public static String libType()
      Returns jni library extension based on OS specification. Maven-nar generates jni library based on different OS : http://mark.donszelmann.org/maven-nar-plugin/aol.html (jni.extension)
      Returns:
      library type
    • checkArgument

      public static void checkArgument(boolean expression, @NonNull @NonNull Object errorMessage)