Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubt in lifecycle of Stateless Bean

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks James.
    Bookmark Topic Watch Topic
  • New Topic