Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Component Interface  RSS feed

 
Stanley Walker
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHy is it necessary for us to call business methods on the stub to the component interface(which the home hands out to us)
Why cant the home just hand out reference to the bean class and then we can directly call the business method.
is there a special reason why we leave the bean class alone and use the component interface instead???
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Every call that a client makes to an EJB should be examined by the EJB container object, to handle transactions, security, scalability and other such orthogonal services for which we use JavaEE app server.
The EJB container object is a manager for the bean object.
If the client is able to call the bean object directly, container won't get any chance to integrate its services.
By hiding the bean reference behind a proxy object, the container is able to inject its services.
 
Pallav Bora
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to Karthik's,

Remote EJBs can be potentially hosted in an all together different physical server. In such a situation the client calls will be over RMI. The RMI calls are taken care of by the stubs under the hood.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!