After reading these,
- Where to use EJB 3.1 and CDI?
- How do CDI and EJB compare? interact? and some other articles.
I'm still confused over the following things, please correct me if i am wrong.
- All classes within the same package as the bean.xml is a CDI bean except for classes annotate as session/message/singleton.
- Only EJB can be injected using @EJB(within another EJB), while both CDI bean and EJB bean can be injected using @inject(within EJB bean or CDI bean).
- class annotate as @Stateless(for example) that is injected using @Inject is still a EJB bean, not a CDI bean, and will still be managed by EJB container with all the goodness of pooling and transactional.
Thanks alot. :)