Class BundleRegistry

java.lang.Object
de.uni_hildesheim.sse.easy.loader.framework.BundleRegistry

public class BundleRegistry extends Object
A registry of created bundle information objects supporting the resolution of bundles.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • BundleRegistry

      private BundleRegistry()
      Creates the root bundle registry.
    • BundleRegistry

      public BundleRegistry(BundleRegistry parent)
      Creates a delegating bundle registry which asks parent if bundles cannot be found.
      Parameters:
      parent - the parent registry
  • Method Details

    • addGlobalIgnore

      public static void addGlobalIgnore(String name)
      Adds a symbolic bundle name to the global ignore list.
      Parameters:
      name - the name of the bundle (null will be ignored)
    • getInstance

      public static BundleRegistry getInstance()
      Returns the current instance of this registry.
      Returns:
      the current instance
    • setInstance

      public static void setInstance(BundleRegistry registry)
      Redefines the current bundle registry.
      Parameters:
      registry - the current registry (null will be ignored)
    • ignoreBundle

      boolean ignoreBundle(String name)
      Returns whether the given bundle shall be ignored.
      Parameters:
      name - the name of the bundle
      Returns:
      true if it shall be ignored, false else
    • setEmitIgoredWarnings

      public void setEmitIgoredWarnings(boolean emit)
      Defines whether ignored warnings shall be emitted.
      Parameters:
      emit - true if these warnings are emitted, false else
    • add

      void add(BundleInfo info)
      Adds a bundle information object to this registry.
      Parameters:
      info - the information object
    • collectVersions

      private static String collectVersions(List<BundleInfo> infos)
      Collects the version information from infos.
      Parameters:
      infos - the information instances to be considered
      Returns:
      the version information as String
    • getInfoSafe

      private List<BundleInfo> getInfoSafe(String name)
      Returns the list of bundles with the same name.
      Parameters:
      name - the symbolic bundle name
      Returns:
      the list of bundles (created and hooked in if required)
    • get

      public BundleInfo get(String name, EasyDependency versionSpec)
      Returns a bundle information instance with the specified name. If multiple bundle versions for the same name are registered, the first is returned (version specification is currently not supported).
      Parameters:
      name - the symbolic name
      versionSpec - the version specification (currently not considered in resolution, just stored)
      Returns:
      the related bundle information object, resolved or unresolved or null if not found
    • getAllBundles

      public List<BundleInfo> getAllBundles()
      Returns all bundles known to this registry.
      Returns:
      all bundles
    • getRootBundles

      public List<BundleInfo> getRootBundles()
      Returns the root bundles, i.e., those without required bundles.
      Returns:
      the root bundles (may be empty)
    • getUnresolvedBundles

      public List<BundleInfo> getUnresolvedBundles()
      Returns currently unresolved bundles, i.e., those without resolving JAR file.
      Returns:
      the unresolved bundles (may be empty)