Class MessageVortex

java.lang.Object
net.messagevortex.MessageVortex
All Implemented Interfaces:
Callable<Integer>

public class MessageVortex extends Object implements Callable<Integer>
  • Field Details

  • Constructor Details

    • MessageVortex

      public MessageVortex()
  • Method Details

    • main

      public static void main(String[] args)

      Main command line method.

      Parameters:
      args - command line parameters
    • mainReturn

      public static int mainReturn(String[] args)

      Wrapper function as entry point for tests.

      Parameters:
      args - command line arguments
      Returns:
      the errorlevel to be returned
    • call

      public Integer call()
      Specified by:
      call in interface Callable<Integer>
    • getDaemon

      public static RunningDaemon getDaemon(String section, String classname, net.messagevortex.MessageVortex.DaemonType type) throws ClassNotFoundException

      This is a wrapper of the getConfiguredClass() methode.

      It modifies the return type to a RunningDaemon.

      Parameters:
      section - the name of the section where the config should be taken from
      classname - the name of the class to be instantiated
      type - the type of daemon to be checked
      Returns:
      the specified object
      Throws:
      ClassNotFoundException - if classname not found
    • getConfiguredClass

      public static Object getConfiguredClass(String section, String name, Class templateClass) throws ClassNotFoundException

      Loads a class of the given type.

      The class must have the same or a subtype of the template class and must provide a String constructor, taking the name of the config section.

      Parameters:
      section - the configuration section where the class was mentioned (for information purposes in output and to load subsequent data)
      name - the Name of the class
      templateClass - a template class. The loaded class must be the same or a subtyppe of the template class
      Returns:
      the loaded class
      Throws:
      ClassNotFoundException - if the named class cannot be found