aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Confused about getting reference to interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Confused about getting reference to interface" Watch "Confused about getting reference to interface" New topic
Author

Confused about getting reference to interface

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

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?

===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

See this


[My Blog] [JavaRanch Journal]
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

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
Marshal

Joined: Jul 20, 2005
Posts: 10266
    
168

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

Joined: Nov 09, 2008
Posts: 598

Okay thank you then I understand now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confused about getting reference to interface