File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Ejb Bean class not implementing the Remote Interface

 
murali kankanala
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The getHandle() method is invoked on the EJBObject which is associated with the bean. There is no need for the bean to be involved.
 
murali kankanala
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 425
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic