Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Narrowing of EJBObject from Handle

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you need to narrow the remote stub that is returned from the getEJBObject method in Handle? (HF page 139-144)
As I have understood things so far the reason that you need to narrowing the stub you get from a JNDI lookup is to make it castable in Java when it has gone through RMI-IIOP.
But the EJBObject you get from the getEJBObject method does not come from RMI-IIOP or is it? Will not a regular cast be enough?
/Magnus
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will narrow when the returned interface is not of a specific Remote type .
1. JNDI lookup of home (Object is returned).
2. Getting EJBObject from Handle (EJBObject is returned ).
3. Getting EJBHome from HomeHandle.
etc
PortableRemoteObject.narrow() is not required when the remote type is specified in the method signature For example create and finder methods

But the EJBObject you get from the getEJBObject method does not come from RMI-IIOP or is it?


Yes it is.
[ December 10, 2003: Message edited by: Pradeep Bhat ]
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic