com.atlassian.jira.plugin
Class JiraOsgiContainerManager

java.lang.Object
  extended by com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
      extended by com.atlassian.jira.plugin.JiraOsgiContainerManager
All Implemented Interfaces:
Startable, com.atlassian.plugin.osgi.container.OsgiContainerManager

public class JiraOsgiContainerManager
extends com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
implements Startable

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


Field Summary
 
Fields inherited from class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
OSGI_FRAMEWORK_BUNDLES_ZIP, REFRESH_TIMEOUT
 
Constructor Summary
JiraOsgiContainerManager(PluginPath pluginPath, com.atlassian.plugin.osgi.container.PackageScannerConfiguration packageScannerConfig, com.atlassian.plugin.osgi.hostcomponents.HostComponentProvider provider, com.atlassian.plugin.event.PluginEventManager eventManager)
           
 
Method Summary
<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()
           
 
Methods inherited from class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
clearExportCache, getBundles, getHostComponentRegistrations, getRegisteredServices, getServiceTracker, getServiceTracker, installBundle, isRunning, onPluginFrameworkWarmRestarting, onPluginUninstallation, onPluginUpgrade, onShutdown, onStart, setDisableMultipleBundleVersions, setFelixLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraOsgiContainerManager

public JiraOsgiContainerManager(PluginPath pluginPath,
                                com.atlassian.plugin.osgi.container.PackageScannerConfiguration packageScannerConfig,
                                com.atlassian.plugin.osgi.hostcomponents.HostComponentProvider provider,
                                com.atlassian.plugin.event.PluginEventManager eventManager)
Method Detail

getOsgiComponentOfType

public <T> 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
Since:
5.1

start

public void start()
Registers the serviceTrackers cache in JIRA instrumentation.

Specified by:
start in interface Startable
Specified by:
start in interface com.atlassian.plugin.osgi.container.OsgiContainerManager
Overrides:
start in class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager

stop

public void stop()
          throws com.atlassian.plugin.osgi.container.OsgiContainerException
Specified by:
stop in interface com.atlassian.plugin.osgi.container.OsgiContainerManager
Overrides:
stop in class com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager
Throws:
com.atlassian.plugin.osgi.container.OsgiContainerException


Copyright © 2002-2013 Atlassian. All Rights Reserved.