• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

reference to the proxy of EJB

 
Ranch Hand
Posts: 1738
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p.14 of Ivan's notes:


Restriction: An EJB must not pass this as a method argument or result....
Motivation: The container may use a proxy mechanism to control concurrent access of the EJB instance. The reference injected into clients of the EJB is a reference to the proxy and not to an instance of the EJB implementation class.



I think "the reference injected into clients of the EJB is a reference of proxy" applies to Singleton and stateless bean, but not stateful bean..
Message driven bean cannot be injected by the client as the client does not use any MDB directly. So, this case does not apply to MDB.

According to the JSR 318 and EJB in Action :


 
Himai Minh
Ranch Hand
Posts: 1738
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let e answer my question.
In ejb in action, p.131,
"When a container injects am ejb,what really gets injected ? The answer is a proxy."
For stateless bean, the reference to the beans refer to the same object. For stateful bean, the references of the bean refer to different objects. The proxy handles that.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!