Top Description Inners Fields Constructors Methods
com.jogamp.common.os

public Class DynamicLibraryBundle

extends Object
implements DynamicLookupHelper
Class Inheritance
All Implemented Interfaces
com.jogamp.common.os.DynamicLookupHelper
Imports
java.util.ArrayList, .Arrays, .HashSet, .List, com.jogamp.common.jvm.JNILibLoaderBase, com.jogamp.common.util.RunnableExecutor

Provides bundling of:

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.

An instance provides a complete com.jogamp.common.os.DynamicLookupHelper to reset the com.jogamp.gluegen.runtime.ProcAddressTable.
At construction, it:

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final DynamicLinker
private final boolean[]
private int
private final List<String>
private final DynamicLibraryBundleInfo
protected final List<NativeLibrary>
private boolean
private final List<String>
private HashSet<String>
private long
private final boolean[]
private int
private final List<List<String>>

Constructor Summary

AccessConstructor and Description
public
DynamicLibraryBundle(final DynamicLibraryBundleInfo info)

Instantiates and loads all NativeLibrarys incl.

Method Summary

Modifier and TypeMethod and Description
public final void
public final void
destroy()

Unload all NativeLibrarys, and remove all references.

public final long
dynamicLookupFunction(final String funcName)

Implements com.jogamp.common.os.DynamicLookupHelper.dynamicLookupFunction.

Returns the function handle for function 'funcName'.
private final long
public final DynamicLibraryBundleInfo
public static RunnableExecutor
getDefaultRunnableExecutor()

Returns an AWT-EDT RunnableExecutor implementation if AWT is available, otherwise RunnableExecutor#currentThreadExecutor.

public final int
public final int
protected final long
public final int
public final int
public final boolean
isFunctionAvailable(final String funcName)

Implements com.jogamp.common.os.DynamicLookupHelper.isFunctionAvailable.

Queries whether function 'funcName' is available.
public final boolean

Returns:

true if the last entry has been loaded, while ignoring the preload dependencies. Otherwise false.
isGlueLibComplete
()

public final boolean
isGlueLibLoaded(final int i)

public final boolean
public final boolean

Returns:

true if all tool libraries are loaded, otherwise false.
isToolLibComplete
()

public final boolean
public final boolean
isToolLibLoaded(final int i)

protected static final NativeLibrary
loadFirstAvailable(final List<String> libNames, final ClassLoader loader, final boolean global)

pack-priv final DynamicLinker
public final void
private final long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dynLinkGlobalback to summary
private final DynamicLinker dynLinkGlobal
glueLibLoadedback to summary
private final boolean[] glueLibLoaded
glueLibLoadedNumberback to summary
private int glueLibLoadedNumber
glueLibNamesback to summary
private final List<String> glueLibNames
infoback to summary
private final DynamicLibraryBundleInfo info
nativeLibrariesback to summary
protected final List<NativeLibrary> nativeLibraries
toolGetProcAddressCompleteback to summary
private boolean toolGetProcAddressComplete
toolGetProcAddressFuncNameListback to summary
private final List<String> toolGetProcAddressFuncNameList
toolGetProcAddressFuncNameSetback to summary
private HashSet<String> toolGetProcAddressFuncNameSet
toolGetProcAddressHandleback to summary
private long toolGetProcAddressHandle
toolLibLoadedback to summary
private final boolean[] toolLibLoaded
toolLibLoadedNumberback to summary
private int toolLibLoadedNumber
toolLibNamesback to summary
private final List<List<String>> toolLibNames

Constructor Detail

DynamicLibraryBundleback to summary
public DynamicLibraryBundle(final DynamicLibraryBundleInfo info)

Instantiates and loads all NativeLibrarys incl. JNI libraries.

The ClassLoader of the DynamicLibraryBundleInfo implementation class is being used to help locating the native libraries.

Method Detail

claimAllLinkPermissionback to summary
public final void claimAllLinkPermission() throws SecurityException

Implements com.jogamp.common.os.DynamicLookupHelper.claimAllLinkPermission.

Annotations
@Override
Exceptions
SecurityException:

Doc from com.jogamp.common.os.DynamicLookupHelper.claimAllLinkPermission.

if user is not granted access for the library set.

destroyback to summary
public final void destroy()

Unload all NativeLibrarys, and remove all references.

dynamicLookupFunctionback to summary
public final long dynamicLookupFunction(final String funcName) throws SecurityException

Implements com.jogamp.common.os.DynamicLookupHelper.dynamicLookupFunction.

Doc from com.jogamp.common.os.DynamicLookupHelper.dynamicLookupFunction.

Returns the function handle for function 'funcName'.

Annotations
@Override
Exceptions
SecurityException:
if user is not granted access for the library set.
dynamicLookupFunctionOnLibsback to summary
private final long dynamicLookupFunctionOnLibs(final String funcName) throws SecurityException
Exceptions
SecurityException:
if user is not granted access for the library set.
getBundleInfoback to summary
public final DynamicLibraryBundleInfo getBundleInfo()
getDefaultRunnableExecutorback to summary
public static RunnableExecutor getDefaultRunnableExecutor()

Returns an AWT-EDT RunnableExecutor implementation if AWT is available, otherwise RunnableExecutor#currentThreadExecutor.

getGlueLibLoadedNumberback to summary
public final int getGlueLibLoadedNumber()
getGlueLibNumberback to summary
public final int getGlueLibNumber()
getToolGetProcAddressHandleback to summary
protected final long getToolGetProcAddressHandle() throws SecurityException
getToolLibLoadedNumberback to summary
public final int getToolLibLoadedNumber()
getToolLibNumberback to summary
public final int getToolLibNumber()
isFunctionAvailableback to summary
public final boolean isFunctionAvailable(final String funcName) throws SecurityException

Implements com.jogamp.common.os.DynamicLookupHelper.isFunctionAvailable.

Doc from com.jogamp.common.os.DynamicLookupHelper.isFunctionAvailable.

Queries whether function 'funcName' is available.

Annotations
@Override
Exceptions
SecurityException:
if user is not granted access for the library set.
isGlueLibCompleteback to summary
public final boolean isGlueLibComplete()
Returns:boolean

true if the last entry has been loaded, while ignoring the preload dependencies. Otherwise false.

See Also
DynamicLibraryBundleInfo#getGlueLibNames()
isGlueLibLoadedback to summary
public final boolean isGlueLibLoaded(final int i)
isLibCompleteback to summary
public final boolean isLibComplete()
isToolLibCompleteback to summary
public final boolean isToolLibComplete()
Returns:boolean

true if all tool libraries are loaded, otherwise false.

See Also
DynamicLibraryBundleInfo#getToolLibNames()
isToolLibLoadedback to summary
public final boolean isToolLibLoaded()
isToolLibLoadedback to summary
public final boolean isToolLibLoaded(final int i)
loadFirstAvailableback to summary
protected static final NativeLibrary loadFirstAvailable(final List<String> libNames, final ClassLoader loader, final boolean global) throws SecurityException
loadLibrariesback to summary
pack-priv final DynamicLinker loadLibraries() throws SecurityException
releaseAllLinkPermissionback to summary
public final void releaseAllLinkPermission() throws SecurityException

Implements com.jogamp.common.os.DynamicLookupHelper.releaseAllLinkPermission.

Annotations
@Override
Exceptions
SecurityException:

Doc from com.jogamp.common.os.DynamicLookupHelper.releaseAllLinkPermission.

if user is not granted access for the library set.

toolDynamicLookupFunctionback to summary
private final long toolDynamicLookupFunction(final String funcName)
com.jogamp.common.os back to summary

pack-priv final Class DynamicLibraryBundle.GlueJNILibLoader

extends JNILibLoaderBase
Class Inheritance

Inherit access

Field Summary

Inherited from com.jogamp.common.jvm.JNILibLoaderBase:
DEBUGPERF

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected static synchronized boolean
loadLibrary(final String
the library to load
libname
,
final boolean
if true, errors during loading the library should be ignored
ignoreError
,
final ClassLoader
optional ClassLoader, used to locate the library
cl
)

Hides com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary.

Loads the library specified by libname, using the LoaderAction set by setLoadingAction(LoaderAction).
Inherited from com.jogamp.common.jvm.JNILibLoaderBase:
addLoadedaddNativeJarLibsaddNativeJarLibsJoglCfgdisableLoadingenableLoadingisLoadedloadLibrarysetLoadingAction

Constructor Detail

GlueJNILibLoaderback to summary
pack-priv GlueJNILibLoader()

Method Detail

loadLibraryback to summary
protected static synchronized boolean loadLibrary(final String libname, final boolean ignoreError, final ClassLoader cl)

Hides com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary.

Doc from com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary.

Loads the library specified by libname, using the LoaderAction set by setLoadingAction(LoaderAction).
The implementation should ignore, if the library has been loaded already.

Parameters
libname:String

the library to load

ignoreError:boolean

if true, errors during loading the library should be ignored

cl:ClassLoader

optional ClassLoader, used to locate the library

Returns:boolean

true if library loaded successful