com.atlassian.jira.plugin
Class DefaultComponentClassManager

java.lang.Object
  extended by com.atlassian.jira.plugin.DefaultComponentClassManager
All Implemented Interfaces:
ComponentClassManager

public class DefaultComponentClassManager
extends Object
implements ComponentClassManager


Constructor Summary
DefaultComponentClassManager(com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
<T> Class<T>
loadClass(String className)
          Load a class from Jira core, or a plugin including plugins that are not enabled.
<T> T
newInstance(String className)
          Instantiates the named class using OSGi ClassLoaders and Pico/Spring injection as appropriate.
<T> T
newInstanceFromPlugin(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponentClassManager

public DefaultComponentClassManager(com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

newInstance

public <T> T newInstance(String className)
              throws ClassNotFoundException
Description copied from interface: ComponentClassManager
Instantiates the named class using OSGi ClassLoaders and Pico/Spring injection as appropriate.

Specified by:
newInstance in interface ComponentClassManager
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

public <T> T newInstanceFromPlugin(Class<T> clazz,
                                   com.atlassian.plugin.Plugin plugin)
Description copied from interface: ComponentClassManager
Instantiates the named class by directly using the plugin the class was loaded from and its autowiring strategy.

Specified by:
newInstanceFromPlugin in interface ComponentClassManager
Parameters:
clazz - the class to instantiate
plugin - the plugin in which the class was loaded from
Returns:
the instance of the requested class.
See Also:
ComponentClassManager.newInstance(String)

loadClass

public <T> Class<T> loadClass(String className)
                   throws ClassNotFoundException
Description copied from interface: ComponentClassManager
Load a class from Jira core, or a plugin including plugins that are not enabled.

Specified by:
loadClass in interface ComponentClassManager
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.


Copyright © 2002-2012 Atlassian. All Rights Reserved.