Class PluginsClassLoader

java.lang.Object
java.lang.ClassLoader
com.atlassian.plugin.classloader.PluginsClassLoader

public class PluginsClassLoader extends ClassLoader
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 Details

    • PluginsClassLoader

      public PluginsClassLoader(PluginAccessor pluginAccessor)
    • PluginsClassLoader

      public PluginsClassLoader(ClassLoader parent, PluginAccessor pluginAccessor, PluginEventManager pluginEventManager)
      Parameters:
      parent - The parent classloader
      pluginAccessor - The plugin accessor
      pluginEventManager - The plugin event manager
      Since:
      2.5.0
  • Method Details

    • findResource

      protected URL findResource(String name)
    • findClass

      protected Class<?> findClass(String className) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • notifyUninstallPlugin

      public void notifyUninstallPlugin(Plugin plugin)
    • getPluginForClass

      public Plugin getPluginForClass(String className)
      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

      public void onPluginEnabled(PluginEnabledEvent event)
    • onPluginModuleEnabled

      public void onPluginModuleEnabled(PluginModuleEnabledEvent event)
    • notifyPluginOrModuleEnabled

      public void notifyPluginOrModuleEnabled()
    • findResources

      protected Enumeration<URL> findResources(String name) throws IOException
      The default implementation returns a "singleton" enumeration over the result of ClassLoader.findResource(String).
      Overrides:
      findResources in class ClassLoader
      Parameters:
      name - the name of the resource
      Returns:
      an enumeration over all matching resources
      Throws:
      IOException - This implementation will not throw this exception