Issue 3152: Tie.deactivate() exception handling (java2idl-rtf) Source: (Mr. Simon C. Nash, ) Nature: Uncategorized Issue Severity: Summary: The javax.rmi.CORBA.Tie.deactivate() method does not declare any exceptions. However, when using a POA servant, the following exceptions can be thrown by the RMI/IDL tie's implementation of deactivate(): org.omg.PortableServer.POAPackage.ServantNotActive org.omg.PortableServer.POAPackage.WrongPolicy (by the servant_to_id() method) org.omg.PortableServer.POAPackage.ObjectNotActive org.omg.PortableServer.POAPackage.WrongPolicy (by the deactivate_object() method) How should these exceptions be handled by Tie.deactivate()? If they should be rethrown by Tie.deactivate(), what exception(s) should be used? (This issue was raised by Max Mortazavi of Sun.) Resolution: See revised text below. Revised Text: 1. In section 1.5.1.1, add "throws java.rmi.NoSuchObjectException" to the declaration of the Tie.deactivate method. 2. In section 1.5.1.1, add the following sentence at the end of the paragraph describing the Tie.deactivate method: "If the target object could not be deactivated (e.g., because it is not currently active), a NoSuchObjectException is thrown." 3. In section 1.5.1.4, add "throws java.rmi.NoSuchObjectException" to the declaration of the Util.unexportObject method. 4. In section 1.5.1.4, add the following sentence at the end of the paragraph describing the Util.unexportObject method: "If the object is not currently exported or could not be deactivated, a NoSuchObjectException is thrown." 5. In section 1.5.3.2, add "throws java.rmi.NoSuchObjectException" to the declaration of the UtilDelegate.unexportObject method. Actions taken: December 21, 1999: received issue May 24, 2001: closed issue Discussion: The lack of a throws clause on the signature for Tie.deactivate() was an oversight. This method is called only by Util.unexportObject(), which is called only by PortableRemoteObject.unexportObject(). Since the signature for PortableRemoteObject.unexportObject() has a throws clause for java.rmi.NoSuchObjectException, the same throws clause should be added to the signatures for both Tie.deactivate() and Util.unexportObject(). If a POA-based tie gets a POA exception when deactivating an object, it should throw a NoSuchObjectException whose detail field contains the original POA exception. Util.unexportObject() should rethrow this exception to PortableRemoteObject.unexportObject(), which should rethrow it to its caller. End of Annotations:===== Date: Mon, 20 Dec 1999 17:50:02 +0000 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: issues@omg.org CC: java2idl-rtf@omg.org Subject: Tie.deactivate() exception handling Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: Lo/e9C$L!!g]*!!E3Ie9 The javax.rmi.CORBA.Tie.deactivate() method does not declare any exceptions. However, when using a POA servant, the following exceptions can be thrown by the RMI/IDL tie's implementation of deactivate(): org.omg.PortableServer.POAPackage.ServantNotActive org.omg.PortableServer.POAPackage.WrongPolicy (by the servant_to_id() method) org.omg.PortableServer.POAPackage.ObjectNotActive org.omg.PortableServer.POAPackage.WrongPolicy (by the deactivate_object() method) How should these exceptions be handled by Tie.deactivate()? If they should be rethrown by Tie.deactivate(), what exception(s) should be used? (This issue was raised by Max Mortazavi of Sun.) 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 Date: Sun, 12 Nov 2000 12:49:32 +0000 From: Simon Nash Organization: IBM X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en MIME-Version: 1.0 To: java2idl-rtf@omg.org Subject: Issue 3152 proposed resolution Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: >]X!!'cEe9+do!!)l$!! I will place the following proposed resolution for issue 3152 in vote 2 of the Java to IDL RTF unless I hear otherwise by close of business Wednesday. Discussion: The lack of a throws clause on the signature for Tie.deactivate() was an oversight. This method is called only by Util.unexportObject(), which is called only by PortableRemoteObject.unexportObject(). Since the signature for PortableRemoteObject.unexportObject() has a throws clause for java.rmi.NoSuchObjectException, the same throws clause should be added to the signatures for both Tie.deactivate() and Util.unexportObject(). If a POA-based tie gets a POA exception when deactivating an object, it should throw a NoSuchObjectException whose detail field contains the original POA exception. Util.unexportObject() should rethrow this exception to PortableRemoteObject.unexportObject(), which should rethrow it to its caller. Proposed Resolution: 1. In section 1.5.1.1, add "throws java.rmi.NoSuchObjectException" to the declaration of the Tie.deactivate method. 2. In section 1.5.1.1, add the following sentence at the end of the paragraph describing the Tie.deactivate method: "If the target object could not be deactivated (e.g., because it is not currently active), a NoSuchObjectException is thrown." 3. In section 1.5.1.4, add "throws java.rmi.NoSuchObjectException" to the declaration of the Util.unexportObject method. 4. In section 1.5.1.4, add the following sentence at the end of the paragraph describing the Util.unexportObject method: "If the object is not currently exported or could not be deactivated, a NoSuchObjectException is thrown." 5. In section 1.5.3.2, add "throws java.rmi.NoSuchObjectException" to the declaration of the UtilDelegate.unexportObject method. 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