Wednesday, November 11, 2009

Narrow the lookup...EJB

With Java EE 5 we can simply cast the EJB look-up to one of the remote interfaces.
But this will not do with J2EE.

We should use javax.rmi.PortableObject.narrow method to narrow the EJB look-up to home interface.

And the reason is, J2EE implementation requires RMI-IIOP to implement the remote interfaces.This RMI-IIOP demands that the real object must be wrapped around with a portable object.

This portable object encapsulates information about the real remote object.The client has to interogate the portable object to find the real remote object.This process ( of obtaining the real object from the portable object) is called "narrowing".

No comments:

Post a Comment