Package com.jogamp.common.os
Class DynamicLibraryBundle
java.lang.Object
com.jogamp.common.os.DynamicLibraryBundle
- All Implemented Interfaces:
DynamicLookupHelper
Provides bundling of:
At construction, it:
- The to-be-glued native library, eg OpenGL32.dll. From here on this is referred as the Tool.
- The JNI glue-code native library, eg jogl_desktop.dll. From here on this is referred as the Glue
An DynamicLibraryBundleInfo instance is being passed in the constructor,
providing the required information about the tool and glue libraries.
The ClassLoader of it's implementation is also being used to help locating the native libraries.
DynamicLookupHelper
to reset
the ProcAddressTable.At construction, it:
- loads the Tool native library via
NativeLibrary's open method - loads the
Glue native library - resolves the Tool's
GetProcAddress. (optional)
-
Field Summary
FieldsFields inherited from interface com.jogamp.common.os.DynamicLookupHelper
DEBUG, DEBUG_LOOKUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voiddestroy()Unload allNativeLibrarys, and remove all references.final longdynamicLookupFunction(String funcName) Returns the function handle for function 'funcName'.final DynamicLibraryBundleInfostatic RunnableExecutorReturns an AWT-EDTRunnableExecutorimplementation if AWT is available, otherwiseRunnableExecutor.currentThreadExecutor.final intfinal intprotected final longfinal intfinal intfinal booleanisFunctionAvailable(String funcName) Queries whether function 'funcName' is available.final booleanfinal booleanisGlueLibLoaded(int i) final booleanfinal booleanfinal booleanfinal booleanisToolLibLoaded(int i) protected static final NativeLibraryloadFirstAvailable(List<String> libNames, ClassLoader loader, boolean global) final void
-
Field Details
-
nativeLibraries
-
-
Constructor Details
-
DynamicLibraryBundle
Instantiates and loads allNativeLibrarys incl. JNI libraries.The ClassLoader of the
DynamicLibraryBundleInfoimplementation class is being used to help locating the native libraries.
-
-
Method Details
-
getDefaultRunnableExecutor
Returns an AWT-EDTRunnableExecutorimplementation if AWT is available, otherwiseRunnableExecutor.currentThreadExecutor. -
destroy
public final void destroy()Unload allNativeLibrarys, and remove all references. -
isLibComplete
public final boolean isLibComplete() -
getToolLibNumber
public final int getToolLibNumber() -
getToolLibLoadedNumber
public final int getToolLibLoadedNumber() -
isToolLibComplete
public final boolean isToolLibComplete()- Returns:
- true if all tool libraries are loaded, otherwise false.
- See Also:
-
isToolLibLoaded
public final boolean isToolLibLoaded() -
isToolLibLoaded
public final boolean isToolLibLoaded(int i) -
getGlueLibNumber
public final int getGlueLibNumber() -
getGlueLibLoadedNumber
public final int getGlueLibLoadedNumber() -
isGlueLibComplete
public final boolean isGlueLibComplete()- Returns:
- true if the last entry has been loaded, while ignoring the preload dependencies. Otherwise false.
- See Also:
-
isGlueLibLoaded
public final boolean isGlueLibLoaded(int i) -
getBundleInfo
-
getToolGetProcAddressHandle
- Throws:
SecurityException
-
loadFirstAvailable
protected static final NativeLibrary loadFirstAvailable(List<String> libNames, ClassLoader loader, boolean global) throws SecurityException - Throws:
SecurityException
-
claimAllLinkPermission
- Specified by:
claimAllLinkPermissionin interfaceDynamicLookupHelper- Throws:
SecurityException- if user is not granted access for the library set.
-
releaseAllLinkPermission
- Specified by:
releaseAllLinkPermissionin interfaceDynamicLookupHelper- Throws:
SecurityException- if user is not granted access for the library set.
-
dynamicLookupFunction
Description copied from interface:DynamicLookupHelperReturns the function handle for function 'funcName'.- Specified by:
dynamicLookupFunctionin interfaceDynamicLookupHelper- Throws:
SecurityException- if user is not granted access for the library set.
-
isFunctionAvailable
Description copied from interface:DynamicLookupHelperQueries whether function 'funcName' is available.- Specified by:
isFunctionAvailablein interfaceDynamicLookupHelper- Throws:
SecurityException- if user is not granted access for the library set.
-