• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ejb-ref tag in the DD contains any redundancy?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <ejb-ref> tag in the DD contains <ejb-link> tag, which describes a bean fully including its home and component interfaces. Then why the <ejb-ref> tag should contain <home> and <remote> tags? In my view it is unnecessary, but am I correct? Please advice me! Thanks in advance!!
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The nested elements in the ejb-ref element specify interfaces to use for local/remote home/component interfaces. There is no redundancy.
 
Nesan Krish
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am still confusing!
The details of the home and component interfaces of the bean are included in the <ejb-link> element:
Because what is given in the <ejb-link> element is what has already been given in the <ejb-name> element someware in the DD where home and component interface details have also been given in <home>, <remote> or <local-home>, <local> elements.
Then why these details are repeating again in <ejb-ref> element?
Any further explanations greatly appreciated! Thank you very much.

[ May 02, 2004: Message edited by: Nesan Krish ]
[ May 02, 2004: Message edited by: Nesan Krish ]
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the <ejb-ref> element the bean provider gives new client views for the bean stated in <ejb-link> element.
 
Nesan Krish
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then, is it posible for a bean class to have multiple client views?
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
---------------------------------------------------------------------------
The details of the home and component interfaces of the bean are included in the <ejb-link> element:
Because what is given in the <ejb-link> element is what has already been given in the <ejb-name> element someware in the DD where home and component interface details have also been given in <home>, <remote> or <local-home>, <local> elements.
Then why these details are repeating again in <ejb-ref> element?
----------------------------------------------------------------------------
In order for an enterprise bean to access another bean, the bean provider declares an EJB reference in the deployment descriptor for the home interface of the enterprise bean to be accessed. The EJB reference is given a logical name that is relative to the "java:comp/env" context. Additional information regarding the type of bean, the class names of the home and remote bean interfaces are also provided. The EJB reference in the deployment descriptor allows the application assembler and deployer to discover all references used by the enterprise bean. The deployer then binds the declared EJB reference to the enterprise bean home in the target environment. This layer of indirection allows the bean provider to look up the referenced bean's home interface using the logical name without knowing where the object resides in the enterprise system.

Shortly: <ejb-ref>tag is written by bean provider...for referencing bean1 from bean2.. He also provides the home,remote and type of bean used.So that application assembler can link the bean easily by seeing the home,remote interfaces used by bean provider.
Afterwards app.assembler or deployer links this bean2 with bean1 by providing <ejb-link> element in the deployment descriptor.
Hope this helps.
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic