Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Question about the Session/Entity Context interfaces

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why the EJB designers have defined only the following methods in the SessionContext/EntityContext interface?

EJBObject getEJBObject
EJBLocalObject getEJBLocalObject

and those methods haven't been declared in the super interface EJBContext, where all other inherited methods have been declared (except from Object getPrimaryKey in the EntityContext interface, which is obvious, as session beans can't have a primary key)
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm totally guessing here, but a you can only get a reference to the EJBObject after the SessionContext has been set by the container. Since we are able to access the EJBContext at runtime, putting EJBObject getEJBObject in the SessionContext interface disallows the client to call get a reference to the EJBObject before the SessionContext has been set.

EntityContext must also define those methods since it extends EJBContext.

Any suggestion on my logic?
[ August 08, 2004: Message edited by: Ryan Wong ]
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moreover, it wouldn't make sense for MessageDrivenContext (which extends from EJBContext) to expose getEJB(Local)Object methods as message-driven beans do not provide any client view.
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ryan Wong:
I'm totally guessing here, but a you can only get a reference to the EJBObject after the SessionContext has been set by the container. Since we are able to access the EJBContext at runtime, putting EJBObject getEJBObject in the SessionContext interface disallows the client to call get a reference to the EJBObject before the SessionContext has been set.

EntityContext must also define those methods since it extends EJBContext.

Any suggestion on my logic?

[ August 08, 2004: Message edited by: Ryan Wong ]



Well, I was more thinking of the opposite way. To declare the EJBObject-related methods in the EJBContext interface.
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marco Tedone:


Well, I was more thinking of the opposite way. To declare the EJBObject-related methods in the EJBContext interface. And following what Valentin said about Message-driven beans and EJB[Local] interfaces, the same would be true for EJB[Local]Object. If the architects decided to put EJBHome related methods in the EJBContext, they could have put also EJBObject related methods. Don't you think?

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic