• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How we get the Ejb home and ejb remote implementaion at clent side?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In some articles on different sites i read that we only serialize/deserialize the state of object.On the deserialization side actual class definition should be present.

If that is the case, In case of EJB then how we get the Ejb home and ejb remote implementaion from server(which is on remote machine) as on client side we just have home and remote interfaces on client side?
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Remote interface is a step up from Serializable. With Remote objects, you can actually retrieve both object state and interface definition out of a directory (as you do with EJB homes) or by return values from other Remote objects (as with EJB remote).

All you get is the interface definition though, not the implementation. When you call a method on a remote object, what really happens is that you call a stub implementation on the client side, which implements your interface. The stub method marshals the parameters ... that is it prepares them to be sent across the network ... and then sends a message to the server. On the server side, a skeleton implementation receives the message, parses it, and makes the call on the real object. For return values the same process happens in reverse.

If you want a deeper understanding of how EJBs work, I suggest running through a tutorial on RMI. EJBs abstract some of the details away from, but you get to see it all with RMI.
 
scott miles
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Greg, let me explain my question further and let me know if i got your expanation correct or not.

Below is code at client side

MyEJBHome home1= context.lookup("home1");

//Here at client side we just have MyEJBHome interface. No implemetation(even not stub). We get the implemantation at runtime on lookup from server side. Right?

MyEJBRemote remote1=home1.create();

//here also we just have MyEJBRemote interface. No implementation of MyEJBRemote exist at client side . On calling create method on home we get the stub implementation from server side at run time .Right?
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic