Class Loader

java.lang.Object
de.uni_hildesheim.sse.easy.loader.AbstractLoader
de.uni_hildesheim.sse.easy.loader.Loader
All Implemented Interfaces:
ILoader

public class Loader extends AbstractLoader implements ILoader
The standalone loader class. Basically, it emulates some very core functions of OSGi/Equinox and Eclipse Declarative Services to dynamically determine the bundle depedency hierarchy, the activators (although standalone EASy core bundles shall not have activators) and the dynamic initializers expressed as Declarative Services. Currently, due to the design of EASy, this Loader just ignores the class loader separation performed by OSGi and loads all classes into the same Classloader.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • Loader

      public Loader()
      Creates a new loader with default base ".".
    • Loader

      public Loader(File base)
      Creates a new loader.
      Parameters:
      base - the base folder where the plugins are located in
  • Method Details

    • startup

      public void startup()
      Description copied from interface: ILoader
      Performs EASy startup activities.
      Specified by:
      startup in interface ILoader
    • main

      public static void main(String[] args)
      Starts the loader for testing.
      Parameters:
      args - ignored
    • bootstrap

      public void bootstrap(URL jarToExecute)
      Bootstraps EASy.
      Parameters:
      jarToExecute - an optional URL containing executable code
    • executeCommand

      public void executeCommand(String arg) throws CommandExecutionException
      Executes a user command.
      Parameters:
      arg - the argument for the command.
      Throws:
      CommandExecutionException - in case that execution fails
    • loadAndInitialize

      public ClassLoader loadAndInitialize(List<URL> urls, List<BundleInfo> infos)
      Loads and initializes the bundles.
      Parameters:
      urls - the URLs of the jars to be turned into a class loader
      infos - the bundles to be initialized
      Returns:
      the class loader if successful, null else
    • shutdown

      public void shutdown()
      Description copied from interface: ILoader
      Performs EASy shutdown activities.
      Specified by:
      shutdown in interface ILoader
    • printBootstrapData

      private void printBootstrapData(List<URL> urls, List<BundleInfo> instantiate)
      Prints the bootstrap data.
      Parameters:
      urls - the jar files to load (modified as a side effect)
      instantiate - the bundles to instantiate, either via activator or DS (modified as a side effect)
    • setVerbose

      public void setVerbose(boolean verbose)
      Description copied from interface: ILoader
      Changes the verbosity mode.
      Specified by:
      setVerbose in interface ILoader
      Parameters:
      verbose - shall we be verbose?
    • 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
      Parameters:
      loader - the loader, ignored if null