Issue 2478: Replaceability of javax.* APIs (java2idl-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: The javax.* APIs in the Java to IDL mapping spec have not been designed to separate interface from implementation. For the RMI-IIOP standard extension, this is not a problem since the whole standard extension can be replaced by other vendors if necessary. However, when RMI-IIOP becomes part of the core, it may be necessary to permit other vendors to replace these implementations without replacing the APIs (as is currently the case for the ORB APIs and implementation). Resolution: Closed, accepted Revised Text: This is a proposal of a framework to enable vendor-specific implementations of the Java Language to IDL Mapping Portability Interfaces. The effected classes are: javax.rmi.PortableRemoteObject javax.rmi.CORBA.Stub javax.rmi.CORBA.Util These classes are extended to optionally delegate their methods to separate implementation classes which can be provided by ORB vendors. The implementation delegate classes for PortableRemoteObject and Util must implement the following new interfaces for per-class delegation: package javax.rmi.CORBA; public interface UtilDelegate { void mapSystemException(org.omg.CORBA.SystemException ex) throws java.rmi.RemoteException; void writeAny(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj); java.lang.Object readAny(org.omg.CORBA.portable.InputStream in); void write_RemoteObject(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj); void write_AbstractObject(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj); void registerTarget(javax.rmi.CORBA.Tie tie, java.rmi.Remote target); void unexportObject(java.rmi.Remote target); javax.rmi.CORBA.Tie getTie(java.rmi.Remote target); javax.rmi.CORBA.ValueHandler createValueHandler(); } public interface PortableRemoteObjectDelegate { void exportObject(Remote obj) throws RemoteException; Remote toStub (Remote obj) throws NoSuchObjectException; void unexportObject(Remote obj) throws NoSuchObjectException; java.lang.Object narrow (java.lang.Object narrowFrom, java.lang.Class narrowTo) throws ClassCastException; void connect (Remote unconnected, Remote connected) throws RemoteException; } The implementation delegate class for Stub must implement the following new interface for per-instance delegation: package javax.rmi.CORBA; public interface StubDelegate { int hashCode(Stub self); boolean equals(Stub self, java.lang.Object obj); String toString(Stub self); void writeObject(Stub self, java.io.ObjectOutputStream s); void readObject(Stub self, java.io.ObjectInputStream s); void connect(Stub self, ORB orb) throws RemoteException; } Sun will provide default implementations of the methods in the standard API classes. Alternate implementations are enabled by setting system properties or placing entries in the orb.properties file. The names of the new system properties are: javax.rmi.CORBA.PortableRemoteObjectClass javax.rmi.CORBA.UtilClass javax.rmi.CORBA.StubClass For security reasons, each replaceable API class reads its implementation delegate class system property at static initialization time and uses this information to set up implementation delegation if this has been specified. The delegation arrangement thus established cannot be changed subsequently. The search order for delegate class names is: 1.The system properties. 2.The orb.properties file. For each implementation delegate class, an instance is created using the Class.newInstance() method. For the PortableRemoteObject and Util delegate classes, this is a singleton instance. For the Stub delegate class, there is one delegate instance per stub object. The methods in the standard API classes test if a delegate instance exists and if so, forward the method call on to the delegate instance. Actions taken: February 22, 1999: received issue September 16, 1999: closed issue Discussion: End of Annotations:===== Date: Mon, 22 Feb 1999 12:14:18 +0000 From: Simon Nash Organization: IBM To: issues CC: java2idl Subject: Replaceability of javax.* APIs The javax.* APIs in the Java to IDL mapping spec have not been designed to separate interface from implementation. For the RMI-IIOP standard extension, this is not a problem since the whole standard extension can be replaced by other vendors if necessary. However, when RMI-IIOP becomes part of the core, it may be necessary to permit other vendors to replace these implementations without replacing the APIs (as is currently the case for the ORB APIs and implementation). Simon -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb