com.atlassian.jira.plugin
Class DefaultComponentClassManager

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

public class DefaultComponentClassManager
extends java.lang.Object
implements ComponentClassManager


Constructor Summary
DefaultComponentClassManager(com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
<T> java.lang.Class<T>
loadClass(java.lang.String className)
          Load a class from Jira core, or a plugin including plugins that are not enabled.
<T> T
newInstance(java.lang.String className)
          Instantiates the named class using OSGi ClassLoaders and Pico/Spring injection as appropriate.
<T> T
newInstanceFromPlugin(java.lang.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(java.lang.String className)
              throws java.lang.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:
java.lang.ClassNotFoundException - if the given className was not able to be loaded.

newInstanceFromPlugin

public <T> T newInstanceFromPlugin(java.lang.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> java.lang.Class<T> loadClass(java.lang.String className)
                             throws java.lang.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:
java.lang.ClassNotFoundException - if the given className was not able to be loaded.


Copyright © 2002-2010 Atlassian. All Rights Reserved.