hai all., When the PortableRemoteObject.narrow() funciotn should be called to the reference of the Home interface .,
Thanks in advance
sundharc
-
When PortableRemoteObject.narrow() function should be called? (2 messages)
- Posted by: Sundhar Chandrasekaran
- Posted on: November 21 2000 07:54 EST
Threaded Messages (2)
- When PortableRemoteObject.narrow() function should be called? by Greg Comeau on November 21 2000 15:33 EST
- When PortableRemoteObject.narrow() function should be called? by Dave Wolf on November 21 2000 15:50 EST
-
When PortableRemoteObject.narrow() function should be called?[ Go to top ]
- Posted by: Greg Comeau
- Posted on: November 21 2000 15:33 EST
- in response to Sundhar Chandrasekaran
According to the Spec, this should always be used:
5.9 Type narrowing
A client program that is intended to be interoperable with all compliant EJB Container implementations
must use the javax.rmi.PortableRemoteObject.narrow(...) method to perform
type-narrowing of the client-side representations of the home and remote interface.
Note: Programs using the cast operator for narrowing the remote and home interfaces are likely to fail
if the Container implementation uses RMI-IIOP as the underlying communication transport.
In other words, your client applications *may* work if you simply cast your remote references to the home and remote interfaces, but if your environment later changes to use RMI-IIOP you will have to recode your clients to use PortableRemoteObject.narrow. So why not just do it correctly up front and avoid the trouble? -
When PortableRemoteObject.narrow() function should be called?[ Go to top ]
- Posted by: Dave Wolf
- Posted on: November 21 2000 15:50 EST
- in response to Greg Comeau
100% Correct!
Dave Wolf
Internet Applications Division
Sybase