Why Ejb Bean class not implementing the Remote Interface

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.

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

posted Jun 29, 2005 23:57:00

0

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

posted Jun 30, 2005 02:20:00

0

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.

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