Package com.atlassian.jira.plugin
Interface ComponentClassManager
- All Known Implementing Classes:
DefaultComponentClassManager,MockComponentClassManager
public interface ComponentClassManager
Provides methods to help load and instantiate classes that can handle OSGi plugins with their ClassLoaders and
Components that don't live in core container.
- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescription<T> Class<T> Load a class from Jira core, or a plugin including plugins that are not enabled.<T> TnewInstance(String className) Instantiates the named class using OSGi ClassLoaders and Spring injection as appropriate.<T> TnewInstanceFromPlugin(Class<T> clazz, com.atlassian.plugin.Plugin plugin) Instantiates the named class by directly using the plugin the class was loaded from and its autowiring strategy.
-
Method Details
-
newInstance
Instantiates the named class using OSGi ClassLoaders and Spring injection as appropriate.- Parameters:
className- the name of the class to instantiate.- Returns:
- the instance of the requested class.
- Throws:
ClassNotFoundException- if the given className was not able to be loaded.
-
newInstanceFromPlugin
Instantiates the named class by directly using the plugin the class was loaded from and its autowiring strategy.- Parameters:
clazz- the class to instantiateplugin- the plugin in which the class was loaded from- Returns:
- the instance of the requested class.
- See Also:
-
loadClass
Load a class from Jira core, or a plugin including plugins that are not enabled.- Type Parameters:
T- The Class type.- Parameters:
className- Fully qualified class name.- Returns:
- the loaded Class of type T.
- Throws:
ClassNotFoundException- if the given className was not able to be loaded.
-