public class HotelReservationSessionEJB extends Object implements HotelReservationSessionLocal, HotelReservationSessionRemote, SessionSynchronization
Modifier and Type | Field and Description |
---|---|
private SessionContext |
ctx |
private HotelReservationSession |
impl |
private static org.apache.commons.logging.Log |
log |
private HotelRegistrationLocal |
reservationist |
Constructor and Description |
---|
HotelReservationSessionEJB() |
Modifier and Type | Method and Description |
---|---|
void |
afterBegin()
This is called to tell us the transaction has started because we
implement SessionSynchronization interface.
|
void |
afterCompletion(boolean status)
This is called to tell us how the transaction did.
|
void |
beforeCompletion()
This is called to give us a chance to complain before the
transaction really commits.
|
void |
cancelReservations() |
void |
close()
This method will destroy the stateful instance.
|
void |
closing()
This method is called just prior to the bean being destroyed.
|
List<Reservation> |
commit() |
void |
createReservation(Person person,
Date startDate,
Date endDate) |
void |
init()
This method is called when the bean is instantiated to perform manual
initialization.
|
private static final org.apache.commons.logging.Log log
private HotelReservationSession impl
private SessionContext ctx
private HotelRegistrationLocal reservationist
@PostConstruct public void init()
@PreDestroy public void closing()
public void close()
close
in interface HotelReservationSession
public void createReservation(Person person, Date startDate, Date endDate) throws HotelReservationException
createReservation
in interface HotelReservationSession
HotelReservationException
public void cancelReservations() throws HotelReservationException
cancelReservations
in interface HotelReservationSession
HotelReservationException
public List<Reservation> commit() throws HotelReservationException
commit
in interface HotelReservationSession
HotelReservationException
public void afterBegin()
afterBegin
in interface SessionSynchronization
public void beforeCompletion() throws EJBException, RemoteException
beforeCompletion
in interface SessionSynchronization
EJBException
RemoteException
public void afterCompletion(boolean status)
afterCompletion
in interface SessionSynchronization
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.