java.lang.Object | ||||
↳ | java.lang.ClassLoader | |||
↳ | java.security.SecureClassLoader | |||
↳ | java.net.URLClassLoader | |||
↳ | sun.applet.AppletClassLoader |
This class defines the class loader for loading applet classes and resources. It extends URLClassLoader to search the applet code base for the class or resource after checking any loaded JAR files.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Finds the resource with the specified name on the URL search path.
| |||||||||||
Returns an Enumeration of URLs representing all of the resources
on the URL search path having the specified name.
| |||||||||||
Returns an input stream for reading the specified resource.
| |||||||||||
Returns an input stream for reading the specified resource from the
the loaded jar files.
| |||||||||||
Returns the search path of URLs for loading classes and resources.
| |||||||||||
Loads the class with the specified binary name.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Finds and loads the class with the specified name from the URL search
path.
| |||||||||||
Returns the permissions for the given codesource object.
| |||||||||||
Release this AppletClassLoader and its ThreadGroup/AppContext.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Finds the resource with the specified name on the URL search path.
name | the name of the resource |
---|
URL
for the resource, or null
if the resource could not be found.
Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name.
name | the resource name |
---|
Enumeration
of URL
s
IOException |
---|
Returns an input stream for reading the specified resource.
The search order is described in the documentation for getResource(String)
.
name | the resource name |
---|
null
if the resource could not be foundReturns an input stream for reading the specified resource from the
the loaded jar files.
The search order is described in the documentation for getResource(String)
.
name | the resource name |
---|
null
if the resource could not be foundReturns the search path of URLs for loading classes and resources. This includes the original list of URLs specified to the constructor, along with any URLs subsequently appended by the addURL() method.
Loads the class with the specified binary name. The default implementation of this method searches for classes in the following order:
Invoke findLoadedClass(String)
to check if the class
has already been loaded.
Invoke the loadClass
method
on the parent class loader. If the parent is null the class
loader built-in to the virtual machine is used, instead.
Invoke the findClass(String)
method to find the
class.
If the class was found using the above steps, and the
resolve flag is true, this method will then invoke the resolveClass(Class)
method on the resulting Class object.
Subclasses of ClassLoader are encouraged to override findClass(String)
, rather than this method.
name | The binary name of the class |
---|---|
resolve | If true then resolve the class |
ClassNotFoundException |
---|
Finds and loads the class with the specified name from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found.
name | the name of the class |
---|
ClassNotFoundException |
---|
Returns the permissions for the given codesource object. The implementation of this method first calls super.getPermissions, to get the permissions granted by the super class, and then adds additional permissions based on the URL of the codesource.
If the protocol is "file" and the path specifies a file, permission is granted to read all files and (recursively) all files and subdirectories contained in that directory. This is so applets with a codebase of file:/blah/some.jar can read in file:/blah/, which is needed to be backward compatible. We also add permission to connect back to the "localhost".
codesource | the codesource |
---|
Release this AppletClassLoader and its ThreadGroup/AppContext. If nothing else has grabbed this AppletClassLoader, its ThreadGroup and AppContext will be destroyed. Because this method may destroy the AppletClassLoader's ThreadGroup, this method should NOT be called from within the AppletClassLoader's ThreadGroup. Changed modifier to protected in order to be able to overwrite this function in PluginClassLoader.java