ejb-ref, ejb-link

Discussions

EJB design: ejb-ref, ejb-link

  1. ejb-ref, ejb-link (3 messages)

    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

    Threaded Messages (3)

  2. ejb-ref, ejb-link[ Go to top ]

    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
  3. ejb-ref, ejb-link[ Go to top ]

    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
  4. ejb-ref, ejb-link[ Go to top ]

    Does anyone know how this binding by the deployer is done in IAS ??
    Thanks in advance