• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Why do bean classes need access to homes and objects

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spec makes a big deal about which of the lifecycle and container callback methods of a bean class can call (getEJBHome, getEJBObject, getEJBLocalHome, getEJBLocalObject) methods on their corresponding contexts(SessionContext, EntityContext or MessageDrivenContext). I do not understand why a bean class instance would need to access its home and component interfaces? Would anyony who has any idea/example of this, please share it?

Thanks
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure about the following, but this is what came to my mind:

  • If you want to create another bean of the same type from within the bean class (I don't know why would you wanna do that! ). You have to do it using the home interface by calling the getEJBHome() method.
  • If you want to pass a reference of the bean to another bean, you can't pass this as a parameter. You're only allowed to pass your bean's EJBObject.


  • Regards,
    [ July 12, 2005: Message edited by: Nadeem Awad ]
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I also think that the getEJBHome can be used as a cached object. Then when you want to get the bean object again sometime later. In this way, you save a lot of resource to lookup the ejbHome object.
     
    I can't take it! You are too smart for me! Here is the tiny ad:
    the value of filler advertising in 2021
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic