public class PluginClassLoader extends URLClassLoader
URLClassLoader that is used to load Plugin classes from Jar files.
It is used to give an empty set of permissions to plugins in SandboxSecurityPolicy#isPlugin(ProtectionDomain)
so that plugins run in a protected sandbox.
It also overrides the URLClassLoader.getPermissions(CodeSource) method so that
custom permissions specified in a permissions.properties file can be applied to specific plugins.
| Constructor and Description |
|---|
PluginClassLoader(URL jarFileUrl)
Construct a
PluginClassLoader from an single URL |
PluginClassLoader(URL[] jarFileUrls)
Construct a
PluginClassLoader from an array of URL |
| Modifier and Type | Method and Description |
|---|---|
Properties |
getPermissionProperties() |
protected PermissionCollection |
getPermissions(CodeSource codesource)
|
void |
setPermissionProperties(Properties permissionProperties) |
addURL, close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic PluginClassLoader(URL jarFileUrl)
PluginClassLoader from an single URLjarFileUrl - an Jar file URLpublic PluginClassLoader(URL[] jarFileUrls)
PluginClassLoader from an array of URLjarFileUrls - the array of Jar file URLprotected PermissionCollection getPermissions(CodeSource codesource)
getPermissions in class URLClassLoadercodesource - the CodeSource to give the permissions toPermissionCollection whith all the appropriate permissionspublic Properties getPermissionProperties()
public void setPermissionProperties(Properties permissionProperties)
Copyright © 2017–2018 PlugFace. All rights reserved.