• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

EJB Beginner

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question on EJBs:

If someone as deployed an EJB on a server, and I am trying to invoke one of its methods, what do I need to do this?

I have seen some examples of client code that do the following:

1.get InitalContext
2.using InitialContext get a reference to the home
3.Use the narrow() method to cast it down to the type you want.
4.Call the create() method on the home object to get a reference to the Remote inteface
5.Call the required methods on the remote interface.

Question: In step 3 where we cast it to the type that we want. Does this mean that I must have the Home class and the Remote class available to me?
Is this usually the case when a third party provides a EJB already deployed, do they give you the home and remote interfaces so that you can cast down to them?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
you must have the stub generated by the deployment tool to cast the object
and providers give only the stub of the bean deployed .
Cheers .
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic