Package ejava.examples.txhotel.blimpl
Class HotelReservationSessionImpl
- java.lang.Object
-
- ejava.examples.txhotel.blimpl.HotelReservationSessionImpl
-
- All Implemented Interfaces:
HotelReservationSession
public class HotelReservationSessionImpl extends Object implements HotelReservationSession
This class represents some stateful business logic that caches desired reservations until the caller calls commit. At that time they will all be added to the hotel using the stateless reservationist.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
log
private List<Reservation>
pending
private HotelReservationist
reservationist
-
Constructor Summary
Constructors Constructor Description HotelReservationSessionImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelReservations()
void
close()
List<Reservation>
commit()
void
createReservation(Person person, Date startDate, Date endDate)
void
setReservationist(HotelReservationist reservationist)
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
pending
private List<Reservation> pending
-
reservationist
private HotelReservationist reservationist
-
-
Method Detail
-
createReservation
public void createReservation(Person person, Date startDate, Date endDate) throws HotelReservationException
- Specified by:
createReservation
in interfaceHotelReservationSession
- Throws:
HotelReservationException
-
cancelReservations
public void cancelReservations() throws HotelReservationException
- Specified by:
cancelReservations
in interfaceHotelReservationSession
- Throws:
HotelReservationException
-
commit
public List<Reservation> commit() throws HotelReservationException
- Specified by:
commit
in interfaceHotelReservationSession
- Throws:
HotelReservationException
-
setReservationist
public void setReservationist(HotelReservationist reservationist)
-
close
public void close()
- Specified by:
close
in interfaceHotelReservationSession
-
-