public class

PluginsClassLoader

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

Class Overview

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.

Summary

Public Constructors
PluginsClassLoader(PluginAccessor pluginAccessor)
PluginsClassLoader(ClassLoader parent, PluginAccessor pluginAccessor)
This constructor is deprecated. Since 2.5.0, use PluginsClassLoader(ClassLoader, PluginAccessor, PluginEventManager) instead
PluginsClassLoader(ClassLoader parent, PluginAccessor pluginAccessor, PluginEventManager pluginEventManager)
Public Methods
Plugin getPluginForClass(String className)
Returns the Plugin that will be used to load the given class name.
synchronized void notifyPluginOrModuleEnabled()
synchronized void notifyUninstallPlugin(Plugin plugin)
void onPluginEnabled(PluginEnabledEvent event)
void onPluginModuleEnabled(PluginModuleEnabledEvent event)
Protected Methods
Class<?> findClass(String className)
URL findResource(String name)
Enumeration<URL> findResources(String name)
The default implementation returns a "singleton" enumeration over the result of findResource(String).
[Expand]
Inherited Methods
From class java.lang.ClassLoader
From class java.lang.Object

Public Constructors

public PluginsClassLoader (PluginAccessor pluginAccessor)

public PluginsClassLoader (ClassLoader parent, PluginAccessor pluginAccessor)

This constructor is deprecated.
Since 2.5.0, use PluginsClassLoader(ClassLoader, PluginAccessor, PluginEventManager) instead

public PluginsClassLoader (ClassLoader parent, PluginAccessor pluginAccessor, PluginEventManager pluginEventManager)

Parameters
parent The parent classloader
pluginAccessor The plugin accessor
pluginEventManager The plugin event manager

Public Methods

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.

public synchronized void notifyPluginOrModuleEnabled ()

public synchronized void notifyUninstallPlugin (Plugin plugin)

public void onPluginEnabled (PluginEnabledEvent event)

public void onPluginModuleEnabled (PluginModuleEnabledEvent event)

Protected Methods

protected Class<?> findClass (String className)

protected URL findResource (String name)

protected Enumeration<URL> findResources (String name)

The default implementation returns a "singleton" enumeration over the result of findResource(String).

Parameters
name the name of the resource
Returns
  • an enumeration over all matching resources
Throws
This implementation will not throw this exception
IOException