netx.jnlp.runtime
public class JNLPClassLoader extends java.net.URLClassLoader
Modifier | Constructor and Description |
---|---|
protected |
JNLPClassLoader(JNLPFile file,
UpdatePolicy policy)
Create a new JNLPClassLoader from the specified file.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateJars(java.util.List jars)
Ensures that the list of jars have all been transferred, and
makes them available to the classloader.
|
protected void |
activateNative(JARDesc jar)
Enable the native code contained in a JAR by copying the
native files into the filesystem.
|
protected void |
addAvailable()
Adds whatever resources have already been downloaded in the
background.
|
protected JNLPClassLoader |
addNextResource()
Adds the next unused resource to the classloader.
|
void |
enableCodeBase()
Add applet's codebase URL.
|
protected void |
fillInPartJars(java.util.List jars)
Adds to the specified list of JARS any other JARs that need
to be loaded at the same time as the JARs specified (ie, are
in the same part).
|
protected java.lang.Class |
findClass(java.lang.String name)
Find the class in this loader or any of its extension loaders.
|
java.lang.String |
findLibrary(java.lang.String lib)
Return the absolute path to the native library.
|
protected java.lang.String |
findLibraryExt(java.lang.String lib)
Try to find the library path from another peer classloader.
|
protected java.lang.Class |
findLoadedClassAll(java.lang.String name)
Find the loaded class in this loader or any of its extension loaders.
|
java.util.Enumeration |
findResources(java.lang.String name)
Finds the resource in this, the parent, or the extension
class loaders.
|
ApplicationInstance |
getApplication()
Returns the JNLP app for this classloader
|
java.lang.String |
getExtensionHREF()
Deprecated.
|
java.lang.String |
getExtensionName()
Deprecated.
|
static JNLPClassLoader |
getInstance(JNLPFile file,
UpdatePolicy policy)
Returns a JNLP classloader for the specified JNLP file.
|
static JNLPClassLoader |
getInstance(java.net.URL location,
UpdatePolicy policy)
Returns a JNLP classloader for the JNLP file at the specified
location.
|
JNLPFile |
getJNLPFile()
Returns the JNLP file the classloader was created from.
|
protected java.io.File |
getNativeDir()
Return the base directory to store native code files in.
|
protected java.security.PermissionCollection |
getPermissions(java.security.CodeSource cs)
Returns the permissions for the CodeSource.
|
java.net.URL |
getResource(java.lang.String name)
Finds the resource in this, the parent, or the extension
class loaders.
|
(package private) void |
initializeExtensions()
Load the extensions specified in the JNLP file.
|
(package private) void |
initializePermissions()
Make permission objects for the classpath.
|
(package private) void |
initializeResources()
Load all of the JARs used in this JNLP file into the
ResourceTracker for downloading.
|
java.lang.Class |
loadClass(java.lang.String name)
Find a JAR in the shared 'extension' classloaders, this
classloader, or one of the classloaders for the JNLP file's
extensions.
|
void |
setApplication(ApplicationInstance app)
Sets the JNLP app this group is for; can only be called once.
|
addURL, definePackage, findResource, getURLs, newInstance, newInstance
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
protected JNLPClassLoader(JNLPFile file, UpdatePolicy policy)
file
- the JNLP filepublic static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy)
file
- the file to load classes forpolicy
- the update policy to use when downloading resourcespublic static JNLPClassLoader getInstance(java.net.URL location, UpdatePolicy policy) throws java.io.IOException, ParseException
location
- the file's locationpolicy
- the update policy to use when downloading resourcesjava.io.IOException
ParseException
void initializeExtensions()
void initializePermissions()
void initializeResources()
public void enableCodeBase()
public void setApplication(ApplicationInstance app)
public ApplicationInstance getApplication()
public JNLPFile getJNLPFile()
protected java.security.PermissionCollection getPermissions(java.security.CodeSource cs)
getPermissions
in class java.net.URLClassLoader
protected void fillInPartJars(java.util.List jars)
protected void activateJars(java.util.List jars)
jars
- the list of jars to loadprotected void activateNative(JARDesc jar)
protected java.io.File getNativeDir()
public java.lang.String findLibrary(java.lang.String lib)
findLibrary
in class java.lang.ClassLoader
protected java.lang.String findLibraryExt(java.lang.String lib)
protected java.lang.Class findLoadedClassAll(java.lang.String name)
public java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
protected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.net.URLClassLoader
java.lang.ClassNotFoundException
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
public java.util.Enumeration findResources(java.lang.String name) throws java.io.IOException
findResources
in class java.net.URLClassLoader
java.io.IOException
protected void addAvailable()
protected JNLPClassLoader addNextResource()
public java.lang.String getExtensionName()
public java.lang.String getExtensionHREF()