First page Back Continue Last page Graphics
EnterpriseBean
EJB defines an EnterpriseBean type
- “Marker” interface in javax.ejb
- Represents all servant classes
EnterpriseBean has
two subinterfaces:
The subinterfaces define life-cycle methods for:
- Passivating /
activating the bean
- Loading / storing state data
See notes for complete listings; details follow...
Notes:
The interface javax.ejb.EnterpriseBean defines all EJB servant classes (the “beans” themselves). EnterpriseBean is a “marker” interface, meaning it has no methods; it simply marks a class for some purpose.
The two subinterfaces we will examine -- SessionBean and EntityBean -- define servants for session and entity beans. (There is actually a third subinterface, MessageDrivenBean, that is beyond the scope of this course.)
The various subinterfaces define methods that the container calls in the course of the bean’s use.
The complete listings for SessionBean and EntityBean are shown on the next page.