wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Why  Ejb Bean class not implementing the Remote Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Why  Ejb Bean class not implementing the Remote Interface" Watch "Why  Ejb Bean class not implementing the Remote Interface" New topic
Author

Why Ejb Bean class not implementing the Remote Interface

murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
Hi folks,

it will be great if help me to get clarify my doubt.

As for java specification if we want to use the Handle ( interface as reference ) the object class should implement the Interface. How it is able to give the Remote Handle for Ejb Object without implementing the
Remote Interface by Bean class.


advance thanks ,

regards,
Lee
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
The getHandle() method is invoked on the EJBObject which is associated with the bean. There is no need for the bean to be involved.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
Hi Roger Chung-Wee

Here my doubt is how the container is able to identify the mapping between the bean class and relavant Remote interface , here we are not at all implementing our bean class with particular Remote even though how the container is able map.


regards,
Lee
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Check out your ejb-jar.xml which defines the mapping of a bean type with its interfaces. A typical entry in like this.


So, the container will create a Hello EJBObject for the HelloBean instances.
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
The Bean class you have written is not the final class. The container will be generate a class which will extend your bean and implement the interfaces. There are other approaches as well.. As of Weblogic it follows the above said technique.

If you have weblogic and have a EJB application deployed you can see the files generated by the server
 
 
subject: Why Ejb Bean class not implementing the Remote Interface