Commit caf7110c authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #16104 from ayudovin

* pr/16104:
  Polish "Add default no-op method to SpringApplicationRunListener"
  Add default no-op method to SpringApplicationRunListener
parents 3d0219c3 d6250250
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -38,28 +38,32 @@ public interface SpringApplicationRunListener { ...@@ -38,28 +38,32 @@ public interface SpringApplicationRunListener {
* Called immediately when the run method has first started. Can be used for very * Called immediately when the run method has first started. Can be used for very
* early initialization. * early initialization.
*/ */
void starting(); default void starting() {
}
/** /**
* Called once the environment has been prepared, but before the * Called once the environment has been prepared, but before the
* {@link ApplicationContext} has been created. * {@link ApplicationContext} has been created.
* @param environment the environment * @param environment the environment
*/ */
void environmentPrepared(ConfigurableEnvironment environment); default void environmentPrepared(ConfigurableEnvironment environment) {
}
/** /**
* Called once the {@link ApplicationContext} has been created and prepared, but * Called once the {@link ApplicationContext} has been created and prepared, but
* before sources have been loaded. * before sources have been loaded.
* @param context the application context * @param context the application context
*/ */
void contextPrepared(ConfigurableApplicationContext context); default void contextPrepared(ConfigurableApplicationContext context) {
}
/** /**
* Called once the application context has been loaded but before it has been * Called once the application context has been loaded but before it has been
* refreshed. * refreshed.
* @param context the application context * @param context the application context
*/ */
void contextLoaded(ConfigurableApplicationContext context); default void contextLoaded(ConfigurableApplicationContext context) {
}
/** /**
* The context has been refreshed and the application has started but * The context has been refreshed and the application has started but
...@@ -68,7 +72,8 @@ public interface SpringApplicationRunListener { ...@@ -68,7 +72,8 @@ public interface SpringApplicationRunListener {
* @param context the application context. * @param context the application context.
* @since 2.0.0 * @since 2.0.0
*/ */
void started(ConfigurableApplicationContext context); default void started(ConfigurableApplicationContext context) {
}
/** /**
* Called immediately before the run method finishes, when the application context has * Called immediately before the run method finishes, when the application context has
...@@ -77,7 +82,8 @@ public interface SpringApplicationRunListener { ...@@ -77,7 +82,8 @@ public interface SpringApplicationRunListener {
* @param context the application context. * @param context the application context.
* @since 2.0.0 * @since 2.0.0
*/ */
void running(ConfigurableApplicationContext context); default void running(ConfigurableApplicationContext context) {
}
/** /**
* Called when a failure occurs when running the application. * Called when a failure occurs when running the application.
...@@ -86,6 +92,7 @@ public interface SpringApplicationRunListener { ...@@ -86,6 +92,7 @@ public interface SpringApplicationRunListener {
* @param exception the failure * @param exception the failure
* @since 2.0.0 * @since 2.0.0
*/ */
void failed(ConfigurableApplicationContext context, Throwable exception); default void failed(ConfigurableApplicationContext context, Throwable exception) {
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment