public class

OsgiServiceTrackerCacheImpl

extends Object
implements InitializingComponent OsgiServiceTrackerCache
java.lang.Object
   ↳ com.atlassian.jira.plugin.OsgiServiceTrackerCacheImpl

Summary

Public Constructors
OsgiServiceTrackerCacheImpl(OsgiContainerManager osgiContainerManager, PluginEventManager pluginEventManager)
Public Methods
void afterInstantiation()
<T> T getOsgiComponentOfType(Class<T> clazz)
Retrieves and returns a public component from OSGi land via its class.
void onOsgiContainerStartedEvent(OsgiContainerStartedEvent event)
Registers the serviceTrackers cache in JIRA instrumentation.
void onPluginFrameworkShutdownEvent(OsgiContainerStoppedEvent event)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.InitializingComponent
From interface com.atlassian.jira.plugin.OsgiServiceTrackerCache

Public Constructors

public OsgiServiceTrackerCacheImpl (OsgiContainerManager osgiContainerManager, PluginEventManager pluginEventManager)

Public Methods

public void afterInstantiation ()

Throws
Exception

public T getOsgiComponentOfType (Class<T> clazz)

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).

Parameters
clazz The interface class
Returns
  • The component, or null if not found

public void onOsgiContainerStartedEvent (OsgiContainerStartedEvent event)

Registers the serviceTrackers cache in JIRA instrumentation.

public void onPluginFrameworkShutdownEvent (OsgiContainerStoppedEvent event)