Class SpringStartup

java.lang.Object
de.iip_ecosphere.platform.examples.SpringStartup

public class SpringStartup extends Object
Spring Cloud Stream emulating startup code. Considers system properties ("iip.test.java8" and "iip.springStart.args") as well as command line arguments "iip.test.brokerPort" (broker port to use) and ARG_STOP (auto-stop time in ms). In contrast to a startup of an application with the platform and the service manager, services are started here in arbitrary sequence without considering their dependencies. Testing input shall consider a certain startup time before causing actions.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • SpringStartup

      public SpringStartup()
  • Method Details

    • main

      public static void main(String[] args)
      Main program to start the application. Takes into account additional args via system property "iip.springStart.args" to allow for maven basic execution with fixed parameters in POM and additional arguments passed in via "iip.springStart.args".
      Parameters:
      args - the command line arguments; the first is the artifact file to start, the remaining is passed on to Spring
    • start

      public static final void start(String... args)
      Starts the application. Used from generated templates. Do not change signature.
      Parameters:
      args - the command line arguments; the first is the artifact file to start, the remaining is passed on to Spring
    • start

      public static void start(File artifact, String... args)
      Starts the application. Used from examples. Do not change signature.
      Parameters:
      artifact - the artifact file (JAR/ZIP) containing the application
      args - the command line arguments
    • addAasNotificationMode

      private static void addAasNotificationMode(String[] args, List<String> cmdArgs)
      Retrieves the AAS notification mode from cmd line argument Starter.ARG_AAS_NOTIFICATION and adds it to cmdArgs.
      Parameters:
      args - the command line arguments
      cmdArgs - the command line arguments to be modified as a side effect
      See Also:
      • Starter.setAasNotificationMode(String[], NotificationMode)
    • addAppId

      private static void addAppId(String[] args, List<String> cmdArgs)
      If given in args, adds Starter.PARAM_IIP_APP_ID to cmdArgs.
      Parameters:
      args - the command line arguments
      cmdArgs - the command line arguments to be modified as a side effect
    • start

      public static void start(File artifact, boolean doExit, Consumer<ProcessBuilder> procCfg, String... args)
      Starts the application. Considers system property "iip.test.java8" as java binary for Java 8 if not running under Java 8.
      Parameters:
      artifact - the artifact file (JAR/ZIP) containing the application
      doExit - whether at the end of the timing if a timeout is given by args the JVM shall be shut down
      procCfg - a configurer for the process being generated, may be null for none
      args - the command line arguments
    • getArtifacts

      private static Collection<de.iip_ecosphere.platform.services.spring.SpringCloudArtifactDescriptor> getArtifacts(File file)
      Returns the artifact descriptor(s) from the deployment descriptor in file.
      Parameters:
      file - the file to read the artifact from
      Returns:
      the artifact descriptor(s), may be empty