Transition To RMI Alpha2

This document summarizes the changes made between the Early Access Release (EAR) of the Remote Method Invocation system and Alpha2. (The EAR was also known as alpha1). If you developed code under the EAR, you should read this document to know what kinds of changes you will need to make to your code for it to work under Alpha2.

This is just a summary. For complete details on each subject discussed, see the RMI Specification.

Package names
The package name for RMI is now java.rmi instead of the EAR's sunw.rmi. The name chnage refelects the fact that RMI will become part of a future Java release.
Remote and RemoteObject
These names have been swapped in this release -- sunw.rmi.RemoteObject is now java.rmi.Remote, and sunw.rmi.Remote is now java.rmi.server.RemoteObject.
Stub Generation
The stub generator rmigen is gone. In its place, you use rmic, which generates class files directly. No intermediate Java files are generated.
Marshaling
Arguments and return values are marshaled using Java object serialization. In Alpha2, a Java object of any type can be a parameter or return value.
Examples
The Echo and Chat examples in this release have changed completely. Other examples from the previous release are gone. In other words, you should check out the new ones for the way to do things.
Casting and instanceof
The sunw.rmi.Remote.cast and sunw.rmi.Remote.instanceOf methods are gone. In Alpha2, you can simply use the normal Java cast and instanceof syntax directly. No special RMI calls are required.
Server-side Changes
A server implementation is no longer required to set its port number. The implementation of java.rmi.server.UnicastRemoteServer provides one by default. You can explicitly choose a port if you need to using one of java.rmi.server.UnicastRemoteServer's constructor.
Transport
The transport is no longer based on Spring doors. This will rarely, if ever, be visible to the programmer.

Summary of API Changes

sunw.rmi.Control Gone
The static methods getClientHost and getClientPort in the class java.rmi.server.RemoteServer replace the methods getCallerHostName and getCallerPort (respectively) in the class sunw.rmi.Control.
sunw.rmi.Naming Replaced with java.rmi.Naming
The method names and signatures have changed. Also, there is no need to specify a port number in the URL, since the port will default to something reasonable if you use our registry implementation java.rmi.registry.RegistryImpl.
sunw.rmi.NamingException Gone
sunw.rmi.RemoteObject Replaced with sunw.rmi.Remote
sunw.rmi.RemoteException Completion codes gone
Completion codes no longer exist, and the constructors and methods dealing with them are not in java.rmi.RemoteException.
sunw.rmi.Unreferenced Replaced with java.rmi.server.Unreferenced
(but not implemented in this release)
sunw.rmi.Remote Replaced with java.rmi.server.RemoteObject
Both cast and instanceOf methods are gone. RemoteObject also overrides some of the methods inherited from the class Object
sunw.rmi.Marshaling Gone
Arguments and return values are marshaled using Java Object Serialization.
sunw.orb.ORBException Gone
sunw.orb.MarshalBuffer Gone
sunw.rmi.util Gone