44import org .springframework .boot .Banner ;
55import org .springframework .boot .SpringApplication ;
66import org .springframework .boot .autoconfigure .SpringBootApplication ;
7+ import org .springframework .web .reactive .config .WebFluxConfigurer ;
78import reactor .core .publisher .ConnectableFlux ;
89import reactor .core .publisher .Mono ;
910import reactor .core .scheduler .Schedulers ;
1617 */
1718
1819@ SpringBootApplication
19- public class Application {
20+ public class Application implements WebFluxConfigurer {
2021
2122 // Singleton instance
2223 private static Application instance ;
2324
25+ /**
26+ * ConnectLib instance for managing connections.
27+ */
2428 private static final ConnectLib connectLib = new ConnectLib ();
2529
30+ /**
31+ * Determines the port to use for the server, checking for a dynamic port first.
32+ * @return the port number as a string
33+ */
2634 private String Dyn_Port () {
2735 if (connectLib .StoreAndRetrieve ().get (connectLib .StoreAndRetrieve ().DYNAMIC_PORT ) != null ) {
2836 return connectLib .StoreAndRetrieve ().get (connectLib .StoreAndRetrieve ().DYNAMIC_PORT ).toString ();
@@ -31,6 +39,18 @@ private String Dyn_Port() {
3139 }
3240 }
3341
42+ /**
43+ * Checks if the application is using a static port.
44+ * @return true if using a static port, false if using a dynamic port
45+ */
46+ private boolean isStatic () {
47+ if (connectLib .StoreAndRetrieve ().get (connectLib .StoreAndRetrieve ().DYNAMIC_PORT ) != null ) {
48+ return false ;
49+ } else {
50+ return true ;
51+ }
52+ }
53+
3454 /**
3555 * Starts the Spring Boot application in a non-blocking manner.
3656 * @return a Mono that completes when the application has started
@@ -42,7 +62,7 @@ public Mono<Void> startApplication() {
4262 app .setLogStartupInfo (false ); // désactive l'info de démarrage
4363 Map <String , Object > props = new HashMap <>();
4464 props .put ("server.port" , Dyn_Port ()); // définit le port du serveur
45- props .put ("logging.level.root" , "OFF" ); // coupe l'affichage des logs
65+ props .put ("logging.level.root" , "OFF" );
4666 app .setDefaultProperties (props );
4767 app .run ();
4868
0 commit comments