• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJBObject Stub Reference (vs) Client

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
When we say that the EJB client gets a reference to an EJBObject, it is actually the reference to the EJBObject stub implemented by the container. In java inorder to use a reference it is necessary that the user should be aware of the class of the reference. Hence EJBClient should be aware of the EJBObject stub class.
How will the client get the class file of EJBObject stub ?
Regards
Sridevi.
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Usually the deployment tools have an option to generate the client stub classes, which are used by the EJB clients.
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're right, for a Remote interface (either home or component) the client will have a reference to a proxy of the EJBObject (or EJBHome) and *not* a reference to the actual object. The client *does* need that class file, but how this happens depends entirely upon your application server (and the environment in which the client is running).
So at compile time, the client needs the interfaces, but at runtime the client needs the interfaces AND the stub classes, but HOW the client gets the classes will vary...
The most straightforward, and perhaps most common way is when the deployment tools generate stub classes, and package them into a "client jar". The client puts this in his classpath, and everything is cool. This client jar may also include the home and component interfaces. Some server/client scenarios can dynamically send the proxy class to the client, in such a way that the client doesn't need to have the stub class physically present prior to runtime.
Remember, the client code is not usually portable, even if the bean is (although that's a good reason to build your client using, say, the ServiceLocator pattern or something like it). You'll have to find out from your app server exactly what the client must know and have in order to run correctly.
cheers,
Kathy
 
Sridevi Sangaiah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kathy i got what i wanted from your reply. So passing the stub classes to the client is the responsibility of the application server developer.Am I right?
regards
Sridevi
 
Evildoers! Eat my justice! And this tiny ad's justice too!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic