• 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
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Doubt in lifecycle of Stateless Bean

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

When the container starts up, it normally puts a fixed number of equivalent method-ready beans in the bean pool. Now, when the client invokes a method on the EJB Object, it picks up a bean from the pool to service the request. What escapes me is, how does the implementation of the methods that was written for the EJB Object (in the implementation Bean Class) is stuffed into this plain Stateless bean picked up on the fly to service the incoming request. Can someone please explain me what is happening here?

Regards,
Rakesh.R
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

... method-ready beans in the bean pool. Now, when the client invokes a method on the EJB Object, it picks up a bean from the pool to service the request.

What escapes me is, how does the implementation of the methods that was written for the EJB Object (in the implementation Bean Class) is stuffed into this plain Stateless bean picked up on the fly to service the incoming request.



An EJB container creates many classes for an EJB that the application programmer does not create. The code that implements the interfaces of the bean does not contain the code of the implementation class of the bean. The code of the interface classes contain the logic to communicate with the container and execute the bean implementation object that was extracted from the pool. The implementation object never leaves the container.

The execution path is:

client object ---> EJB interface object ---> EJB container objects ---> EJB implementation object ---> EJB container objects ---> EJB interface object ---> client object

Business logic is executed by the implementation object inside the EJB container.

Business logic is NOT executed by the interface object which communicates with the client object.
[ December 16, 2008: Message edited by: James Clark ]
 
Rakesh Rajagopalan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks James.
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic