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

Explanation needed on Session Bean Component Contract

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Source :EJB 3.1 Specification



4.Session Bean Component Contract
4.3 Protocol Between a Session Bean Instance and its Container
Containers themselves make no actual service demands on the session bean instances. The container
makes calls on a bean instance to provide it with access to container services and to deliver notifications
issued by the container.



The first line under " Protocol Between a Session Bean Instance and its Container" says that "Containers themselves make no actual service demands on the session bean instance".
However,the second line of the same paragraph says that "The container makes calls on a bean instance"

Isn't the second line contradictory to the first ?
Please Help.
 
Creator of Enthuware JWS+ V6
Posts: 3364
305
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohitkumar Gupta,

Containers themselves make no actual service demands on the session bean instance

Correct: it are the clients of a Session Bean that request for a service. The clients call business methods exposed by the Business Interface.

The container makes calls on a bean instance

In order to fulfil the service demands the container needs to call the Session Bean instance a couple of times, for instance:
- to inject the TimerService (a container service) or another EJB into the Session Bean
- to call the PostConstruct() callback method after creation of the Session Bean.

But the container will never call a Business Method on the Session Bean by itself.

Regards,
Frits
 
Mohit G Gupta
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic