• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reference to the proxy of EJB

 
Himai Minh
Ranch Hand
Posts: 1359
7
  • 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: 1359
7
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic