Java Reference
In-Depth Information
will define this bean in a moment; right now, we will add the last producer class used
in this example, the SeatProducer bean:
@javax.enterprise.context.RequestScoped
public class SeatProducer implements
Serializable {
@Inject
private DataManager seatRepository;
private List<Seat> seats;
@Produces
@Named
public List<Seat> getSeats() {
System.out.println("Seattypes "+seats);
return seats;
}
public void
onMemberListChanged(@Observes(notifyObserver =
Reception.IF_EXISTS) final Seat member) {
retrieveAllSeats();
}
@PostConstruct
public void retrieveAllSeats() {
seats = seatRepository.findAllSeats();
}
}
This bean will be used to produce the list of Seat objects that will actually be avail-
able for booking.
Search WWH ::




Custom Search