|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.runtime.DynamicLibrary
public final class DynamicLibrary
Interface to the dynamic libraries of our underlying operating system.
Field Summary | |
---|---|
private static ImmutableEntryHashMapRVM<String,DynamicLibrary> |
dynamicLibraries
Currently loaded dynamic libraries. |
private Address |
jniOnLoad
Address of JNI_OnLoad method |
private Address |
jniOnUnload
Address of JNI_OnUnLoad |
private Address |
libHandler
Value returned from dlopen |
private String |
libName
The name of the library |
Constructor Summary | |
---|---|
private |
DynamicLibrary(String libraryName)
Load a dynamic library and maintain it in this object. |
Method Summary | |
---|---|
static void |
boot()
Add symbol for the boot image runner to find symbols within it. |
private void |
callOnLoad()
Called after we've successfully loaded the shared library |
private static void |
checkJNIVersion(int version)
Check JNI version is ≤ 1.4 and if not throw an UnsatisfiedLinkError |
void |
clean()
Tell the operating system to remove the dynamic library from the system space. |
private Address |
getJNI_OnLoad()
Get the unique JNI_OnLoad symbol associated with this library |
private Address |
getJNI_OnUnload()
Get the unique JNI_OnUnload symbol associated with this library |
String |
getLibName()
|
Address |
getSymbol(String symbolName)
look up this dynamic library for a symbol |
static int |
load(String libname)
Load a dynamic library |
static Address |
resolveSymbol(String symbol)
Resolve a symbol to an address in a currently loaded dynamic library. |
private static int |
runJNI_OnLoad(Address JNI_OnLoadAddress)
Method call to run the onload method. |
String |
toString()
|
void |
unload()
unload a dynamic library |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final ImmutableEntryHashMapRVM<String,DynamicLibrary> dynamicLibraries
private final String libName
private final Address libHandler
private final Address jniOnLoad
private final Address jniOnUnload
Constructor Detail |
---|
private DynamicLibrary(String libraryName)
libraryName
- library nameMethod Detail |
---|
public static void boot()
private Address getJNI_OnLoad()
private Address getJNI_OnUnload()
private void callOnLoad()
private static int runJNI_OnLoad(Address JNI_OnLoadAddress)
JNI_OnLoadAddress
- address of JNI_OnLoad function
private static void checkJNIVersion(int version)
version
- to checkpublic String getLibName()
public Address getSymbol(String symbolName)
symbolName
- symbol name
Address
of the symbol system handler
(actually an address to an AixLinkage triplet).
(-1: not found or couldn't be created)public void unload()
public void clean()
public String toString()
toString
in class Object
public static int load(String libname)
libname
- the name of the library to load.
public static Address resolveSymbol(String symbol)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |