• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb-ref-name and ejb-link ?

 
Raghunath Nandyala
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
ejb-ref-name points to JNDI reference of any ejb in container
ejb-link points to ejb-name of any bean in same jar or different jar

ejb-link is optional.. and if I give ejb-ref-name to EJBOne and ejb-link to EJBTwo what will happen..

<ejb-ref>
<ejb-ref-name>ejb/EJBOne</>
<ejb-ref-type>Session</>
<home>one.Home</>
<remote>one.Remote</>
<ejb-link>OtherJar.jar#EJBTwo
</ejb-ref>

Please give me some suggestion

thanks
Raghunath
 
Rajan Murugan
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That merely means EJBOne refers EJBTwo in its code.I believe that this is one way for the container to find out references in a faster way else it need to search and find out the reference of the the other bean.Spec says it is merely refering another ejb-name (which is like a label).Further in the event bean provider is not giving away the source code it becomes easy for the people who will use the beans to understand and integrate various beans together in one big application and will know the dependent beans.
 
Mike Pandey
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had one query with regard to the above question:
<ejb-ref>
<ejb-ref-name>ejb/EJBOne</>
<ejb-ref-type>Session</>
<home>one.Home</>
<remote>one.Remote</>
<ejb-link>OtherJar.jar#EJBTwo
</ejb-ref>


will the above ref point to EJBTwo?...if it is, are the home & remote ref mentioned useless in the above case if ejb-link is specified ???
or we will have to mention them correctly as per wat they are for EJBTwo?

Thanks in advance
 
Rajan Murugan
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the ref is not pointing to ejbTwo.it is pointing to ejbOne only.but in the bean code it is making use of rather calling ejbTwo.Please go thru the Bean env chapter in HFEJB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic