• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

reference to the proxy of EJB

 
Bartender
Posts: 2180
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2180
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic