public class

JiraOsgiContainerManager

extends FelixOsgiContainerManager
implements Startable
java.lang.Object
   ↳ com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
     ↳ com.atlassian.jira.plugin.JiraOsgiContainerManager

Class Overview

OSGI container manager that caches service trackers. This is necessary to avoid creating ServiceTracker instances willy nilly, while at the same time circumventing a memory leak in FelixOsgiContainerManager (JRA-18766).

Summary

[Expand]
Inherited Constants
From class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
Public Constructors
JiraOsgiContainerManager(PluginPath pluginPath, PackageScannerConfiguration packageScannerConfig, HostComponentProvider provider, PluginEventManager eventManager)
Public Methods
<T> T getOsgiComponentOfType(Class<T> clazz)
Retrieves and returns a public component from OSGi land via its class name.
void start()
Registers the serviceTrackers cache in JIRA instrumentation.
void stop()
[Expand]
Inherited Methods
From class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
From class java.lang.Object
From interface com.atlassian.jira.extension.Startable
From interface com.atlassian.plugin.osgi.container.OsgiContainerManager

Public Constructors

public JiraOsgiContainerManager (PluginPath pluginPath, PackageScannerConfiguration packageScannerConfig, HostComponentProvider provider, PluginEventManager eventManager)

Public Methods

public T getOsgiComponentOfType (Class<T> clazz)

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 field) as they may be refreshed at any time as a plugin is enabled/disabled or the ComponentManager is reinitialised (after an XML import).

Added as part of the fix for JRADEV-6195.

Parameters
clazz The interface class as a String
Returns
  • the component, or null if not found

public void start ()

Registers the serviceTrackers cache in JIRA instrumentation.

public void stop ()