开发者

Can CDI inject remote instances of my Bean?

Can CDI inject EJB references in my remote EJB client?

Actually I've a JUnit test case that runs locally on my system and access a EJB running on a standalone JBoss AS.开发者_运维技巧 I'm currently using JNDI to access remote business interface of the bean and testing the same.

I would like to know, If @Inject can help me here injecting my EJB instance directly to my test case so that I could avoid JNDI lookups and still access the EJB?


Not portably. From the CDI specification:

The unrestricted set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces. If the session bean has a bean class local view, the unrestricted set of bean types contains the bean class and all superclasses. In addition, java.lang.Object is a bean type of every session bean.

Remote interfaces are not included in the set of bean types.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜