Save This Page
Home » openjdk-7 » java » security » [javadoc | source]
java.security
public class: SecureClassLoader [javadoc | source]
java.lang.Object
   java.lang.ClassLoader
      java.security.SecureClassLoader

Direct Known Subclasses:
    PrivateMLet, MLet, URLClassLoader, FactoryURLClassLoader

This class extends ClassLoader with additional support for defining classes with an associated code source and permissions which are retrieved by the system policy by default.
Fields inherited from java.lang.ClassLoader:
assertionLock,  classAssertionStatus
Constructor:
 protected SecureClassLoader() 
 protected SecureClassLoader(ClassLoader parent) 
    Creates a new SecureClassLoader using the specified parent class loader for delegation.

    If there is a security manager, this method first calls the security manager's checkCreateClassLoader method to ensure creation of a class loader is allowed.

    Parameters:
    parent - the parent ClassLoader
    Throws:
    SecurityException - if a security manager exists and its checkCreateClassLoader method doesn't allow creation of a class loader.
    Also see:
    SecurityManager#checkCreateClassLoader
    exception: SecurityException - if a security manager exists and its checkCreateClassLoader method doesn't allow creation of a class loader.
Method from java.security.SecureClassLoader Summary:
defineClass,   defineClass,   getPermissions
Methods from java.lang.ClassLoader:
addClass,   clearAssertionStatus,   defineClass,   defineClass,   defineClass,   defineClass,   definePackage,   desiredAssertionStatus,   findClass,   findLibrary,   findLoadedClass,   findNative,   findResource,   findResources,   findSystemClass,   getBootstrapClassPath,   getCallerClassLoader,   getClassLoadingLock,   getPackage,   getPackages,   getParent,   getResource,   getResourceAsStream,   getResources,   getSystemClassLoader,   getSystemResource,   getSystemResourceAsStream,   getSystemResources,   isAncestor,   loadClass,   loadClass,   loadLibrary,   registerAsParallelCapable,   resolveClass,   setClassAssertionStatus,   setDefaultAssertionStatus,   setPackageAssertionStatus,   setSigners
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.security.SecureClassLoader Detail:
 protected final Class<?> defineClass(String name,
    ByteBuffer b,
    CodeSource cs) 
    Converts a ByteBuffer into an instance of class Class, with an optional CodeSource. Before the class can be used it must be resolved.

    If a non-null CodeSource is supplied a ProtectionDomain is constructed and associated with the class being defined.

 protected final Class<?> defineClass(String name,
    byte[] b,
    int off,
    int len,
    CodeSource cs) 
    Converts an array of bytes into an instance of class Class, with an optional CodeSource. Before the class can be used it must be resolved.

    If a non-null CodeSource is supplied a ProtectionDomain is constructed and associated with the class being defined.

 protected PermissionCollection getPermissions(CodeSource codesource) 
    Returns the permissions for the given CodeSource object.

    This method is invoked by the defineClass method which takes a CodeSource as an argument when it is constructing the ProtectionDomain for the class being defined.