java.lang.Object | |
↳ | com.atlassian.jira.ComponentManager |
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
This component manager uses PicoContainer to resolve all the dependencies between components.
It is responsible for initialising a large number of components in JIRA. Any components defined here may be injected via a constructor.
The ComponentManager also has static accessor methods for accessing components, such as
getComponent(Class)
. Plugins developers should use ComponentAccessor
for this, instead.
The ComponentManager also has various static accessor methods for non-Pico-managed objects, eg.
ComponentManager.getInstance().getProjectManager()
. Plugins developers should no longer use these -
please use ComponentAccessor
instead.
More information can be found at the picocontainer website.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ComponentManager.PluginSystemState | |||||||||||
ComponentManager.State | The state of the ComponentManager . |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTENSION_PROVIDER_PROPERTY |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initialization registers components for the bootstrap loading of JIRA.
| |||||||||||
Retrieves and returns a component which is an instance of given class.
| |||||||||||
Retrieves and returns a component which is an instance of given class.
| |||||||||||
Returns all the components currently inside of Pico which are instances of the given class.
| |||||||||||
Returns all the components currently inside Pico which are instances of the given class, mapping them to their
component key.
| |||||||||||
Returns container
| |||||||||||
Retuns a singleton instance of this class.
| |||||||||||
Returns container
| |||||||||||
This method is deprecated.
since 6.0 - please use the jira-api
getOSGiComponentInstanceOfType(Class) instead
| |||||||||||
What
ComponentManager.PluginSystemState is the plugin system in?
This can be used to discover whether delayed plugins were started. | |||||||||||
What
ComponentManager.State is the ComponentManager in. | |||||||||||
Initialization registers components and then registers extensions.
| |||||||||||
Start delayed plugins (if any)
| |||||||||||
If JIRA needs to be setup, then add the extra components needed to the bootstrap container.
| |||||||||||
Shutdown.
| |||||||||||
Starts the plugin system and registers plugin components with pico.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.jira.util.Shutdown
|
Initialization registers components for the bootstrap loading of JIRA. This gets enough of PICO registered to allow JIRA to bootstrap without a database.
Retrieves and returns a component which is an instance of given class.
In practise, this is the same as getComponentInstanceOfType(Class)
except it will fail faster if the
given Class is not a known component key (it also has a shorter and more meaningful name).
Please note that this method only gets components from JIRA's core Pico Containter. That is, it retrieves
core components and components declared in Plugins1 plugins, but not components declared in Plugins2 plugins.
Plugins2 components can be retrieved via the getOSGiComponentInstanceOfType(Class)
method, but only if
they are public.
clazz | class to find a component instance by |
---|
Retrieves and returns a component which is an instance of given class.
In practise, this is the same as getComponent(Class)
except it will try to find a unique component that
implements/extends the given Class even if the Class is not an actual component key.
Please note that this method only gets components from JIRA's core Pico Containter. That is, it retrieves
core components and components declared in Plugins1 plugins, but not components declared in Plugins2 plugins.
Plugins2 components can be retrieved via the getOSGiComponentInstanceOfType(Class)
method, but only if
they are public.
clazz | class to find a component instance by |
---|
Returns all the components currently inside of Pico which are instances of the given class.
clazz | the class to search for. |
---|
Returns all the components currently inside Pico which are instances of the given class, mapping them to their component key.
iface | The class to search for |
---|
Returns container
Retuns a singleton instance of this class.
Returns container
This method is deprecated.
since 6.0 - please use the jira-api getOSGiComponentInstanceOfType(Class)
instead
Retrieves and returns a public component from OSGi land via its class name. This method can be used to retrieve a component provided via a plugins2 OSGi bundle. Please note that components returned via this method should *NEVER* be cached (e.g. in a static field) as they may be refreshed at any time as a plugin is enabled/disabled or the componentManager is reinitialised (after an XML import).
Plugin developers should prefer the API method getOSGiComponentInstanceOfType(Class)
.
It is important to note that this only works for public components. That is components with public="true"
declared in their XML configuration. This means that they are available for other plugins to
import.
A use case for this is when for example for the dashboards plugin. In several areas in JIRA we may want to render gadgets via the com.atlassian.gadgets.view.GadgetViewFactory. Whilst the interface for this component is available in JIRA core, the implementation is provided by the dashboards OSGi bundle. This method will allow us to access it.
clazz | class to find an OSGi component instance for |
---|
What ComponentManager.PluginSystemState
is the plugin system in?
This can be used to discover whether delayed plugins were started.
What ComponentManager.State
is the ComponentManager
in.
Initialization registers components and then registers extensions.
Start delayed plugins (if any)
If JIRA needs to be setup, then add the extra components needed to the bootstrap container.
Shutdown. Should not throw any exceptions.
Starts the plugin system and registers plugin components with pico. If there is no tenant, delayed (phase 2) plugins will not be started.