File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what implements the Home and Remote interfaces?

 
Ravissant Markandey
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone, Im an ejb newbie, what i want to know is, where are the home and remote interfaces implemented.
The home interface has a create() method that returns a reference to the remote interface(is it?)
In my project this create method is used in a delegate class to create an object of the remote interface(apparently its the class implementing the home interface)...my question is where is this class??..or once again, where are the home and remote interfaces implemented?

Thanks in advance,
Ravissant
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The actual implementation of the home and the remote interfaces is provided by the application server.
 
Ravissant Markandey
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much for the response Jaikiran, well actually in the project im working on, the Business Delegate Design Pattern is being used..so in the businessDelegateImplementation class(which implements the businessDelegate interface), a bean class method is called using a remote interface reference, what i want to know is:
How are we able to access the methods in the bean class with a reference of type remote interface when the bean class DOESNT even implement the remote interface?

Thanks a lot,
Ravissant
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not invoke methods on the bean class, rather on the RemoteObject thru the Proxy (Stub). The remote object then delegates your call to the actual bean object.
 
ujjwal soni
Ranch Hand
Posts: 403
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss or other enterprise application server provides implementation for home and remote interfaces.

Regards,

Ujjwal B Soni

Baroda

Gujarat
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ravissant Markandey:
How are we able to access the methods in the bean class with a reference of type remote interface when the bean class DOESNT even implement the remote interface?



In EJB2.x when you implement a bean class you dont actually include the "implements MyEJBRemoteInterface" in the bean class definition. But, remember that the EJB that you implement are expected to implement the specs, which means that any method that is declared in the remote/local interface has to be present and implemented in the bean definition class. The application server while deploying the EJB will check whether the method that are mentioned in the remote/local interface are also present in the bean implementation class (the ejb-jar.xml will help the server in knowing which remote interface corresponds to which ejb-class). If the server finds that the bean implementation class does not have the methods which have been declared in the remote interface then it throws an exception while deploying.

Furthermore, the proxies (generated by the application server) that are returned to the client (in your case the business delegate) through JNDI lookup, will implement the remote/local interfaces.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic