Take a look at
http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-ejb1-2.html
-- snip
EJB 1.1 requires that the javax.rmi.PortableRemoteObject.narrow() method be
used to explicitly cast the home's remote reference to its appropriate type.
The use of PortableRemoteObject is required to support Java RMI-IIOP (Remote
Method Invocation over Internet Inter-ORB Protocol), which is based on CORBA
reference types that do not support native casting. You can take advantage
of the Class type variable used in the lookup() method to specify the target
interface in the PortableRemoteObject.narrow() method.
-- snip
Since J2EE is not dependent on a particular on-the-wire protocol, the
facilities available to the stubs you get (either for a home or a bean) are
to some extent "lowest common denominator". As IIOP and CORBA are considered
and important protocol and technology respectively, they are catered for in
the behaviours you can expect from a bean/home.
CORBA and IIOP support languages where you cannot cast from one object type
to another (e.g. C), hence they provide explicit helpers that allow you to
narrow from a more generic type to a more specific sub type.
This is reflected in the J2EE architecture by PortableRemoteObject. Since
jBoss uses RMI's default on the wire protocol (which is much closer to the
Java language) casting works fine (hence the fact it works in Sun's
reference container). It also works fine in Weblogic with its default t3
protocol. The use of PortableRemoteObject is for maximum future
compatibility.
Pete
--
Pete Bennett (mailto:[EMAIL PROTECTED])
Principal Architect, Synomics Ltd.
http://www.synomics.com
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of K
> S Sreeram
> Sent: 21 May 2001 15:58
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] PortableRemoteObject
>
>
> Hi
>
> What exactly is the use of this object? what is it supposed to do?
> Direct type casting after doing a look up seems to work all
> the time. I've
> tested with JBoss and the Sun J2EE SDK. it works with both
> the servers..
> so why is PortableRemoteObject.narrow required?
>
> KS
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user