org.springframework.boot.ApplicationRunner

Here are the examples of the java api org.springframework.boot.ApplicationRunner taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

18 Source : ApplicationRunnerListener.java
with Apache License 2.0
from micronaut-projects

/**
 * Invokes on startup and executes the listeners.
 * @param startupEvent The startup event
 */
@EventListener
protected void onStartup(StartupEvent startupEvent) {
    for (CommandLineRunner runner : commandLineRunnerList) {
        try {
            runner.run(commandLine.getRawArguments());
        } catch (Exception e) {
            throw new IllegalStateException("Failed to execute ApplicationRunner", e);
        }
    }
    for (ApplicationRunner applicationRunner : applicationRunnerList) {
        try {
            applicationRunner.run(new DefaultApplicationArguments(commandLine.getRawArguments()));
        } catch (Exception e) {
            throw new IllegalStateException("Failed to execute ApplicationRunner", e);
        }
    }
}