获取对 JCA 适配器内的 EJB3 本地业务接口的引用
我想知道是否可以在jca适配器内获取对ejb3本地业务接口的引用?
资源适配器和 ejb .jar
打包到同一个 .ear
中。应用程序在带有 ejb3 功能包的 WebSphere AS 6.1 下运行。
我尝试使用 ejblocal:
作为 JNDI 名称,但没有成功。
I'd like to know whether it is possible to get a reference to the ejb3 local business interfaces inside the jca adapter?
Resource adapter and ejb .jar
are packed into the same .ear
. Application is running under WebSphere AS 6.1 with ejb3 featurepack.
I have tried to use ejblocal:<full_class_name_of_local_interface>
as JNDI name, but without success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试做的事情可能概念上是错误的。 JCA 适配器不应依赖于 EJB —— JCA 适配器不应查找 EJB。
但 JCA 适配器适用于入站和出站连接。 JCA 连接器与 EJB(入站连接)通信的正确方法是通过消息驱动 bean (MDB)。
我同意,在这种情况下,“消息驱动 bean”这个名称有点误导。自定义 MDB 实际上就像 EJB,接收来自 JCA 连接器的调用。它不一定与消息或异步处理相关。如果您想要自定义 MDB,则可以查找或让其他 EJB 注入来委托处理。
最好查看的文档是“使用 J2EE 连接器体系结构 1.5 创建资源适配器”。 它提供了入站和出站连接的示例。相应的代码可以在SDK附带的J2EE示例中找到。
What you are trying to do is probably conceptually wrong. JCA adapter should not depend on EJB -- a JCA adapter should not lookup an EJB.
But JCA adapters work for inbound and outbound connectivity though. The right way to have a JCA connector communicate with an EJB (inbound connectivity), it through message driven bean (MDB).
I agree that in this case the name "message-driven bean" is a bit misleading. The custom MDB is really like an EJB and receive calls from the JCA connector. It's not necessary related to message nor asynchronous processing. If you want the custom MDB can then lookup or have other EJB inject to delegate the processing.
The best doc to look at is "Creating Resource Adapter with J2EE Connector Architecture 1.5". It gives an example for inbound and outbound connectivity. The corresponding code can be found in the J2EE samples which come with the SDK.