-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBankApp.java
More file actions
36 lines (32 loc) · 1.28 KB
/
BankApp.java
File metadata and controls
36 lines (32 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import controller.BankController;
import repository.AccountRepository;
import repository.InMemoryAccountRepository;
import service.BankService;
import service.BankServiceImpl;
import util.ConsoleUtils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class BankApp {
public static void main(String[] args) {
ConsoleUtils.printWelcomeBanner("Bank Application");
AccountRepository accountRepository = new InMemoryAccountRepository();
BankService bankService = new BankServiceImpl(accountRepository);
ExecutorService executor = Executors.newFixedThreadPool(5);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
BankController controller = new BankController(bankService, executor, reader);
controller.start();
} catch (IOException e) {
ConsoleUtils.printError("Error reading input: " + e.getMessage());
} finally {
try {
reader.close();
} catch (IOException e) {
ConsoleUtils.printError("Error closing reader: " + e.getMessage());
}
}
}
}