• Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb-ref in the deployment descriptor

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the use of ejb-ref in the deployment descriptor.
Could i have a an example of it.

Thanks,
aakash
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's necessary when one of your ejbs makes use of another ejb (by it's remote interface).

I get a ejb-local-ref example. The only diference from the ejb-ref is that the latter would be using remote interfaces instead of local interfaces.

<ejb-local-ref >
<ejb-ref-name>ejb/PartyHouseLocal</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>ltcmelo.localhomeinterface.PartyHouseLocalHome</local-home>
<local>ltcmelo.localinterface.PartyHouseLocal</local>
<ejb-link>PartyHouse</ejb-link>
</ejb-local-ref>
 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Leandro Melo

Is that if we specifies a ejb ref in the descriptor, then we do not had to write a lookup code for the referred bean.
Say A refers B in the descriptor. So in Bean A is the lookup code to locate through JNDI for Bean B is not required and we directly use the remote object.

OR

We still need to lookup from bean A to Bean B, then just for a reference are we mentioning in the descriptor.
In that case its not very much clear what is the advantage of referring.

Thanks,
aakash
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!