Skip to content

Commit adc8075

Browse files
committed
Expand on Javadoc for Jooby.stop() fix jooby-project#1051
1 parent 2fc5e11 commit adc8075

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

jooby/src/main/java/org/jooby/Jooby.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,14 +2147,16 @@ public static List<Definition> exportRoutes(final Jooby app) {
21472147
}
21482148

21492149
/**
2150-
* Start an application.
2150+
* Start an application. Fire the {@link #onStart(Throwing.Runnable)} event and the
2151+
* {@link #onStarted(Throwing.Runnable)} events.
21512152
*/
21522153
public void start() {
21532154
start(new String[0]);
21542155
}
21552156

21562157
/**
2157-
* Start an application.
2158+
* Start an application. Fire the {@link #onStart(Throwing.Runnable)} event and the
2159+
* {@link #onStarted(Throwing.Runnable)} events.
21582160
*
21592161
* @param args Application arguments.
21602162
*/
@@ -3125,7 +3127,23 @@ public boolean isStarted() {
31253127
}
31263128

31273129
/**
3128-
* Stop the application, close all the modules and stop the web server.
3130+
* Stop the application, fire the {@link #onStop(Throwing.Runnable)} event and shutdown the
3131+
* web server.
3132+
*
3133+
* Stop listeners run in the order they were added:
3134+
*
3135+
* <pre>{@code
3136+
* {
3137+
*
3138+
* onStop(() -> System.out.println("first"));
3139+
*
3140+
* onStop(() -> System.out.println("second"));
3141+
*
3142+
* ...
3143+
* }
3144+
* }</pre>
3145+
*
3146+
*
31293147
*/
31303148
public void stop() {
31313149
if (started.compareAndSet(true, false)) {

0 commit comments

Comments
 (0)