public class HotelRegistrationEJB extends Object implements HotelRegistrationRemote, HotelRegistrationLocal
Modifier and Type | Field and Description |
---|---|
private SessionContext |
ctx |
private EntityManager |
em |
private org.apache.commons.logging.Log |
log |
private ejava.examples.txhotel.bl.HotelReservationist |
reservationist |
Constructor and Description |
---|
HotelRegistrationEJB() |
Modifier and Type | Method and Description |
---|---|
void |
cancelReservation(ejava.examples.txhotel.bo.Reservation reservation)
This method will cause the current transaction to be rolled back
if the business logic reports an exception cancelling a reservation.
|
void |
cleanupReservation(String confirmation) |
void |
close()
This method is called whenever the EJB is evicted from the container;
which is not too often for stateless session beans under normal
circumstances.
|
ejava.examples.txhotel.bo.Reservation |
commitReservation(ejava.examples.txhotel.bo.Reservation reservation)
This method is just a pass-thru to the business logic.
|
ejava.examples.txhotel.bo.Reservation |
createReservation(ejava.examples.txhotel.bo.Person person,
Date startDate,
Date endDate)
This method will rollack the current transaction if the business
logic throws an exception while trying to create a reservation.
|
ejava.examples.txhotel.bo.Reservation |
getReservationByConfirmation(String confirmation) |
List<ejava.examples.txhotel.bo.Reservation> |
getReservations(int index,
int count) |
List<ejava.examples.txhotel.bo.Reservation> |
getReservationsForPerson(ejava.examples.txhotel.bo.Person person,
int index,
int count) |
void |
init()
This method is called when the bean is created and is responsble for
instantiating the business logic implementation, a DAO, and assigning
the EntityManager for the DAO(s) to use.
|
private org.apache.commons.logging.Log log
private EntityManager em
private SessionContext ctx
private ejava.examples.txhotel.bl.HotelReservationist reservationist
@PostConstruct public void init()
@PreDestroy public void close()
public void cancelReservation(ejava.examples.txhotel.bo.Reservation reservation) throws ejava.examples.txhotel.bl.HotelReservationException
cancelReservation
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public ejava.examples.txhotel.bo.Reservation commitReservation(ejava.examples.txhotel.bo.Reservation reservation) throws ejava.examples.txhotel.bl.HotelReservationException
commitReservation
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public ejava.examples.txhotel.bo.Reservation createReservation(ejava.examples.txhotel.bo.Person person, Date startDate, Date endDate) throws ejava.examples.txhotel.bl.HotelReservationException
createReservation
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public List<ejava.examples.txhotel.bo.Reservation> getReservations(int index, int count) throws ejava.examples.txhotel.bl.HotelReservationException
getReservations
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public List<ejava.examples.txhotel.bo.Reservation> getReservationsForPerson(ejava.examples.txhotel.bo.Person person, int index, int count) throws ejava.examples.txhotel.bl.HotelReservationException
getReservationsForPerson
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public ejava.examples.txhotel.bo.Reservation getReservationByConfirmation(String confirmation) throws ejava.examples.txhotel.bl.HotelReservationException
getReservationByConfirmation
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
public void cleanupReservation(String confirmation) throws ejava.examples.txhotel.bl.HotelReservationException
cleanupReservation
in interface ejava.examples.txhotel.bl.HotelReservationist
ejava.examples.txhotel.bl.HotelReservationException
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.