Java Reference
In-Depth Information
Adding services to your application
Until now, we coded all the information that will be visible to the user through the applica-
tion screen. What is obviously missing here is all the business logic that translates ulti-
mately into inserting data or updating the existing data. For this reason, we will now add
two classes; first, under com.packtpub.wflydevelopment.chapter5.control
package and second under
com.packtpub.wflydevelopment.chapter5.controller . The first one is
TicketService , which is a stateless EJB that will be used to perform the core business
logic of this application, and the second one is our stateful EJB's counterpart, the
BookerService class. Let's start with the stateless EJB:
public class TicketService {
private Logger log;
private Event<SeatType> seatTypeEventSrc;
private Event<Seat> seatEventSrc;
private SeatDao seatDao;
private SeatTypeDao seatTypeDao;
public void createSeatType(SeatType seatType) throws
Exception {"Registering " + seatType.getDescription());
public void createTheatre(List<SeatType> seatTypes) {
Search WWH ::

Custom Search