public class TempJarCache extends Object
TempFileCache
, see getTempFileCache()
.
Lifecycle: Concurrently running JVMs and ClassLoader
Modifier and Type | Class and Description |
---|---|
static class |
TempJarCache.LoadState |
Constructor and Description |
---|
TempJarCache() |
Modifier and Type | Method and Description |
---|---|
static void |
addAll(Class<?> certClass,
Uri jarUri)
Adds all types, native libraries, class files and other files (resources)
if not yet added.
|
static void |
addClasses(Class<?> certClass,
Uri jarUri)
Adds native classes, if not yet added.
|
static boolean |
addNativeLibs(Class<?> certClass,
Uri jarUri,
String nativeLibraryPath)
Adds native libraries, if not yet added.
|
static void |
addResources(Class<?> certClass,
Uri jarUri)
Adds native resources, if not yet added.
|
static boolean |
checkClasses(Uri jarUri,
TempJarCache.LoadState exp) |
static boolean |
checkNativeLibs(Uri jarUri,
TempJarCache.LoadState exp) |
static boolean |
checkResources(Uri jarUri,
TempJarCache.LoadState exp) |
static String |
findLibrary(String libName)
If
isInitialized(true) is false due to lack of executable support only,
this method always returns false. |
static String |
findResource(String name)
Similar to
ClassLoader.getResource(String) . |
static Uri |
getResourceUri(String name)
Similar to
ClassLoader.getResource(String) . |
static TempFileCache |
getTempFileCache() |
static boolean |
initSingleton()
Documented way to kick off static initialization.
|
static boolean |
isInitialized(boolean forExecutables) |
public static boolean initSingleton()
public static boolean isInitialized(boolean forExecutables)
forExecutables
- if true
, method also tests whether the underlying cache is suitable to load native libraries or launch executablespublic static TempFileCache getTempFileCache()
TempFileCache
JogampRuntimeException
- if not isInitialized(false)
public static boolean checkNativeLibs(Uri jarUri, TempJarCache.LoadState exp) throws IOException
jarUri
- exp
- IOException
JogampRuntimeException
- if not isInitialized(false)
public static boolean checkClasses(Uri jarUri, TempJarCache.LoadState exp) throws IOException
jarUri
- exp
- IOException
JogampRuntimeException
- if not isInitialized(false)
public static boolean checkResources(Uri jarUri, TempJarCache.LoadState exp) throws IOException
jarUri
- exp
- IOException
JogampRuntimeException
- if not isInitialized(false)
public static final boolean addNativeLibs(Class<?> certClass, Uri jarUri, String nativeLibraryPath) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
certClass
- if class is certified, the JarFile entries needs to have the same certificatejarUri
- nativeLibraryPath
- if not null, only extracts native libraries within this path.IOException
- if the jarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeException
- if not isInitialized(true)
public static final void addClasses(Class<?> certClass, Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
certClass
- if class is certified, the JarFile entries needs to have the same certificatejarUri
- IOException
- if the jarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeException
- if not isInitialized(false)
public static final void addResources(Class<?> certClass, Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
certClass
- if class is certified, the JarFile entries needs to have the same certificatejarUri
- IOException
- if the jarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeException
- if not isInitialized(false)
public static final void addAll(Class<?> certClass, Uri jarUri) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
certClass
- if class is certified, the JarFile entries needs to have the same certificatejarUri
- IOException
- if the jarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
JogampRuntimeException
- if not isInitialized(false)
public static final String findLibrary(String libName)
isInitialized(true)
is false due to lack of executable support only,
this method always returns false.libName
- JogampRuntimeException
- if not isInitialized(false)
public static final String findResource(String name)
ClassLoader.getResource(String)
.name
- JogampRuntimeException
- if not isInitialized(false)
public static final Uri getResourceUri(String name) throws URISyntaxException
ClassLoader.getResource(String)
.name
- URISyntaxException
JogampRuntimeException
- if not isInitialized(false)