Class NativeLibrary


  • public abstract class NativeLibrary
    extends java.lang.Object
    This 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
      void ensureLoaded()
      loads libraries (if not loaded yet), throws on failure
      java.lang.UnsatisfiedLinkError getError()  
      boolean loadLibraries()
      safe loading of native libs
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.UnsatisfiedLinkError
        loads libraries (if not loaded yet), throws on failure
        Throws:
        java.lang.UnsatisfiedLinkError - UnsatisfiedLinkError
      • getError

        @Nullable
        public java.lang.UnsatisfiedLinkError getError()