Win a copy of Spark in Action this week in the Open Source Projects 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Confused about getting reference to interface

 
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Could someone explain to me the difference between the following(From EJB3.0 Core specs):

-A reference to an enterprise beans business interface
-A reference to an enterprise beans remote interface.
-A reference to an enterprise beans local interface.

I thought there was only 2 kinds of interface..local and remote.What does the 1st one refer to...?
What is the difference between retrieving an EJBObject\EJBLocalObject as opposed to calling get BusinessObject(Class <T> businessInterface)?Are there differences in capabilities of the returned object or what?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok so we're actually supposed to refer to the remote interface as the 'business interface' in EJB3.0 to avoid confusion with EJB2.x?

But even though our interfaces no longer extend EJBObject and EJBLocalObject are the following 2 methods of the SessionContext still relevant to EJB3.0:

-getEJBLocalObject
-getEJBObject


 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Duran Harris wrote:Oh ok so we're actually supposed to refer to the remote interface as the 'business interface' in EJB3.0 to avoid confusion with EJB2.x?



If the bean exposes a EJB2.x view through an interface extending the EJBObject or through the <remote> element in the xml, then that interface is known as the remote (component) interface.
If the bean exposes a EJB3.x view through an interface marked with @Remote or <business-remote> element in the xml, then that interface is known as a remote (business) interface.

Same is the case with the "local" counterparts.

Duran Harris wrote:
But even though our interfaces no longer extend EJBObject and EJBLocalObject are the following 2 methods of the SessionContext still relevant to EJB3.0:

-getEJBLocalObject
-getEJBObject




They will throw an IllegalStateException if the bean does not expose the remote (component) interface or the local (component) interface.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay thank you then I understand now.
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic