In EJB3, How to implement inheritance for Session Bean?
We want to achieve following things:
- Create Abstract Stateless session bean
- Create stateless bean by extending the above bean.
- In Service class, base开发者_高级运维d on type container will inject appropriate ejb bean
Here is what I suggest:
- Create an Abstract Stateless session bean.
- Create Stateless Session Beans by extending the above bean.
- In Service class, inject appropriate EJB bean based on type.
If you face a specific problem, ask a more specific question.
I guess that you've not read the EJB 3 specification yet. In the spec document in section 4.9.2 you'll find that the ejb can't be final or abstract. So the way that you are trying to implement the inheritance isn't possible. I hope this is helpful. Regards
精彩评论