Class ManifestLoader

java.lang.Object
de.uni_hildesheim.sse.easy.loader.AbstractStartupInfoLoader
de.uni_hildesheim.sse.easy.loader.ManifestLoader
All Implemented Interfaces:
ILoader

public class ManifestLoader extends AbstractStartupInfoLoader
Experimental: Loader that identifies the available services/activators from Manifests.
Author:
Holger Eichelberger
  • Field Details

    • MF_PATH

      public static final String MF_PATH
      The default (relative) manifest path: "META-INF/MANIFEST.MF".
      See Also:
  • Constructor Details

    • ManifestLoader

      public ManifestLoader() throws IOException
      Creates a manifest loader with initially non-verbose output.
      Throws:
      IOException - if loading fails
    • ManifestLoader

      public ManifestLoader(ClassLoader loader) throws IOException
      Creates a manifest loader with initially non-verbose output.
      Parameters:
      loader - the resource/bundle loader, may be null for default (this class/this thread context)
      Throws:
      IOException - if loading fails
    • ManifestLoader

      public ManifestLoader(boolean verbose) throws IOException
      Creates a manifest loader.
      Parameters:
      verbose - whether verbose output shall be produced
      Throws:
      IOException - if loading fails
    • ManifestLoader

      public ManifestLoader(boolean verbose, ClassLoader loader) throws IOException
      Creates a manifest loader.
      Parameters:
      verbose - whether verbose output shall be produced
      loader - the resource/bundle loader, may be null for default (this class/this thread context)
      Throws:
      IOException - if loading fails
  • Method Details

    • setLoader

      public void setLoader(ClassLoader loader)
      Description copied from interface: ILoader
      Sets the class loader for loading EASy bundles. By default, the class loader of the implementing class is used.
      Specified by:
      setLoader in interface ILoader
      Overrides:
      setLoader in class AbstractStartupInfoLoader
      Parameters:
      loader - the loader, ignored if null
    • loadManifests

      public static List<StartupInfo> loadManifests(boolean verbose, ClassLoader loader) throws IOException
      Loads the available manifests.
      Parameters:
      verbose - whether verbose output shall be produced
      loader - the classloader to get the manifest resources from, may be null for this thread context
      Returns:
      information instances about the loaded services/activators
      Throws:
      IOException - if loading fails
    • loadManifest

      public static StartupInfo loadManifest(URL url, DocumentBuilder builder, boolean verbose) throws IOException
      Load a given manifest.
      Parameters:
      url - the URL of the manifest
      builder - a re-usable document builder
      verbose - produce verbose output
      Returns:
      information instances about the loaded services/activators
      Throws:
      IOException - if loading fails