Java Reference
In-Depth Information
private void handleBook() {
int seatId;
try {
seatId = IOUtils.readInt("Enter SeatId: ");
} catch (NumberFormatException e1) {
logger.warning("Wrong SeatId format!");
return;
}
try {
final String retVal =
theatreBooker.bookSeat(seatId);
System.out.println(retVal);
} catch (SeatBookedException |
NotEnoughMoneyException | NoSuchSeatException e) {
logger.warning(e.getMessage());
return;
}
}
private void handleList() {
logger.info(theatreInfo.printSeatList());
}
private void handleMoney() {
final int accountBalance =
theatreBooker.getAccountBalance();
logger.info("You have: " + accountBalance + " money
left.");
}
private void handleQuit() {
logger.info("Bye");
System.exit(0);
}
private TheatreInfoRemote lookupTheatreInfoEJB() throws
NamingException {
return (TheatreInfoRemote) context.lookup("ejb:/
Search WWH ::




Custom Search