Class OsgiPluginUtil

java.lang.Object
com.atlassian.plugin.osgi.util.OsgiPluginUtil

public final class OsgiPluginUtil extends Object
Collection of util operation on different OSGi bits that results in Plugins items
  • Constructor Details

    • OsgiPluginUtil

      public OsgiPluginUtil()
  • Method Details

    • createNonExistingPluginContainer

      public static ContainerAccessor createNonExistingPluginContainer(String pluginKey)
      Creates null implementation of ContainerAccessor interface

      That implementation used when plugin doesn't export access to any internal IoC. In that case a try to access container means some logical bug in the design, for example reference some instance ID in module type definition, so it makes sense to fail fast with reasonable explanation rather then return some empty state which will masks real problem.

      Parameters:
      pluginKey - plugin identifier to be written in container exceptions
      Returns:
      Null implementation of ContainerAccessor interface which is throwing exceptions on each call
    • getDependencies

      public static PluginDependencies getDependencies(org.osgi.framework.Bundle bundle)
      Determines which plugin keys are dependencies based on tracing the wires, categorising them as mandatory, optional or dynamic.

      Bundle must be in RESOLVED state at least. If Bundle is in INSTALLED or UNINSTALLED states wires are not existing and method returns empty dependencies set Namespace.RESOLUTION_OPTIONAL and PackageNamespace.RESOLUTION_DYNAMIC are mapped to optional and dynamic, respectively. Any others are mapped to mandatory.

      Returns:
      not null, possibly empty
      Since:
      4.0