|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
example.cmp.transaction.RegistrationSessionBean
Implementation Class for the RegistrationSession bean.
Field Summary | |
private CourseHome |
courseHome
Home Interface for the Course CMP bean. |
private boolean |
isComplete
True when the registration has completed and mail has been sent. |
private boolean |
isCompleting
True for the finalizing method. |
private java.util.Collection |
selectedCourses
Currently selected Courses. |
private Student |
student
The calling Principal. |
private StudentHome |
studentHome
Home Interface for the Student CMP bean. |
static int |
TRANSACTION_COMMITTED
|
static int |
TRANSACTION_ROLLEDBACK
|
Constructor Summary | |
RegistrationSessionBean()
Standard Constructor. |
Method Summary | |
void |
addCourse(Course course)
Adds a course to the set of selected courses for this session. |
void |
afterBegin()
Called by Resin-CMP after a new transaction has begun -- required by the SessionSynchronization interface. |
void |
afterCompletion(boolean committed)
Called by Resin-CMP when a transaction has completed -- required by the SessionSynchronization interface. |
void |
beforeCompletion()
Called by Resin-CMP just before a transaction is committed -- required by the SessionSynchronization interface. |
void |
ejbCreate()
Tries to resolve the calling . |
void |
finalizeRegistration()
Executes a transaction that will commit the selected courses to the persistant store unless an error occurs. |
java.util.Collection |
getAvailableCourses()
Returns a Collection of all Courses offered
(including those that the student has already selected). |
java.util.Collection |
getEnrolledCourses()
Returns a Collection of Courses that the now registering
Student is currently enrolled in. |
java.util.Collection |
getSelectedCourses()
Returns a Collection of all courses currently selected. |
java.lang.String |
getStudentName()
Returns the name of the Student who is selecting Courses. |
boolean |
isComplete()
Returns true if the registration is complete. |
void |
removeCourse(Course course)
Deletes a course from the set of selected courses for this session. |
Field Detail |
private CourseHome courseHome
private StudentHome studentHome
private Student student
private boolean isCompleting
private boolean isComplete
private java.util.Collection selectedCourses
finalizeRegistration
is called.public static final int TRANSACTION_COMMITTED
public static final int TRANSACTION_ROLLEDBACK
Constructor Detail |
public RegistrationSessionBean()
Method Detail |
public void ejbCreate() throws javax.ejb.CreateException
.
public void afterBegin() throws javax.ejb.EJBException
afterBegin
in interface javax.ejb.SessionSynchronization
public void beforeCompletion() throws javax.ejb.EJBException
This call might update the database or do some validation. Because the transaction might still be rolled back, it should be possible to roll back any operatin in the before completion.
beforeCompletion
in interface javax.ejb.SessionSynchronization
public void afterCompletion(boolean committed) throws javax.ejb.EJBException
In order to keep the transaction Atomic, Consistent, Independent, and Durable, we do nothing in this method unless the transaction has been committed.
If the transaction was rolled back, we will treat it as if it never happened.
afterCompletion
in interface javax.ejb.SessionSynchronization
public java.lang.String getStudentName()
public java.util.Collection getEnrolledCourses()
Collection
of Courses that the now registering
Student is currently enrolled in.public void addCourse(Course course) throws javax.ejb.FinderException
public void removeCourse(Course course) throws javax.ejb.FinderException
public java.util.Collection getAvailableCourses()
Collection
of all Courses offered
(including those that the student has already selected).public java.util.Collection getSelectedCourses()
Collection
of all courses currently selected.public boolean isComplete()
public void finalizeRegistration() throws RegistrationDeniedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |