jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Static Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
org.jau.sys.JNILibrary Class Reference

Static JNI Native Libraries handler. More...

Inheritance diagram for org.jau.sys.JNILibrary:
Collaboration diagram for org.jau.sys.JNILibrary:

Static Public Member Functions

static final String getSystemEnvLibraryPathVarname ()
 Returns the system's environment variable name used for the dynamic linker to resolve library locations, e.g. More...
 
static final List< String > getSystemEnvLibraryPaths ()
 Returns a list of system paths, from the getSystemEnvLibraryPathVarname() variable. More...
 
static synchronized boolean isLoaded (final String libName)
 
static synchronized boolean loadLibrary (final String libname, final boolean ignoreError, final ClassLoader cl) throws SecurityException, UnsatisfiedLinkError
 Loads the library specified by libname. More...
 
static synchronized void loadLibrary (final String libname, final String[] preload, final boolean preloadIgnoreError, final ClassLoader cl) throws SecurityException, UnsatisfiedLinkError
 Loads the library specified by libname. More...
 
static final String findLibrary (final String libName, final ClassLoader loader)
 
static final String isValidNativeLibraryName (final String libName, final boolean isLowerCaseAlready)
 Comparison of prefix and suffix of the given libName's basename is performed case insensitive
More...
 
static final List< String > enumerateLibraryPaths (final String libName, final boolean searchSystemPath, final boolean searchSystemPathFirst, final ClassLoader loader)
 Given the base library names (no prefixes/suffixes) for the various platforms, enumerate the possible locations and names of the indicated native library on the system using the system path. More...
 
static final List< String > enumerateLibraryPaths (final String windowsLibName, final String unixLibName, final String macOSXLibName, final boolean searchSystemPath, final boolean searchSystemPathFirst, final ClassLoader loader)
 Given the base library names (no prefixes/suffixes) for the various platforms, enumerate the possible locations and names of the indicated native library on the system using the system path. More...
 

Static Public Attributes

static final boolean DEBUG
 

Static Protected Attributes

static final boolean PERF
 
static final Object perfSync = new Object()
 
static long perfTotal = 0
 
static long perfCount = 0
 

Detailed Description

Static JNI Native Libraries handler.

Definition at line 47 of file JNILibrary.java.

Member Function Documentation

◆ enumerateLibraryPaths() [1/2]

static final List< String > org.jau.sys.JNILibrary.enumerateLibraryPaths ( final String  libName,
final boolean  searchSystemPath,
final boolean  searchSystemPathFirst,
final ClassLoader  loader 
)
static

Given the base library names (no prefixes/suffixes) for the various platforms, enumerate the possible locations and names of the indicated native library on the system using the system path.

Definition at line 324 of file JNILibrary.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enumerateLibraryPaths() [2/2]

static final List< String > org.jau.sys.JNILibrary.enumerateLibraryPaths ( final String  windowsLibName,
final String  unixLibName,
final String  macOSXLibName,
final boolean  searchSystemPath,
final boolean  searchSystemPathFirst,
final ClassLoader  loader 
)
static

Given the base library names (no prefixes/suffixes) for the various platforms, enumerate the possible locations and names of the indicated native library on the system using the system path.

Definition at line 336 of file JNILibrary.java.

Here is the call graph for this function:

◆ findLibrary()

static final String org.jau.sys.JNILibrary.findLibrary ( final String  libName,
final ClassLoader  loader 
)
static

Definition at line 272 of file JNILibrary.java.

Here is the caller graph for this function:

◆ getSystemEnvLibraryPaths()

static final List< String > org.jau.sys.JNILibrary.getSystemEnvLibraryPaths ( )
static

Returns a list of system paths, from the getSystemEnvLibraryPathVarname() variable.

Definition at line 135 of file JNILibrary.java.

Here is the call graph for this function:

◆ getSystemEnvLibraryPathVarname()

static final String org.jau.sys.JNILibrary.getSystemEnvLibraryPathVarname ( )
static

Returns the system's environment variable name used for the dynamic linker to resolve library locations, e.g.

  • Windows: PATH
  • MacOS: DYLD_LIBRARY_PATH
  • Unix: LD_LIBRARY_PATH

Definition at line 130 of file JNILibrary.java.

Here is the caller graph for this function:

◆ isLoaded()

static synchronized boolean org.jau.sys.JNILibrary.isLoaded ( final String  libName)
static

Definition at line 153 of file JNILibrary.java.

Here is the caller graph for this function:

◆ isValidNativeLibraryName()

static final String org.jau.sys.JNILibrary.isValidNativeLibraryName ( final String  libName,
final boolean  isLowerCaseAlready 
)
static

Comparison of prefix and suffix of the given libName's basename is performed case insensitive

Parameters
libNamethe full path library name with prefix and suffix
isLowerCaseAlreadyindicates if libName is already lower-case
Returns
basename of libName w/o path, ie. /usr/lib/libDrinkBeer.so -> DrinkBeer on Unix systems, but null on Windows.

Definition at line 295 of file JNILibrary.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadLibrary() [1/2]

static synchronized boolean org.jau.sys.JNILibrary.loadLibrary ( final String  libname,
final boolean  ignoreError,
final ClassLoader  cl 
) throws SecurityException, UnsatisfiedLinkError
static

Loads the library specified by libname.


The implementation should ignore, if the library has been loaded already.

Parameters
libnamethe library to load
ignoreErrorif true, errors during loading the library should be ignored
cloptional ClassLoader, used to locate the library
Returns
true if library loaded successful

Definition at line 172 of file JNILibrary.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadLibrary() [2/2]

static synchronized void org.jau.sys.JNILibrary.loadLibrary ( final String  libname,
final String[]  preload,
final boolean  preloadIgnoreError,
final ClassLoader  cl 
) throws SecurityException, UnsatisfiedLinkError
static

Loads the library specified by libname.


Optionally preloads the libraries specified by preload.
The implementation should ignore, if any library has been loaded already.

Parameters
libnamethe library to load
preloadthe libraries to load before loading the main library if not null
preloadIgnoreErrorif true, errors during loading the preload-libraries should be ignored
cloptional ClassLoader, used to locate the library

Definition at line 205 of file JNILibrary.java.

Here is the call graph for this function:

Member Data Documentation

◆ DEBUG

final boolean org.jau.sys.JNILibrary.DEBUG
static

Definition at line 48 of file JNILibrary.java.

◆ PERF

final boolean org.jau.sys.JNILibrary.PERF
staticprotected

Definition at line 49 of file JNILibrary.java.

◆ perfCount

long org.jau.sys.JNILibrary.perfCount = 0
staticprotected

Definition at line 120 of file JNILibrary.java.

◆ perfSync

final Object org.jau.sys.JNILibrary.perfSync = new Object()
staticprotected

Definition at line 118 of file JNILibrary.java.

◆ perfTotal

long org.jau.sys.JNILibrary.perfTotal = 0
staticprotected

Definition at line 119 of file JNILibrary.java.


The documentation for this class was generated from the following file: