Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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

Creating bean Instance

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi group,

While creating a bean instance can the home interface create() method directly invoke the beans newInstance() method with out intercepting remote interface in middle? becoz all the bean methods are accessed via remote interface!?

Please help!
Thanks.
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Shanthi Priya:
Hi group,

While creating a bean instance can the home interface create() method directly invoke the beans newInstance() method with out intercepting remote interface in middle? becoz all the bean methods are accessed via remote interface!?

Please help!
Thanks.



Just to clarify: the bean instance is created by the Container, not the home interface. As interface exposes methods to client, doesn't have business logic implementation. The entity bean creation is not as linear as a plain old Java object creation: the container invokes the constructor to create a new instance of the bean, but then to 'make' the bean properly it invokes setSessionContext/setEntityContext and for session beans also ejbCreate. If you want to pass the exam, start thinking that the beans live like in a minefield: only the container can talk directly to them, because it must put in the middle (between the client and the beans) its services. If you try to access the minefield, without knowing where the bombs are...BUMM!
 
Are you okay? You look a little big. Maybe this tiny ad will help:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic