Hey
Dan OConnor wrote:
> Obviously you are correct that somewhere, the reference name
> needs to be bound to some EJB in the global namespace. I just
> wanted to clarify that this isn't done by using the optional ejb-link of
> the deployment descriptor. (Not that you said that, but the
> juxtaposition of the above XML and the "no link set" comment
> could be misread.)
>
> The ejb names and ejb references are bound to actual EJBs in the
> global namespace in the same way that a JDBC resource
> reference would be (for instance): with a level of indirection. So the
> ejb name "Customer" could be bound to the global namespace
> under the name "WebCustomer." The method to do this binding is
> container-specific. The ejb reference "ejb/Customer" could be
> bound to this EJB resource by mapping "ejb/Customer" to
> "WebCustomer" in the container-specific deployment tool (which
> could be a fancy Swing GUI, or could be as simple as an XML file
> that is edited by hand). The ejb-link mechanism, if present, can be
> used to ensure that whatever global namespace name is used for a
> particular ejb (e.g. "WebCustomer" used for Customer) is ALSO
> used for a particular ejb reference (e.g. "WebCustomer" also used
> for ejb/Customer).
>
> For convenience, we could provide an option to remove this level of
> indirection if the ejb-link field is present, and assume that the bean
> will be bound to the global namespace using its EJB name.
Sorry, but you are wrong. :-)
(see 14.3.2)
Here is the Truth (I knew it was out there..):
The "ejb-ref" in a EJB-reference is the local name that the bean itself
uses to lookup another bean.
*If* the referenced bean exists within the same application (likely, but
not necessary), then the ejb-link refers to the "ejb-name" of that bean.
So far we have no proprietary settings involved. The Bean Developer can
say "I need a reference to this type of bean", and the Assembler can
link this to another bean in the same app.
The only time a Deployer would get involved with fixing references is if
the reference should point to a bean in another application, or another
server. Then this reference must be pointed to a global JNDI-name, which
only the Deployer can do (the Assembler doesn't have this kind of
information at hand).
So:
ejb-ref is for the bean, and is set by Bean Developer
ejb-link refers to bean in same app., and is set by Assembler
jndi-name (in jboss.xml) may be set to a JNDI-name in the global
namespace, and is set by Deployer.
Clear?
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]