Package org.picocontainer.security

# Class CustomPermissionsURLClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.picocontainer.security.CustomPermissionsURLClassLoader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class CustomPermissionsURLClassLoader extends URLClassLoader
CustomPermissionsURLClassLoader extends URLClassLoader, adding the abilty to programatically add permissions easily. To be effective for permission management, it should be run in conjunction with a policy that restricts some of the classloaders, but not all. It's not ordinarily used by PicoContainer, but is here because PicoContainer is common to most classloader trees.

Author:
  Paul Hammant

## Constructor Summary

Constructors
Constructor
Description
`CustomPermissionsURLClassLoader(URL[] urls, Map<URL,Permissions> permissionsMap, ClassLoader parent)`

## Method Summary

Modifier and Type
Method
Description
`protected Class<?>`
`findClass(String name)`
`PermissionCollection`
`getPermissions(CodeSource codeSource)`
`Class<?>`
`loadClass(String name)`
`String`
`toString()`

### Methods inherited from class java.net.URLClassLoader

`addURL, close, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance`

### Methods inherited from class java.security.SecureClassLoader

`defineClass, defineClass`

### Methods inherited from class java.lang.ClassLoader

`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CustomPermissionsURLClassLoader

public CustomPermissionsURLClassLoader(URL[] urls, Map<URL,Permissions> permissionsMap, ClassLoader parent)

## Method Details

### loadClass

public Class<?> loadClass(String name) throws ClassNotFoundException

Overrides:
  `loadClass` in class `ClassLoader`
Throws:
  `ClassNotFoundException`

### findClass

protected Class<?> findClass(String name) throws ClassNotFoundException

Overrides:
  `findClass` in class `URLClassLoader`
Throws:
  `ClassNotFoundException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getPermissions

public PermissionCollection getPermissions(CodeSource codeSource)

Overrides:
  `getPermissions` in class `URLClassLoader`