Package jnr.ffi

Class Library

java.lang.Object
jnr.ffi.Library

public final class Library extends Object
Deprecated.
Use LibraryLoader instead.
  • Field Details

    • customSearchPaths

      private static final Map<String,List<String>> customSearchPaths
      Deprecated.
    • name

      private final String name
      Deprecated.
      The name of this library
  • Constructor Details

    • Library

      private Library(String libraryName)
      Deprecated.
  • Method Details

    • getRuntime

      public static Runtime getRuntime(Object library)
      Gets the Runtime that loaded the library interface.
      Parameters:
      library - A library implementation as returned from LibraryLoader.load()
      Returns:
      The runtime that loaded the library.
    • loadLibrary

      public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Loads a native library and links the methods defined in interfaceClass to native methods in the library.
      Type Parameters:
      T - the interface class.
      Parameters:
      libraryName - the name of the library to load
      interfaceClass - the interface that describes the native library interface
      Returns:
      an instance of interfaceclass that will call the native methods.
    • loadLibrary

      public static <T> T loadLibrary(Class<T> interfaceClass, String... libraryNames)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Loads a native library and links the methods defined in interfaceClass to native methods in the library.
      Type Parameters:
      T - the interface type.
      Parameters:
      interfaceClass - the interface that describes the native library interface
      libraryNames - the name of the library to load
      Returns:
      an instance of interfaceclass that will call the native methods.
    • loadLibrary

      public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Loads a native library and links the methods defined in interfaceClass to native methods in the library.
      Type Parameters:
      T - the interface type.
      Parameters:
      libraryName - the name of the library to load
      interfaceClass - the interface that describes the native library interface
      libraryOptions - options
      Returns:
      an instance of interfaceclass that will call the native methods.
    • loadLibrary

      public static <T> T loadLibrary(Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions, String... libraryNames)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Loads a native library and links the methods defined in interfaceClass to native methods in the library.
      Type Parameters:
      T - the interface type.
      Parameters:
      interfaceClass - the interface that describes the native library interface
      libraryOptions - options
      libraryNames - the name of the library to load
      Returns:
      an instance of interfaceclass that will call the native methods.
    • addLibraryPath

      public static void addLibraryPath(String libraryName, File path)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Adds a custom search path for a library
      Parameters:
      libraryName - the name of the library to search for
      path - the path to search for the library in
    • getLibraryPath

      public static List<String> getLibraryPath(String libraryName)
      Deprecated.
      see LibraryLoader for the preferred interface to loading libraries.
      Gets the custom search path for a library.
      Parameters:
      libraryName - The library to retrieve the path for.
      Returns:
      A List of String instances.
    • getInstance

      @Deprecated public static Library getInstance(String libraryName)
      Deprecated.
    • getName

      @Deprecated public String getName()
      Deprecated.