|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jniwrapper.Library
This class provides operations with a native code library.
The Library
class is responsible for providing
Function
class instances that are used for calling
functions from the native code libraries.
Unlike standard functionality provides a library can be dynamically
loaded and unloaded.
Field Summary | |
static java.lang.String |
NATIVE_CODE
|
Constructor Summary | |
Library(java.lang.String name)
Constructs library using its name. |
Method Summary | |
static LibraryLoader |
getDefaultLibraryLoader()
Returns library loader that is used in methods that do not take a library loader as an argument. |
Function |
getFunction(java.lang.String name)
Convenience method for getting a function when parameter types do affect loaded function. |
Function |
getFunction(java.lang.String name,
java.lang.Class[] paramTypes)
This returns a Function object that reflects the exporeted
native function from the library. |
java.lang.String |
getName()
Returns library name. |
boolean |
isLoaded()
Returns loaded status of this library. |
void |
load()
Loads library by its name using default mechanism |
void |
load(java.io.File directory)
Loads library from the passed directory. |
void |
load(LibraryLoader loader)
Loads library using a given library loader. |
static void |
loadNativeCode()
Initializes the native support library using standard library search behaviour and pre-defined native library name. |
static void |
loadNativeCode(LibraryLoader loader)
Loads native support library using a specified library loader. |
static void |
loadNativeCode(java.lang.String nativeSupportPath)
Loads native support library from the passed full file name. |
static void |
setDefaultLibraryLoader(LibraryLoader libraryLoader)
Sets library loader that is used in methods that do not take a library loader as an argument. |
protected void |
unload()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String NATIVE_CODE
Constructor Detail |
public Library(java.lang.String name)
Method Detail |
public static void loadNativeCode(LibraryLoader loader) throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
java.lang.UnsatisfiedLinkError
public static void loadNativeCode(java.lang.String nativeSupportPath) throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
java.lang.UnsatisfiedLinkError
public static void loadNativeCode() throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
java.lang.SecurityException
java.lang.UnsatisfiedLinkError
public void load() throws LibraryNotFoundException
LibraryNotFoundException
public void load(java.io.File directory) throws LibraryNotFoundException
LibraryNotFoundException
public void load(LibraryLoader loader) throws LibraryNotFoundException
LibraryNotFoundException
protected void unload()
public boolean isLoaded()
public java.lang.String getName()
public Function getFunction(java.lang.String name, java.lang.Class[] paramTypes) throws NoSuchFunctionException, LibraryNotFoundException
Function
object that reflects the exporeted
native function from the library.
NoSuchFunctionException
LibraryNotFoundException
public Function getFunction(java.lang.String name) throws NoSuchFunctionException, LibraryNotFoundException
NoSuchFunctionException
LibraryNotFoundException
public static LibraryLoader getDefaultLibraryLoader()
public static void setDefaultLibraryLoader(LibraryLoader libraryLoader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |