GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.cache.TempJarCache Class Reference

Static Jar file cache handler using an underlying instance of TempFileCache, see getTempFileCache(). More...

Collaboration diagram for com.jogamp.common.util.cache.TempJarCache:

Classes

enum  LoadState
 

Static Public Member Functions

static boolean initSingleton ()
 Documented way to kick off static initialization. More...
 
static boolean isInitialized (final boolean forExecutables)
 
static TempFileCache getTempFileCache ()
 
static synchronized boolean checkNativeLibs (final Uri jarUri, final LoadState exp) throws IOException
 
static synchronized boolean checkClasses (final Uri jarUri, final LoadState exp) throws IOException
 
static synchronized boolean checkResources (final Uri jarUri, final LoadState exp) throws IOException
 
static synchronized final boolean addNativeLibs (final Class<?> certClass, final Uri jarUri, final String nativeLibraryPath) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
 Adds native libraries, if not yet added. More...
 
static synchronized final void addClasses (final Class<?> certClass, final Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
 Adds native classes, if not yet added. More...
 
static synchronized final void addResources (final Class<?> certClass, final Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
 Adds native resources, if not yet added. More...
 
static synchronized final void addAll (final Class<?> certClass, final Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
 Adds all types, native libraries, class files and other files (resources) if not yet added. More...
 
static synchronized final String findLibrary (final String libName)
 If isInitialized(true) is false due to lack of executable support only, this method always returns false. More...
 
static synchronized final String findResource (final String name)
 TODO class access pending needs Classloader.defineClass(..) access, ie. More...
 
static synchronized final Uri getResourceUri (final String name) throws URISyntaxException
 Similar to ClassLoader#getResource(String). More...
 

Detailed Description

Static Jar file cache handler using an underlying instance of TempFileCache, see getTempFileCache().

Lifecycle: Concurrently running JVMs and ClassLoader

Definition at line 52 of file TempJarCache.java.

Member Function Documentation

◆ addAll()

static synchronized final void com.jogamp.common.util.cache.TempJarCache.addAll ( final Class<?>  certClass,
final Uri  jarUri 
) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
static

Adds all types, native libraries, class files and other files (resources) if not yet added.

TODO class access pending needs Classloader.defineClass(..) access, ie. own derivation - will do when needed ..

Parameters
certClassif class is certified, the JarFile entries needs to have the same certificate
jarUri
Exceptions
IOExceptionif the jarUri could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 364 of file TempJarCache.java.

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

◆ addClasses()

static synchronized final void com.jogamp.common.util.cache.TempJarCache.addClasses ( final Class<?>  certClass,
final Uri  jarUri 
) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
static

Adds native classes, if not yet added.

TODO class access pending needs Classloader.defineClass(..) access, ie. own derivation - will do when needed ..

Parameters
certClassif class is certified, the JarFile entries needs to have the same certificate
jarUri
Exceptions
IOExceptionif the jarUri could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 301 of file TempJarCache.java.

Here is the call graph for this function:

◆ addNativeLibs()

static synchronized final boolean com.jogamp.common.util.cache.TempJarCache.addNativeLibs ( final Class<?>  certClass,
final Uri  jarUri,
final String  nativeLibraryPath 
) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
static

Adds native libraries, if not yet added.

Parameters
certClassif class is certified, the JarFile entries needs to have the same certificate
jarUri
nativeLibraryPathif not null, only extracts native libraries within this path.
Returns
true if native libraries were added or previously loaded from given jarUri, otherwise false
Exceptions
IOExceptionif the jarUri could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeExceptionif not isInitialized(true)

Definition at line 265 of file TempJarCache.java.

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

◆ addResources()

static synchronized final void com.jogamp.common.util.cache.TempJarCache.addResources ( final Class<?>  certClass,
final Uri  jarUri 
) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
static

Adds native resources, if not yet added.

Parameters
certClassif class is certified, the JarFile entries needs to have the same certificate
jarUri
Returns
Exceptions
IOExceptionif the jarUri could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 331 of file TempJarCache.java.

Here is the call graph for this function:

◆ checkClasses()

static synchronized boolean com.jogamp.common.util.cache.TempJarCache.checkClasses ( final Uri  jarUri,
final LoadState  exp 
) throws IOException
static
Parameters
jarUri
exp
Returns
Exceptions
IOException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 228 of file TempJarCache.java.

◆ checkNativeLibs()

static synchronized boolean com.jogamp.common.util.cache.TempJarCache.checkNativeLibs ( final Uri  jarUri,
final LoadState  exp 
) throws IOException
static
Parameters
jarUri
exp
Returns
Exceptions
IOException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 213 of file TempJarCache.java.

◆ checkResources()

static synchronized boolean com.jogamp.common.util.cache.TempJarCache.checkResources ( final Uri  jarUri,
final LoadState  exp 
) throws IOException
static
Parameters
jarUri
exp
Returns
Exceptions
IOException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 244 of file TempJarCache.java.

◆ findLibrary()

static synchronized final String com.jogamp.common.util.cache.TempJarCache.findLibrary ( final String  libName)
static

If isInitialized(true) is false due to lack of executable support only, this method always returns false.

Parameters
libName
Returns
the found native library path within this cache or null if not found
Exceptions
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 423 of file TempJarCache.java.

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

◆ findResource()

static synchronized final String com.jogamp.common.util.cache.TempJarCache.findResource ( final String  name)
static

TODO class access pending needs Classloader.defineClass(..) access, ie.

own derivation - will do when needed .. public static Class<?> findClass(String name, ClassLoader cl) throws IOException, ClassFormatError { checkInitialized(); final File f = new File(nativeTmpFileCache.getTempDir(), IOUtil.getClassFileName(name)); if(f.exists()) { Class.forName(fname, initialize, loader) URL url = new URL(f.getAbsolutePath()); byte[] b = IOUtil.copyStream2ByteArray(new BufferedInputStream( url.openStream() )); MyClassLoader mcl = new MyClassLoader(cl); return mcl.defineClass(name, b, 0, b.length); } return null; } Similar to ClassLoader#getResource(String).

Parameters
name
Returns
Exceptions
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 463 of file TempJarCache.java.

Here is the caller graph for this function:

◆ getResourceUri()

static synchronized final Uri com.jogamp.common.util.cache.TempJarCache.getResourceUri ( final String  name) throws URISyntaxException
static

Similar to ClassLoader#getResource(String).

Parameters
name
Returns
Exceptions
URISyntaxException
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 479 of file TempJarCache.java.

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

◆ getTempFileCache()

static TempFileCache com.jogamp.common.util.cache.TempJarCache.getTempFileCache ( )
static
Returns
the underlying TempFileCache
Exceptions
JogampRuntimeExceptionif not isInitialized(false)

Definition at line 201 of file TempJarCache.java.

Here is the caller graph for this function:

◆ initSingleton()

static boolean com.jogamp.common.util.cache.TempJarCache.initSingleton ( )
static

Documented way to kick off static initialization.

Returns
true is static initialization was successful

Definition at line 92 of file TempJarCache.java.

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

◆ isInitialized()

static boolean com.jogamp.common.util.cache.TempJarCache.isInitialized ( final boolean  forExecutables)
static
Parameters
forExecutablesif true, method also tests whether the underlying cache is suitable to load native libraries or launch executables
Returns
true if this class has been properly initialized, ie. is in use. Otherwise returns false.

Definition at line 178 of file TempJarCache.java.

Here is the caller graph for this function:

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