| Modifier and Type | Class and Description |
|---|---|
| private static class | Library.DefaultLibrary
A handle to the current process |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | cache
A cache of opened libraries |
| private volatile int | disposed
Indicates whether this library has been disposed of. |
| private final Foreign | foreign
A handle to the foreign interface to keep it alive as long as this object is alive |
| public static final int | GLOBAL
All symbols in the library are made available to other libraries |
| private final long | handle
The native dl/LoadLibrary handle |
| private static final ThreadLocal | lastError
Stores the last error returned by a dlopen or dlsym call |
| public static final int | LAZY
Perform lazy binding. |
| public static final int | LOCAL
Symbols in this library are not made available to other libraries |
| private static final Object | lock
A lock used to serialize all dlopen/dlsym calls |
| private final String | name
The name of this |
| public static final int | NOW
Resolve all symbols when loading the library |
| private static final AtomicIntegerFieldUpdater |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static long | |
| protected void | finalize()
Overrides java. |
| public static final Library | Returns: ALibrary instance representing the named library, or
null if the library could not be opened.The name or path of the library to open. name, int The library flags (e.g. flags)LAZY, NOW, LOCAL, GLOBAL)Gets a handle for the named library. |
| public static final Library | Returns: ALibrary instance representing the default library.Gets a handle to the default library. |
| public static final String | Returns: AString describing the last error.Gets the current error string from dlopen/LoadLibrary. |
| public final long | Returns: The address of the symbol within the current address space.The name of the symbol to locate. name)Gets the address of a symbol within the |
| public static final Library | Returns: ALibrary instance representing the named library, or
null if the library cannot be opened.The name or path of the library to open. name, int The library flags (e.g. flags)LAZY, NOW, LOCAL, GLOBAL)Gets a handle for the named library Note This will not cache the instance, nor will it return a cached instance. |
| cache | back to summary |
|---|---|
| private static final Map<String, WeakReference<Library>> cache A cache of opened libraries | |
| disposed | back to summary |
|---|---|
| private volatile int disposed Indicates whether this library has been disposed of. | |
| foreign | back to summary |
|---|---|
| private final Foreign foreign A handle to the foreign interface to keep it alive as long as this object is alive | |
| GLOBAL | back to summary |
|---|---|
| public static final int GLOBAL All symbols in the library are made available to other libraries | |
| handle | back to summary |
|---|---|
| private final long handle The native dl/LoadLibrary handle | |
| lastError | back to summary |
|---|---|
| private static final ThreadLocal<String> lastError Stores the last error returned by a dlopen or dlsym call | |
| LAZY | back to summary |
|---|---|
| public static final int LAZY Perform lazy binding. Only resolve symbols as needed | |
| LOCAL | back to summary |
|---|---|
| public static final int LOCAL Symbols in this library are not made available to other libraries | |
| lock | back to summary |
|---|---|
| private static final Object lock A lock used to serialize all dlopen/dlsym calls | |
| name | back to summary |
|---|---|
| private final String name The name of this | |
| NOW | back to summary |
|---|---|
| public static final int NOW Resolve all symbols when loading the library | |
| UPDATER | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<Library> UPDATER | |
| Library | back to summary |
|---|---|
| private Library(Foreign foreign, String name, long address) | |
| dlopen | back to summary |
|---|---|
| private static long dlopen(Foreign foreign, String name, int flags) Internal wrapper around dlopen. If the library open fails, then this stores the native error in a thread local variable for later retrieval.
| |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the | |
| getCachedInstance | back to summary |
|---|---|
| public static final Library getCachedInstance(String name, int flags) Gets a handle for the named library. | |
| getDefault | back to summary |
|---|---|
| public static final Library getDefault() Gets a handle to the default library.
| |
| getLastError | back to summary |
|---|---|
| public static final String getLastError() Gets the current error string from dlopen/LoadLibrary.
| |
| getSymbolAddress | back to summary |
|---|---|
| public final long getSymbolAddress(String name) Gets the address of a symbol within the
| |
| openLibrary | back to summary |
|---|---|
| public static final Library openLibrary(String name, int flags) Gets a handle for the named library Note This will not cache the instance, nor will it return a cached instance. Only use when you really need a new handle for the library. | |
| Access | Constructor and Description |
|---|---|
| private |
| INSTANCE | back to summary |
|---|---|
| private static final Library INSTANCE | |
| DefaultLibrary | back to summary |
|---|---|
| private DefaultLibrary() | |