List of usage examples for org.springframework.boot.context.event ApplicationStartingEvent getArgs
public final String[] getArgs()
From source file:org.springframework.boot.devtools.restart.RestartApplicationListener.java
private void onApplicationStartingEvent(ApplicationStartingEvent event) { // It's too early to use the Spring environment but we should still allow // users to disable restart using a System property. String enabled = System.getProperty(ENABLED_PROPERTY); if (enabled == null || Boolean.parseBoolean(enabled)) { String[] args = event.getArgs(); DefaultRestartInitializer initializer = new DefaultRestartInitializer(); boolean restartOnInitialize = !AgentReloader.isActive(); if (!restartOnInitialize) { logger.info("Restart disabled due to an agent-based reloader being active"); }/*from ww w. ja v a 2 s.com*/ Restarter.initialize(args, false, initializer, restartOnInitialize); } else { logger.info("Restart disabled due to System property '" + ENABLED_PROPERTY + "' being set to false"); Restarter.disable(); } }