File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes ejb-link element.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "ejb-link element...." Watch "ejb-link element...." New topic
Author

ejb-link element....

Vijay Govind
Greenhorn

Joined: Oct 18, 2006
Posts: 27
Folks

GM. What'z the deal with ejb-link element? I know it is optional, but still something like that does not make sense. What this element can tell to anyone(container, developer, assembler, deployer)that is not told by the home, remote elements.

Thanks in advance.
Vijay

;
Mini Sarin
Ranch Hand

Joined: Apr 07, 2006
Posts: 31
The ejb-ref element does not contain the name of the actual bean class. The ejb-ref-name tag refers to any fictitious name used by the bean provider. It doesn't contain the ejb-class tag.

The application assembler puts in an ejb-link tag to specify the name of the actual bean class which could be in the same ejb-jar or a different ejb-jar but in the same J2EE application.

The deployer will then look at the ejb-link element and bind the bean reference specified in ejb-link to the bean home.
Rajan Murugan
Ranch Hand

Joined: Jun 24, 2006
Posts: 182
Originally posted by Mini Sarin:
The ejb-ref element does not contain the name of the actual bean class. The ejb-ref-name tag refers to any fictitious name used by the bean provider. It doesn't contain the ejb-class tag.

The application assembler puts in an ejb-link tag to specify the name of the actual bean class which could be in the same ejb-jar or a different ejb-jar but in the same J2EE application.

The deployer will then look at the ejb-link element and bind the bean reference specified in ejb-link to the bean home.


what do you exactly mean by

The deployer will then look at the ejb-link element and bind the bean reference specified in ejb-link to the bean home.


and how does this binding happen ?


With Regards,<br /> Rajan<br />"Java Rocks"
Vijay Govind
Greenhorn

Joined: Oct 18, 2006
Posts: 27
Sarin:
First of all thanks and I get it. I was carried away by the "word" optional. Now I understand that it is optional for the Bean Developer, but propably a must for Deployer(like role-link element)

Rajan:
To answer your question, I believe the binding will happen as it happens to any other resource. The deployer might use a Container specific tool to handle this.

Folks:
Please correct me if I am wrong.
Rajan Murugan
Ranch Hand

Joined: Jun 24, 2006
Posts: 182
Originally posted by Mini Sarin:
The ejb-ref element does not contain the name of the actual bean class. The ejb-ref-name tag refers to any fictitious name used by the bean provider. It doesn't contain the ejb-class tag.

The application assembler puts in an ejb-link tag to specify the name of the actual bean class which could be in the same ejb-jar or a different ejb-jar but in the same J2EE application.

The deployer will then look at the ejb-link element and bind the bean reference specified in ejb-link to the bean home.


The ejb-ref-name tag refers to any fictitious name used by the bean provider. It doesn't contain the ejb-class tag.


what will happen if ejb-class is absent.will it matter?

The application assembler puts in an ejb-link tag to specify the name of the actual bean class which could be in the same ejb-jar or a different ejb-jar but in the same J2EE application.


Isn't it the name of the bean (not the name of the bean class).

Lastly what will happen when ejb-link is not there.Isn't ejb-link optional.
Mini Sarin
Ranch Hand

Joined: Apr 07, 2006
Posts: 31
Yes the ejb-link tag contains the name of a bean whose class name will be in another element like this:

<entity>
<ejb-name>EmployeeRecord</ejb-name>
<home>com.wombat.empl.EmployeeRecordHome</home>
<remote>com.wombat.empl.EmployeeRecord</remote>
<ejb-class>com.wombat.empl.EmployeeRecordBean</ejb-class>
...
</entity>

The ejb-ref element doesn't contain the ejb-class tag, only ejb-ref-name, that will be linked to actual ejb-class name through ejb-link tag.



Lastly what will happen when ejb-link is not there.Isn't ejb-link optional.


V good qs, i am not sure abt this, somebody please answer this. Probably the container will ignore the ejb-ref-name if ejb-link is not there and not bind it to any bean.
Rajan Murugan
Ranch Hand

Joined: Jun 24, 2006
Posts: 182
It is not because of bean class it is more of a convenience.thats what I think.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb-link element....