Class OsgiServiceTrackerCacheImpl

java.lang.Object
com.atlassian.jira.plugin.OsgiServiceTrackerCacheImpl
All Implemented Interfaces:
InitializingComponent, OsgiServiceTrackerCache

public class OsgiServiceTrackerCacheImpl extends Object implements OsgiServiceTrackerCache, InitializingComponent
  • Constructor Details

    • OsgiServiceTrackerCacheImpl

      public OsgiServiceTrackerCacheImpl(com.atlassian.plugin.osgi.container.OsgiContainerManager osgiContainerManager, com.atlassian.plugin.event.PluginEventManager pluginEventManager)
  • Method Details

    • afterInstantiation

      public void afterInstantiation() throws Exception
      Specified by:
      afterInstantiation in interface InitializingComponent
      Throws:
      Exception
    • getOsgiComponentOfType

      @Nullable public <T> 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).
      Specified by:
      getOsgiComponentOfType in interface OsgiServiceTrackerCache
      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 the serviceTrackers cache in JIRA instrumentation.
    • onPluginFrameworkShutdownEvent

      public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.osgi.container.OsgiContainerStoppedEvent event)