开发者

Get reference to the EJB3 local business interface inside the JCA adapter

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.


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).

  1. The JCA adapter defines an interface that will be used for communication.
  2. Then a custom MDB can implement this interface and can receive inbound requests from the adapter.

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜