Package com.atlassian.plugin.osgi.util
Class OsgiPluginUtil
java.lang.Object
com.atlassian.plugin.osgi.util.OsgiPluginUtil
Collection of util operation on different OSGi bits that results in Plugins
items
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerAccessorcreateNonExistingPluginContainer(String pluginKey) Creates null implementation of ContainerAccessor interfacestatic PluginDependenciesgetDependencies(org.osgi.framework.Bundle bundle) Determines which plugin keys are dependencies based on tracing the wires, categorising them as mandatory, optional or dynamic.
-
Constructor Details
-
OsgiPluginUtil
public OsgiPluginUtil()
-
-
Method Details
-
createNonExistingPluginContainer
Creates null implementation of ContainerAccessor interfaceThat 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
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_OPTIONALandPackageNamespace.RESOLUTION_DYNAMICare mapped to optional and dynamic, respectively. Any others are mapped to mandatory.- Returns:
- not null, possibly empty
- Since:
- 4.0
-