Package com.jogamp.common.os
Interface DynamicLinker
-
public interface DynamicLinker
Low level secure dynamic linker access.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
static boolean
DEBUG_LOOKUP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
claimAllLinkPermission()
void
closeLibrary(long libraryHandle, boolean debug)
Security checks are implicit by previous call ofopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
retrieving thelibrarHandle
.String
getLastError()
Returns a string containing the last error.long
lookupSymbol(long libraryHandle, String symbolName)
Security checks are implicit by previous call ofopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
retrieving thelibrarHandle
.long
lookupSymbolGlobal(String symbolName)
If aSecurityManager
is installed, user needs link permissions for all libraries, i.e.long
openLibraryGlobal(String pathname, boolean debug)
If aSecurityManager
is installed, user needs link permissions for the named library.long
openLibraryLocal(String pathname, boolean debug)
If aSecurityManager
is installed, user needs link permissions for the named library.void
releaseAllLinkPermission()
-
-
-
Method Detail
-
claimAllLinkPermission
void claimAllLinkPermission() throws SecurityException
- Throws:
SecurityException
- if user is not granted global access
-
releaseAllLinkPermission
void releaseAllLinkPermission() throws SecurityException
- Throws:
SecurityException
- if user is not granted global access
-
openLibraryGlobal
long openLibraryGlobal(String pathname, boolean debug) throws SecurityException
If aSecurityManager
is installed, user needs link permissions for the named library.Opens the named library, allowing system wide access for other users.
- Parameters:
pathname
- the full pathname for the library to opendebug
- set to true to enable debugging- Returns:
- the library handle, maybe 0 if not found.
- Throws:
SecurityException
- if user is not granted access for the named library.
-
openLibraryLocal
long openLibraryLocal(String pathname, boolean debug) throws SecurityException
If aSecurityManager
is installed, user needs link permissions for the named library.Opens the named library, restricting access to this process.
- Parameters:
pathname
- the full pathname for the library to opendebug
- set to true to enable debugging- Returns:
- the library handle, maybe 0 if not found.
- Throws:
SecurityException
- if user is not granted access for the named library.
-
lookupSymbolGlobal
long lookupSymbolGlobal(String symbolName) throws SecurityException
If aSecurityManager
is installed, user needs link permissions for all libraries, i.e. fornew RuntimePermission("loadLibrary.*");
!- Parameters:
symbolName
- global symbol name to lookup up system wide.- Returns:
- the library handle, maybe 0 if not found.
- Throws:
SecurityException
- if user is not granted access for all libraries.
-
lookupSymbol
long lookupSymbol(long libraryHandle, String symbolName) throws SecurityException, IllegalArgumentException
Security checks are implicit by previous call ofopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
retrieving thelibrarHandle
.- Parameters:
libraryHandle
- a library handle previously retrieved viaopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
.symbolName
- global symbol name to lookup up system wide.- Returns:
- the library handle, maybe 0 if not found.
- Throws:
IllegalArgumentException
- in case caselibraryHandle
is unknown.SecurityException
- if user is not granted access for the given library handle
-
closeLibrary
void closeLibrary(long libraryHandle, boolean debug) throws SecurityException, IllegalArgumentException
Security checks are implicit by previous call ofopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
retrieving thelibrarHandle
.- Parameters:
libraryHandle
- a library handle previously retrieved viaopenLibraryLocal(String, boolean)
oropenLibraryGlobal(String, boolean)
.debug
- set to true to enable debugging- Throws:
IllegalArgumentException
- in case caselibraryHandle
is unknown.SecurityException
- if user is not granted access for the given library handle
-
getLastError
String getLastError()
Returns a string containing the last error. Maybe called for debuging purposed if any method fails.- Returns:
- error string, maybe null. A null or non-null value has no semantics.
-
-