Class SpringStartup
java.lang.Object
de.iip_ecosphere.platform.examples.SpringStartup
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddAasNotificationMode(String[] args, List<String> cmdArgs) Retrieves the AAS notification mode from cmd line argumentStarter.ARG_AAS_NOTIFICATIONand adds it tocmdArgs.private static voidIf given inargs, addsStarter.PARAM_IIP_APP_IDtocmdArgs.private static Collection<de.iip_ecosphere.platform.services.spring.SpringCloudArtifactDescriptor> getArtifacts(File file) Returns the artifact descriptor(s) from the deployment descriptor infile.static voidMain program to start the application.static voidstart(File artifact, boolean doExit, Consumer<ProcessBuilder> procCfg, String... args) Starts the application.static voidStarts the application.static final voidStarts the application.
-
Field Details
-
PROPERTY_ARGS
- See Also:
-
ARG_BROKER_PORT
- See Also:
-
DFLT_BROKER_PORT
public static final int DFLT_BROKER_PORT- See Also:
-
ARG_STOP
- See Also:
-
-
Constructor Details
-
SpringStartup
public SpringStartup()
-
-
Method Details
-
main
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
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
Starts the application. Used from examples. Do not change signature.- Parameters:
artifact- the artifact file (JAR/ZIP) containing the applicationargs- the command line arguments
-
addAasNotificationMode
Retrieves the AAS notification mode from cmd line argumentStarter.ARG_AAS_NOTIFICATIONand adds it tocmdArgs.- Parameters:
args- the command line argumentscmdArgs- the command line arguments to be modified as a side effect- See Also:
-
addAppId
If given inargs, addsStarter.PARAM_IIP_APP_IDtocmdArgs.- Parameters:
args- the command line argumentscmdArgs- 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 applicationdoExit- whether at the end of the timing if a timeout is given byargsthe JVM shall be shut downprocCfg- a configurer for the process being generated, may be null for noneargs- 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 infile.- Parameters:
file- the file to read the artifact from- Returns:
- the artifact descriptor(s), may be empty
-