Top Fields Constructors Methods
jnr.ffi

public final Class Library

extends Object
Class Inheritance
Imports
jnr.ffi.provider.LoadedLibrary, java.io.File, java.util.Collections, .List, .Map, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList

Deprecated

Use LibraryLoader instead.

Field Summary

Modifier and TypeField and Description
private static final Map<String, List<String>>
private final String
name

The name of this library

Constructor Summary

AccessConstructor and Description
private
Library(String libraryName)

Method Summary

Modifier and TypeMethod and Description
public static synchronized void
addLibraryPath(String
the name of the library to search for
libraryName
,
File
the path to search for the library in
path
)

Deprecated see LibraryLoader for the preferred interface to loading libraries.
Adds a custom search path for a library
public static Library
getInstance(String libraryName)

Deprecated
public static List<String>

Returns:

A List of String instances.
getLibraryPath
(String
The library to retrieve the path for.
libraryName
)

Deprecated see LibraryLoader for the preferred interface to loading libraries.
Gets the custom search path for a library.
public String
getName()

Deprecated
public static Runtime

Returns:

The runtime that loaded the library.
getRuntime
(Object
A library implementation as returned from LibraryLoader#load()
library
)

Gets the Runtime that loaded the library interface.
public static <
the interface class.
T
>
T

Returns:

an instance of interfaceclass that will call the native methods.
loadLibrary
(String
the name of the library to load
libraryName
,
Class<T>
the interface that describes the native library interface
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.
public static <
the interface type.
T
>
T

Returns:

an instance of interfaceclass that will call the native methods.
loadLibrary
(Class<T>
the interface that describes the native library interface
interfaceClass
,
String...
the name of the library to load
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.
public static <
the interface type.
T
>
T

Returns:

an instance of interfaceclass that will call the native methods.
loadLibrary
(String
the name of the library to load
libraryName
,
Class<T>
the interface that describes the native library interface
interfaceClass
,
Map<LibraryOption, ?>
options
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.
public static <
the interface type.
T
>
T

Returns:

an instance of interfaceclass that will call the native methods.
loadLibrary
(Class<T>
the interface that describes the native library interface
interfaceClass
,
Map<LibraryOption, ?>
options
libraryOptions
,
String...
the name of the library to load
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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

customSearchPathsback to summary
private static final Map<String, List<String>> customSearchPaths
nameback to summary
private final String name

The name of this library

Constructor Detail

Libraryback to summary
private Library(String libraryName)

Method Detail

addLibraryPathback to summary
public static synchronized 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:String

the name of the library to search for

path:File

the path to search for the library in

getInstanceback to summary
public static Library getInstance(String libraryName)

Deprecated

Annotations
@Deprecated
getLibraryPathback to summary
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:String

The library to retrieve the path for.

Returns:List<String>

A List of String instances.

getNameback to summary
public String getName()

Deprecated

Annotations
@Deprecated
getRuntimeback to summary
public static Runtime getRuntime(Object library)

Gets the Runtime that loaded the library interface.

Parameters
library:Object

A library implementation as returned from LibraryLoader#load()

Returns:Runtime

The runtime that loaded the library.

loadLibraryback to summary
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.

Parameters
<T>
the interface class.
libraryName:String

the name of the library to load

interfaceClass:Class<T>

the interface that describes the native library interface

Returns:T

an instance of interfaceclass that will call the native methods.

loadLibraryback to summary
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.

Parameters
<T>
the interface type.
interfaceClass:Class<T>

the interface that describes the native library interface

libraryNames:String[]

the name of the library to load

Returns:T

an instance of interfaceclass that will call the native methods.

loadLibraryback to summary
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.

Parameters
<T>
the interface type.
libraryName:String

the name of the library to load

interfaceClass:Class<T>

the interface that describes the native library interface

libraryOptions:Map<LibraryOption, ?>

options

Returns:T

an instance of interfaceclass that will call the native methods.

loadLibraryback to summary
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.

Parameters
<T>
the interface type.
interfaceClass:Class<T>

the interface that describes the native library interface

libraryOptions:Map<LibraryOption, ?>

options

libraryNames:String[]

the name of the library to load

Returns:T

an instance of interfaceclass that will call the native methods.