I'm a little confused as to the purpose of the ejb-ref and ejb-link fields in the xml deployment descriptor of an ejb. Whenever I need a reference to another ejb from an ejb, I use jndi. What is the purpose of putting in the information in the deployment descriptor?
Thanks
-
ejb-ref, ejb-link (3 messages)
- Posted by: eric mindrebo
- Posted on: August 01 2000 12:04 EDT
Threaded Messages (3)
- ejb-ref, ejb-link by Bhavesh Bhammar on August 01 2000 15:40 EDT
- ejb-ref, ejb-link by chris bono on August 02 2000 11:44 EDT
- ejb-ref, ejb-link by paul martin on December 21 2000 14:06 EST
-
ejb-ref, ejb-link[ Go to top ]
- Posted by: Bhavesh Bhammar
- Posted on: August 01 2000 15:40 EDT
- in response to eric mindrebo
When your bean cannot know the JNDI name of the target beans at compile time, so they are listed in the DD as references. At runtime , your bean will look up its references by name , and should obtain as return values references to beans that represent your target beans.
For this to work , you must have an ejb-link entry within each ejb-ref.
Bhavesh Bhammar -
ejb-ref, ejb-link[ Go to top ]
- Posted by: chris bono
- Posted on: August 02 2000 11:44 EDT
- in response to eric mindrebo
Eric,
This mechanism allows the roles of EJB (deployer, app assembler) to be played out. This way your code is not dependent on a hardcoded string that may change at deployment time. The "deployer" should set the ejb-link as to the actual jndi-name.
Ed Roman once said, "another layer of indirection will solve any problem.."
Chris -
ejb-ref, ejb-link[ Go to top ]
- Posted by: paul martin
- Posted on: December 21 2000 14:06 EST
- in response to chris bono
Does anyone know how this binding by the deployer is done in IAS ??
Thanks in advance