com.jogamp.common.os
Interface DynamicLinker


public interface DynamicLinker

Low level secure dynamic linker access.


Field Summary
static boolean DEBUG
           
static boolean DEBUG_LOOKUP
           
 
Method Summary
 void closeLibrary(long libraryHandle)
          Security checks are implicit by previous call of openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean) retrieving the librarHandle.
 String getLastError()
          Returns a string containing the last error.
 long lookupSymbol(long libraryHandle, String symbolName)
          Security checks are implicit by previous call of openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean) retrieving the librarHandle.
 long lookupSymbolGlobal(String symbolName)
          If a SecurityManager is installed, user needs link permissions for all libraries, i.e.
 long openLibraryGlobal(String pathname, boolean debug)
          If a SecurityManager is installed, user needs link permissions for the named library.
 long openLibraryLocal(String pathname, boolean debug)
          If a SecurityManager is installed, user needs link permissions for the named library.
 

Field Detail

DEBUG

static final boolean DEBUG

DEBUG_LOOKUP

static final boolean DEBUG_LOOKUP
Method Detail

openLibraryGlobal

long openLibraryGlobal(String pathname,
                       boolean debug)
                       throws SecurityException
If a SecurityManager 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 open
debug - 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 a SecurityManager 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 open
debug - 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 a SecurityManager is installed, user needs link permissions for all libraries, i.e. for new 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 IllegalArgumentException
Security checks are implicit by previous call of openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean) retrieving the librarHandle.

Parameters:
libraryHandle - a library handle previously retrieved via openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean).
symbolName - global symbol name to lookup up system wide.
Returns:
the library handle, maybe 0 if not found.
Throws:
IllegalArgumentException - in case case libraryHandle is unknown.

closeLibrary

void closeLibrary(long libraryHandle)
                  throws IllegalArgumentException
Security checks are implicit by previous call of openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean) retrieving the librarHandle.

Parameters:
libraryHandle - a library handle previously retrieved via openLibraryLocal(String, boolean) or openLibraryGlobal(String, boolean).
Throws:
IllegalArgumentException - in case case libraryHandle is unknown.

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.