Package nz.org.riskscape.engine.function
Class FunctionClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
nz.org.riskscape.engine.function.FunctionClassLoader
- All Implemented Interfaces:
Closeable
,AutoCloseable
Each JavaFunction
may have classes loaded from its own FunctionClassLoader
.
These should inherit from the Engine
's class loader, so that the functions can access the core classes.
TODO User-defined functions are in this form a sort of Riskscape-sanctioned malware vector. There is a ticket, https://bugs.riskscape.org.nz/issues/434, that has a bunch of mitigations for making this less ropey.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getResource
(String name) getResourceAsStream
(String name) getResources
(String name) int
hashCode()
protected Class<?>
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
FunctionClassLoader
Construtor
- Parameters:
urls
- Array of urls with own libraries and all exported libraries of plugins that are required to this pluginparent
-
-
-
Method Details
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResource
in classClassLoader
-
getResources
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
getResourceAsStream
- Overrides:
getResourceAsStream
in classURLClassLoader
-
hashCode
public int hashCode() -
equals
-