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, newInstance
defineClass, defineClass
clearAssertionStatus, 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, setSigners
public PluginClassLoader(URL jarFileUrl)
PluginClassLoader
from an single URL
jarFileUrl
- an Jar file URL
public PluginClassLoader(URL[] jarFileUrls)
PluginClassLoader
from an array of URL
jarFileUrls
- the array of Jar file URL
protected PermissionCollection getPermissions(CodeSource codesource)
getPermissions
in class URLClassLoader
codesource
- 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.