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.
-
-
Constructor Summary
Constructors Constructor Description CustomPermissionsURLClassLoader(URL[] urls, Map<URL,Permissions> permissionsMap, ClassLoader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Constructor Detail
-
CustomPermissionsURLClassLoader
public CustomPermissionsURLClassLoader(URL[] urls, Map<URL,Permissions> permissionsMap, ClassLoader parent)
-
-
Method Detail
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findClass
protected Class<?> findClass(String name) throws ClassNotFoundException
- Overrides:
findClass
in classURLClassLoader
- Throws:
ClassNotFoundException
-
getPermissions
public PermissionCollection getPermissions(CodeSource codeSource)
- Overrides:
getPermissions
in classURLClassLoader
-
-