• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Narrowing of EJBObject from Handle

 
Magnus Stattin
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • 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
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic