• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating bean Instance

 
Shanthi Priya
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.
 
alzamabar
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic