Package jnr.ffi
Class Library
- java.lang.Object
-
- jnr.ffi.Library
-
public final class Library extends Object
Deprecated.UseLibraryLoaderinstead.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddLibraryPath(String libraryName, File path)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.static LibrarygetInstance(String libraryName)Deprecated.static List<String>getLibraryPath(String libraryName)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.StringgetName()Deprecated.static RuntimegetRuntime(Object library)Deprecated.static <T> TloadLibrary(Class<T> interfaceClass, String... libraryNames)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.static <T> TloadLibrary(Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions, String... libraryNames)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.static <T> TloadLibrary(String libraryName, Class<T> interfaceClass)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.static <T> TloadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions)Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.
-
-
-
Method Detail
-
getRuntime
public static Runtime getRuntime(Object library)
Deprecated.Gets theRuntimethat loaded the library interface.- Parameters:
library- A library implementation as returned fromLibraryLoader.load()- Returns:
- The runtime that loaded the library.
-
loadLibrary
public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass)
Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClassto native methods in the library.- Type Parameters:
T- the interface class.- Parameters:
libraryName- the name of the library to loadinterfaceClass- the interface that describes the native library interface- Returns:
- an instance of
interfaceclassthat will call the native methods.
-
loadLibrary
public static <T> T loadLibrary(Class<T> interfaceClass, String... libraryNames)
Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClassto native methods in the library.- Type Parameters:
T- the interface type.- Parameters:
libraryNames- the name of the library to loadinterfaceClass- the interface that describes the native library interface- Returns:
- an instance of
interfaceclassthat will call the native methods.
-
loadLibrary
public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions)
Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClassto native methods in the library.- Type Parameters:
T- the interface type.- Parameters:
libraryName- the name of the library to loadinterfaceClass- the interface that describes the native library interfacelibraryOptions- options- Returns:
- an instance of
interfaceclassthat will call the native methods.
-
loadLibrary
public static <T> T loadLibrary(Class<T> interfaceClass, Map<LibraryOption,?> libraryOptions, String... libraryNames)
Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClassto native methods in the library.- Type Parameters:
T- the interface type.- Parameters:
libraryNames- the name of the library to loadinterfaceClass- the interface that describes the native library interfacelibraryOptions- options- Returns:
- an instance of
interfaceclassthat will call the native methods.
-
addLibraryPath
public static void addLibraryPath(String libraryName, File path)
Deprecated.seeLibraryLoaderfor the preferred interface to loading libraries.Adds a custom search path for a library- Parameters:
libraryName- the name of the library to search forpath- the path to search for the library in
-
getLibraryPath
public static List<String> getLibraryPath(String libraryName)
Deprecated.seeLibraryLoaderfor 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
ListofStringinstances.
-
getInstance
@Deprecated public static Library getInstance(String libraryName)
Deprecated.
-
getName
@Deprecated public String getName()
Deprecated.
-
-