Package com.atlassian.plugin.classloader
Class PluginsClassLoader
java.lang.Object
java.lang.ClassLoader
com.atlassian.plugin.classloader.PluginsClassLoader
A ClassLoader that will loop over all enabled Plugins, attempting to load the given class (or other resource) from
the ClassLoader of each plugin in turn.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPluginsClassLoader(PluginAccessor pluginAccessor) PluginsClassLoader(ClassLoader parent, PluginAccessor pluginAccessor, PluginEventManager pluginEventManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>protected URLfindResource(String name) protected Enumeration<URL>findResources(String name) The default implementation returns a "singleton" enumeration over the result ofClassLoader.findResource(String).getPluginForClass(String className) Returns the Plugin that will be used to load the given class name.voidvoidnotifyUninstallPlugin(Plugin plugin) voidvoidMethods 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, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
PluginsClassLoader
-
PluginsClassLoader
public PluginsClassLoader(ClassLoader parent, PluginAccessor pluginAccessor, PluginEventManager pluginEventManager) - Parameters:
parent- The parent classloaderpluginAccessor- The plugin accessorpluginEventManager- The plugin event manager- Since:
- 2.5.0
-
-
Method Details
-
findResource
-
findClass
- Throws:
ClassNotFoundException
-
notifyUninstallPlugin
-
getPluginForClass
Returns the Plugin that will be used to load the given class name. If no enabled plugin can load the given class, then null is returned.- Parameters:
className- the Class name- Returns:
- the Plugin that will be used to load the given class name.
- Since:
- 2.3
-
onPluginEnabled
-
onPluginModuleEnabled
-
notifyPluginOrModuleEnabled
public void notifyPluginOrModuleEnabled() -
findResources
The default implementation returns a "singleton" enumeration over the result ofClassLoader.findResource(String).- Overrides:
findResourcesin classClassLoader- Parameters:
name- the name of the resource- Returns:
- an enumeration over all matching resources
- Throws:
IOException- This implementation will not throw this exception
-