public class ExtensionsSort extends TopologicalSort<IExtension,Bundle>
IExtensions by their plug-in dependencies such that any extension from bundle A
should be sorted before any extensions from any bundles that depend on A.
Consider having extensions from bundles A, B, and C, where A depends on B, and B depends on C. The result of this sort should be the extensions from C, then from B, and finally from A.
| Constructor and Description |
|---|
ExtensionsSort() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<Bundle> |
getDependencies(Bundle bundle)
Returns the bundles that currently require the given bundle.
|
protected Bundle |
getId(IExtension extension)
Return the identifier for the given object.
|
protected java.util.Collection<Bundle> |
getRequirements(Bundle bundle)
Returns the bundles that the given bundle requires.
|
sortprotected Bundle getId(IExtension extension)
TopologicalSortgetId in class TopologicalSort<IExtension,Bundle>extension - the objectprotected java.util.Collection<Bundle> getRequirements(Bundle bundle)
getRequirements in class TopologicalSort<IExtension,Bundle>bundle - the idIterable set of bundles currently required by the geiven
bundle. An empty Iterable will be returned if the given Bundle object
has become stale or there are no bundles required.java.lang.NullPointerException - if bundle is nullprotected java.util.Collection<Bundle> getDependencies(Bundle bundle)
If bundle is required and then re-exported by another bundle then all the requiring
bundles of the re-exporting bundle are included in the returned array as they transitively
depend on bundle.
getDependencies in class TopologicalSort<IExtension,Bundle>bundle - the idIterable set of bundles currently requiring bundle.
An empty Iterable will be returned if the bundle has become stale or
has no dependents.java.lang.NullPointerException - if bundle is null