• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Reflection API

 
Ranch Hand
Posts: 77
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found one question on reflection API in HFEJB final mock exam.
Question is
When programming an entity bean class which technique(s) should be AVOIDED to ensure bean portability across all EJB 2.0 containers? (choose all that apply)
A. changing a thread's priority
B. Using the reflection API
C. Using wrapper classes
D. Using static nested classes
Ans is (A) & (B).
A is OK.
I am confused with option B.
yes, that's right that some of methods of reflection API we have to avoid.
But at the same time book is saying that getEJBMetaData() method in lcoal home interface (EJBLocalHome) is not required as we can use reflection API(Page 149). So, what's right we have to avoid reflection API or not?

Thanks
Imran
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The local home object/interface implementations are gonna run in the same JVM as the beans are. Hence there is no need to go for EJBMetaData() method on Local Home Object. I had read through specs that also talks about, if you are interfacing through local interfaces, you could do reflection mechanisms. But Strict NO! NO! for remote interface access!

Plz advise, if I am wrong here!

Thanks,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic