Java Reference
In-Depth Information
Coding our EJB application
Creating EJB classes does not require getting mixed up with fancy wizards; all you need to
do is add bare Java classes. Therefore, from the File menu, go to New | Java Class , and
enter TheatreBox as the classname and
com.packtpub.wflydevelopment.chapter3.control as the package name.
We will add the following implementation to the class:
@AccessTimeout(value = 5, unit = TimeUnit.MINUTES)
public class TheatreBox {
private static final Logger logger =
private Map<Integer, Seat> seats;
public void setupTheatre() {
seats = new HashMap<>();
int id = 0;
for (int i = 0; i < 5; i++) {
addSeat(new Seat(++id, "Stalls", 40));
addSeat(new Seat(++id, "Circle", 20));
addSeat(new Seat(++id, "Balcony", 10));
}"Seat Map constructed.");
private void addSeat(Seat seat) {
seats.put(seat.getId(), seat);
public Collection<Seat> getSeats() {
Search WWH ::

Custom Search