Hi Scott,
My understanding is that ejb-refs are required for all bean
references. These references are then bound to actual ejb
components (inside or outside the application) at deployment time.
The optional ejb-link element can be used to "pre-bind" a reference
to a particular ejb within an application.
The disadvantage of treating an EJB component as "just another
client" that can use the JNDI namespace to look up an arbitrary
bean is that this hurts the EJB component's portability. In other
words, the lookup would be dependent on a particular deployment
environment (i.e. the bean it needs is available under name x),
rather than being dependent only on the availability of a particular
service (i.e. a home and remote interface) available under any
arbitrary name.
The EJB 2.0 spec goes so far as to describe how home interface
references in the deployment descriptor should be bound to a
CosNaming service, for interoperability between application servers.
-Dan
On 15 Jan 01, at 6:36, Scott M Stark wrote:
> ejb-refs are not required by my understanding. The ejb-refs are for setting up the
> JNDI namespace that a bean will use to access other beans in the same ejb jar or
> other ejb jars in an enterprise application jar.
>
> You can still access any arbitrary ejb home just as any client can but you have to
>know
> where its home interface is bound in the JNDI namespace. This is something you don't
> know when you create the deployment descriptor.
>
> ----- Original Message -----
> From: "Mattias V. Bertelsen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 10:28 PM
> Subject: [jBoss-User] ejb-ref in deployment descriptor
>
>
> >
> > Are <ejb-ref> entries in the deployment descriptor *required* for an EJB
> > to be able to look up another EJB using JNDI? I want to write a session
> > bean that looks up other session and entity beans, without knowing ahead
> > of time which particular ones it will be using. All of the required
> > interface classes will be available to the classloader, but I won't know
> > which particular ones that this bean would access (I want ALL of them to
> > be available). However, I have a suspicion that those <ejb-ref>
> > entries are important in setting up the JNDI context for the bean. Is
> > this true? Do I really have to put an <ejb-ref> entry for every bean
> > that it could possibly contact?
> >
> > Thanks,
> > Mattias V. Bertelsen
> >
> >
> >
> > --
> > --------------------------------------------------------------
> > To subscribe: [EMAIL PROTECTED]
> > To unsubscribe: [EMAIL PROTECTED]
> > List Help?: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]