Save This Page
Home » openjdk-7 » sun » applet » [javadoc | source]
sun.applet
public class: AppletClassLoader [javadoc | source]
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.
Field Summary
 int usageCount     
Constructor:
 protected AppletClassLoader(URL base) 
Method from sun.applet.AppletClassLoader Summary:
addJar,   findClass,   findResource,   findResources,   getAppContext,   getBaseURL,   getExceptionStatus,   getPermissions,   getResourceAsStream,   getResourceAsStreamFromJar,   getThreadGroup,   getURLs,   grab,   isJDK11Target,   isJDK12Target,   loadClass,   loadCode,   release,   setCodebaseLookup,   setExceptionStatus,   setJDK11Target,   setJDK12Target
Methods from java.net.URLClassLoader:
findResource,   findResources,   getURLs,   newInstance,   newInstance
Methods from java.lang.ClassLoader:
clearAssertionStatus,   getParent,   getResource,   getResourceAsStream,   getResources,   getSystemClassLoader,   getSystemResource,   getSystemResourceAsStream,   getSystemResources,   loadClass,   setClassAssertionStatus,   setDefaultAssertionStatus,   setPackageAssertionStatus
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.applet.AppletClassLoader Detail:
 protected  void addJar(String name) throws IOException 
 protected Class findClass(String name) throws ClassNotFoundException 
 public URL findResource(String name) 
 public Enumeration findResources(String name) throws IOException 
 public AppContext getAppContext() 
 URL getBaseURL() 
 public boolean getExceptionStatus() 
 protected PermissionCollection getPermissions(CodeSource codesource) 
    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".

 public InputStream getResourceAsStream(String name) 
    Returns an input stream for reading the specified resource. The search order is described in the documentation for #getResource(String) .

 public InputStream getResourceAsStreamFromJar(String name) 
    Returns 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) .

 public ThreadGroup getThreadGroup() 
 public URL[] getURLs() 
  void grab() 
    Grab this AppletClassLoader and its ThreadGroup/AppContext, so they won't be destroyed.
 Boolean isJDK11Target(Class clazz) 
    Determine if applet is targeted for JDK 1.1.
 Boolean isJDK12Target(Class clazz) 
    Determine if applet is targeted for JDK 1.2.
 public synchronized Class loadClass(String name,
    boolean resolve) throws ClassNotFoundException 
 Class loadCode(String name) throws ClassNotFoundException 
 protected  void release() 
    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
  void setCodebaseLookup(boolean codebaseLookup) 
    Set the codebase lookup flag.
 protected  void setExceptionStatus() 
  void setJDK11Target(Class clazz,
    boolean bool) 
    Set applet target level as JDK 1.1.
  void setJDK12Target(Class clazz,
    boolean bool) 
    Set applet target level as JDK 1.2.