Package com.atlassian.jira.plugin
Class OsgiServiceTrackerCacheImpl
java.lang.Object
com.atlassian.jira.plugin.OsgiServiceTrackerCacheImpl
- All Implemented Interfaces:
InitializingComponent
,OsgiServiceTrackerCache
public class OsgiServiceTrackerCacheImpl
extends Object
implements OsgiServiceTrackerCache, InitializingComponent
-
Constructor Summary
ConstructorsConstructorDescriptionOsgiServiceTrackerCacheImpl
(com.atlassian.plugin.osgi.container.OsgiContainerManager osgiContainerManager, com.atlassian.plugin.event.PluginEventManager pluginEventManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
<T> T
getOsgiComponentOfType
(Class<T> clazz) Retrieves and returns a public component from OSGi land via its class.void
onOsgiContainerStartedEvent
(com.atlassian.plugin.osgi.container.OsgiContainerStartedEvent event) Registers theserviceTrackers
cache in JIRA instrumentation.void
onPluginFrameworkShutdownEvent
(com.atlassian.plugin.osgi.container.OsgiContainerStoppedEvent event)
-
Constructor Details
-
OsgiServiceTrackerCacheImpl
public OsgiServiceTrackerCacheImpl(com.atlassian.plugin.osgi.container.OsgiContainerManager osgiContainerManager, com.atlassian.plugin.event.PluginEventManager pluginEventManager)
-
-
Method Details
-
afterInstantiation
- Specified by:
afterInstantiation
in interfaceInitializingComponent
- Throws:
Exception
-
getOsgiComponentOfType
Retrieves and returns a public component from OSGi land via its class. This method can be used to retrieve a component provided via a plugins OSGi bundle. Please note that components returned via this method should NEVER be cached (e.g. in a field) as they may be refreshed at any time as a plugin is enabled/disabled or the ComponentManager is reinitialised (after an XML import).- Specified by:
getOsgiComponentOfType
in interfaceOsgiServiceTrackerCache
- Parameters:
clazz
- The interface class- Returns:
- The component, or null if not found
- Since:
- v6.4
-
onOsgiContainerStartedEvent
public void onOsgiContainerStartedEvent(com.atlassian.plugin.osgi.container.OsgiContainerStartedEvent event) Registers theserviceTrackers
cache in JIRA instrumentation. -
onPluginFrameworkShutdownEvent
public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.osgi.container.OsgiContainerStoppedEvent event)
-