1

What is the basic difference between java.rmi.server.UnicastRemoteObject and java.rmi.PortableRemoteObject.

I know that one is used for JRMP and the other for IIOP,but can anyone explain it in a lay man's language.I'm new to Java.Also can we use a Protable Remote Object for JRMP? If not,why?

Pavitar
  • 4,282
  • 10
  • 50
  • 82

1 Answers1

1

http://download.oracle.com/javase/6/docs/technotes/guides/rmi-iiop/rmi_iiop_pg.html

When do I use UnicastRemoteObject vs PortableRemoteObject?

UnicastRemoteObject should be used as the superclass for the object implementation in RMI programming. PortableRemoteObject should be used in RMI-IIOP programming. If PortableRemoteObject is used, you can switch the transport protocol to either JRMP or IIOP during runtime.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
  • If you use either of these base classes you will get the associated protocol. If *neither* of these base classes is used, you can use *both* protocols at runtime simultaneously, via UnicastRemoteObject.exportObject() and PortableRemoteObject.exportObject(). – user207421 May 04 '11 at 10:24
  • I literally quoted the JavaSE documentation. If it's incorrect, please open a bug with Oracle. – Brett Kail May 04 '11 at 15:02