• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Doubt in Final Mock Exam of HFEJB

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Folks,
The final mock exam in HFEJB has this question.

Within the deployment descriptor's <ejb-local-ref> element, which elements are optional ? (Choose all that apply)

A. <local>
B. <ejb-link>
C. <local-home>
D. <description>
E. <ejb-ref-name>
F. <ejb-ref-type>

The answer given is B and D.
I feel that <ejb-link> is optional to Bean Provider but is not the same for Application Assembler.
So I gess the answer should be D.

Ranchers, Please let me know if this is correct.

Cheers,
Sandeep
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<ejb-link> : specified by application assembler **IS** optional.

<description> : specified by bean provider **IS** optional.

The question states what is **OPTIONAL**. Nothing more than that. So get the keywords right.
 
Sandeep Prabhakar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nishant,
If that is the case, it would be an error if <ejb-link> is not specified. How does the container know which bean is the current bean referring to

Cheers,
Sandeep
 
Nishant Verma
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please note the usage of the <ejb-link> and without it. U will know.

<entity>
...
<ejb-ref>
<ejb-ref-name>ejb/Emp</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>EmpHome</home>
<remote>EmpRemote</remote>
<ejb-link>EmployeeRecord</ejb-link>
</ejb-ref>
...
</entity>


And without :

<session>
<ejb-name>EmployeeRecord</ejb-name>
<ejb-class>com.sandeep.TestEJB</ejb-class>
<ejb-ref>
bla bla bla, but no ejb-link
</ejb-ref>
...
</session>

Here "ejb/Emp" refers to EmployeeRecord in the **SAME** deployment descriptor. Hence you just created an alias for EmployeeRecord, rather than declaring actual descriptors.

Bottom-line

<ejb-link> = alias

Please credit $100 to my bank account
 
Sandeep Prabhakar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ha ha ha. I feel that should credit me $100 for giving you a oppurtunity to explain this.
Anyways thanks.

Cheers,
Sandeep
reply
    Bookmark Topic Watch Topic
  • New Topic