File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
frameworks/Java/spring/src/main/java/hello Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 7
7
import org .springframework .boot .autoconfigure .data .mongo .MongoRepositoriesAutoConfiguration ;
8
8
import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
9
9
import org .springframework .boot .autoconfigure .jdbc .DataSourceProperties ;
10
+ import org .springframework .boot .context .event .ApplicationReadyEvent ;
10
11
import org .springframework .context .annotation .Bean ;
11
12
import org .springframework .context .annotation .Profile ;
13
+ import org .springframework .context .event .EventListener ;
12
14
13
15
import com .zaxxer .hikari .HikariDataSource ;
14
16
@@ -19,6 +21,11 @@ public static void main(String[] args) {
19
21
SpringApplication .run (App .class , args );
20
22
}
21
23
24
+ @ EventListener (ApplicationReadyEvent .class )
25
+ public void runAfterStartup () {
26
+ System .out .println ("Application is ready" );
27
+ }
28
+
22
29
@ Bean
23
30
@ Profile ({ "jdbc" , "jpa" })
24
31
public DataSource datasource (DataSourceProperties dataSourceProperties ) {
You can’t perform that action at this time.
0 commit comments