• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJBContext methods

 
Prasad Kuppa
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getEJBObject() and getEJBLocalObject() methods are provided in both EntityContext and SessionContext interfaces. Why didn't they provide these two methods in super interface - EJBContext? ( like in getEJBHome(), getEJBLocalHome() in EJBContext..)
Thanks,
Prasad
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good question!!!.
I think this is because of the way EJBObjects behave in Session and Entity beans. There are subtle differences like
"In session beans for a connected client there is one dedicated EJBObject but for entity beans an EJBObject can handle multiple clients. However the home still behaves the same i.e. one home for al beans of the same type".
So I think the implementation of the getEJBObject and getEJBLocalObject needed some change. This is what I think. Does that make sense :roll: Hope someone else throws some light on this.
 
Prasad Kuppa
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhir,
I am not sure on what you are trying to explain. My question is not about implementation, it is about the interfaces and its super interfaces. I think implementation never rules the interface design in the object oriented programming.
Prasad
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops!!! I completely misunderstood the question.
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wondered about this too. My guess is that those method are not provided in EJBContext because they would make no sense for MessageDrivenContext. Since MessageDrivenContext, SessionContext, and EntityContext extends EJBContext, EJBContext should attempt to only provide methods that make sense for all three.
Hope this helps.
 
Prasad Kuppa
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.. but the getEJBHome() and getEJBLocalHome() also do not make sense with MessageDrivenContext ( no home interface for Message driven beans.. )
Prasad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic