Package org.apache.nutch.plugin
Class PluginClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.nutch.plugin.PluginClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
The
PluginClassLoader is a child-first classloader that only
contains classes of the runtime libraries setuped in the plugin manifest file
and exported libraries of plugins that are required plugins. Libraries can be
exported or not. Not exported libraries are only used in the plugin own
PluginClassLoader. Exported libraries are available for
PluginClassLoader of plugins that depends on these plugins.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetResource(String name) getResourceAsStream(String name) getResources(String name) inthashCode()protected Class<?>Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods 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
-
PluginClassLoader
Overloaded constructor- Parameters:
urls- Array of urls with own libraries and all exported libraries of plugins that are required for this pluginparent- the parentClassLoaderresponsible for loading classes defined in urls.
-
-
Method Details
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResourcein classClassLoader
-
getResources
- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-
getResourceAsStream
- Overrides:
getResourceAsStreamin classURLClassLoader
-
hashCode
public int hashCode() -
equals
-