aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes why do we need ejbactivate  and ejbpassivate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "why do we need ejbactivate  and ejbpassivate" Watch "why do we need ejbactivate  and ejbpassivate" New topic
Author

why do we need ejbactivate and ejbpassivate

firoz silar
Greenhorn

Joined: Dec 24, 2005
Posts: 11
hi,
can any body tell me briefy.
why do we need ejbActivate and ejbPassivate methods in
Stateless session bean.
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
To have a consistent interface, so that there is no different interface that you need to implement for Stateful Session Bean and Stateless Session Bean.
Both Stateless and Stateful Session Bean implement javax.ejb.SessionBean and this would not be possible if stateless session bean is to remove ejbActivate and ejbPassivate from the interface.
You could argue that the two (stateful and stateless) are so different that they should have their own interface but Sun did not think so. They made both session beans implement the same interface and provided deployment descriptor to denote which one is it that you are deploying.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why do we need ejbactivate and ejbpassivate