- Replace DemoFactory with DemoApplication to centralize system setup, execution, and shutdown - Move ExecutorService and ScheduledExecutorService lifecycle management into application layer - Ensure proper shutdown sequence for worker and monitoring threads - Simplify Main class to a minimal entry-point wrapper - Improve clarity of execution flow: build → run → shutdown - Prevent resource leakage by explicitly awaiting termination of thread pools
35 lines
877 B
Java
35 lines
877 B
Java
package dev.banking;
|
|
|
|
/**
|
|
* Entry point of the application.
|
|
*
|
|
* IMPORTANT:
|
|
* - Do NOT modify this file in student assignment.
|
|
* - This is only a wrapper for running the demo.
|
|
*/
|
|
public final class Main {
|
|
|
|
private Main() {
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
|
|
System.out.println("=================================");
|
|
System.out.println(" Advanced Banking System");
|
|
System.out.println("=================================\n");
|
|
|
|
try {
|
|
|
|
DemoApplication.run();
|
|
|
|
System.out.println("\n=================================");
|
|
System.out.println(" System finished successfully ");
|
|
System.out.println("=================================");
|
|
|
|
} catch (Exception e) {
|
|
|
|
System.err.println("Unexpected error occurred:");
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
} |