Issue 4749: New issue: Error in resolution of issue 4699 (java-rtf) Source: Oracle (Mr. Ken Cavanaugh, nobody) Nature: Uncategorized Issue Severity: Summary: The resolution to issue 4699 introduced a new method in org.omg.CORBA.LocalObject as follows: abstract public String[] _ids() ; Unfortunately this causes a big problem for current users of portable interceptors: any user of PI who implements a local interface (for example ServerRequestInterceptor) according to the CORBA 2.5 spec will have written code that will not function correctly under the CORBA 3.0 revision, due to the addition of this new abstract method. The fix for this is simple: just change the _ids method to public String[] _ids() { return new String[0] ; } This causes the _is_a method to always return false for old implementations of local interfaces, which is a reasonable result, since old implementations were written before is_a support was available. Resolution: Incorporate revised text and closed issue Revised Text: Note: this is the resolution from Vote 2. I have highlighted the modification for issue 4749 like this. In section 1.12.1, replace the local interfaces sub-section with: A new interface in org.omg.CORBA called LocalInterface is defined as: public interface LocalInterface extends org.omg.CORBA.Object {} A local interface <typename> is mapped to the following Java classes: public interface <typename> extends <typename>Operations, org.omg.CORBA.LocalInterface, org.omg.CORBA.portable.IDLEntity where interface <typename> and interface <typename>Operations are identical to the mapping for a non-local interface, except for the inheritance relationship of interface <typename>. In order to support _is_a, it is necessary to have information about the repository_ids of all super-interfaces of the local interface. This requires generating a base class that is used for implementations of local interfaces. This base class must satisfy the following requirements: The base class is a public abstract class named _<typename>LocalBase. It must define the _ids() method, which is an abstract method in org.omg.CORBA.LocalObject. The list of strings returned from the _ids() method must start with the repository ID of the most derived interface. An implementation of <typename> may then be written as follows: class <typename>Impl extends <typename>LocalBase { // whatever constructors this implementation needs ... // implementation of methods defined in <typename>Operations ... } and an instance would be created using the usual Java language construct: <typename> obj = new <typename>Impl( ... ) ; A holder class is generated as for non-local interfaces. A helper class is also generated according to normal riles, see Section 1.5, "Helpers", on page 1-13. ORB implementations shall detect attempts to marshal local objects and throw a CORBA::MARSHAL exception. For example, consider the following IDL definition: local interface Test { long ping( in long arg ) ; } ; This results in the following classes: public interface Test extends TestOperations, org.omg.CORBA.LocalInterface, org.omg.CORBA.IDLEntity { } public interface TestOperations { public int ping( int arg ) ; } public abstract class _TestLocalBase extends org.omg.CORBA.LocalObject implements Test { private String[] _type_ids = { "IDL:Test:1.0" } ; public String[] _ids() { return (String[])_type_ids.clone() ; } } In section 1.20.2.1, replace the _is_a method with: public boolean _is_a( String repository_id ) { String ids[] = _ids() ; for (int i=0; i<ids.length; i++) { if (repository_id.equals( ids[i] ) return true ; } return false ; } and also add public String[] _ids() { throw new org.omg.CORBA.NO_IMPLEMENT() ; } before the _is_a method. Actions taken: December 14, 2001: received issue May 13, 2002: closed issue Discussion: End of Annotations:===== Date: Thu, 13 Dec 2001 15:43:16 -0800 (PST) From: Ken Cavanaugh Reply-To: Ken Cavanaugh Subject: New issue: Error in resolution of issue 4699 To: issues@omg.org Cc: java-rtf@omg.org MIME-Version: 1.0 Content-MD5: zRV4mSRXwM8oZGYq01Th9w== X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.5 SunOS 5.7 sun4u sparc Content-Type: TEXT/plain; charset=us-ascii X-UIDL: e;p!!3R/e9,G`d9g0>e9 The resolution to issue 4699 introduced a new method in org.omg.CORBA.LocalObject as follows: abstract public String[] _ids() ; Unfortunately this causes a big problem for current users of portable interceptors: any user of PI who implements a local interface (for example ServerRequestInterceptor) according to the CORBA 2.5 spec will have written code that will not function correctly under the CORBA 3.0 revision, due to the addition of this new abstract method. The fix for this is simple: just change the _ids method to public String[] _ids() { return new String[0] ; } This causes the _is_a method to always return false for old implementations of local interfaces, which is a reasonable result, since old implementations were written before is_a support was available. Ken. Date: Thu, 13 Dec 2001 16:42:44 -0800 From: Vijaykumar Natarajan Subject: RE: New issue: Error in resolution of issue 4699 In-reply-to: <200112132343.fBDNhG713068@ha1sca-mail1.SFBay.Sun.COM> To: "'Ken Cavanaugh'" Cc: java-rtf@omg.org Reply-to: vnatarajan@borland.com Message-id: <01ca01c18438$3eabb540$c35a14ac@VIJAY1> Organization: Borland Software Corporation MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Mailer: Microsoft Outlook, Build 10.0.3311 Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Content-Type: text/plain; charset=us-ascii X-UIDL: Bpc!!oDOe9inb!!-F@!! Ken, I would suggest ... return new String[] { "IDL:omg.org/CORBA/LocalObject:1.0" }; .. As a friendly amendment. Vijay > -----Original Message----- > From: Ken Cavanaugh [mailto:Ken.Cavanaugh@Sun.COM] > Sent: Thursday, December 13, 2001 3:43 PM > To: issues@omg.org > Cc: java-rtf@omg.org > Subject: New issue: Error in resolution of issue 4699 > > > The resolution to issue 4699 introduced a new method in > org.omg.CORBA.LocalObject as follows: > > abstract public String[] _ids() ; > > Unfortunately this causes a big problem for current users of > portable interceptors: any user of PI who implements a local > interface (for example ServerRequestInterceptor) according to > the CORBA 2.5 spec will have written code that will not > function correctly under the CORBA 3.0 revision, due to the > addition of this new abstract > method. > > The fix for this is simple: just change the _ids method to > > public String[] _ids() > { > return new String[0] ; > } > > This causes the _is_a method to always return false for old > implementations of local interfaces, which is a reasonable > result, since old implementations were written before is_a > support was available. > > Ken. > > Date: Thu, 13 Dec 2001 22:56:17 -0800 (PST) From: Ken Cavanaugh Reply-To: Ken Cavanaugh Subject: RE: New issue: Error in resolution of issue 4699 To: Ken.Cavanaugh@Sun.COM, vnatarajan@borland.com Cc: java-rtf@omg.org MIME-Version: 1.0 Content-MD5: bpXaTL9QHBbmtHz5ZEj8iQ== X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.5 SunOS 5.7 sun4u sparc Content-Type: TEXT/plain; charset=us-ascii X-UIDL: G~Qd9^%~e9e6"e9+[l!! >From: Vijaykumar Natarajan >Subject: RE: New issue: Error in resolution of issue 4699 >To: "'Ken Cavanaugh'" >Cc: java-rtf@omg.org >MIME-version: 1.0 >X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 >Content-transfer-encoding: 7BIT >Importance: Normal >X-Priority: 3 (Normal) >X-MSMail-priority: Normal > >Ken, > >I would suggest > >... >return new String[] { "IDL:omg.org/CORBA/LocalObject:1.0" }; >.. > >As a friendly amendment. > >Vijay That could be a good idea, but I have a couple of questions: 1. Should this be LocalObject, which is not really a type, or just IDL:omg.org/CORBA/Object:1.0? 2. Do we currently expect in the POA case that all id String[] we get from stubs or skeletons end in IDL:omg.org/CORBA/Object:1.0? Another possibility is to make the code in LocalObject._is_a detect that _ids was not implemented and throw a NO_IMPLEMENT exception in that case. Comments? Thanks, Ken. >> -----Original Message----- >> From: Ken Cavanaugh [mailto:Ken.Cavanaugh@Sun.COM] >> Sent: Thursday, December 13, 2001 3:43 PM >> To: issues@omg.org >> Cc: java-rtf@omg.org >> Subject: New issue: Error in resolution of issue 4699 >> >> >> The resolution to issue 4699 introduced a new method in >> org.omg.CORBA.LocalObject as follows: >> >> abstract public String[] _ids() ; >> >> Unfortunately this causes a big problem for current users of >> portable interceptors: any user of PI who implements a local >> interface (for example ServerRequestInterceptor) according to >> the CORBA 2.5 spec will have written code that will not >> function correctly under the CORBA 3.0 revision, due to the >> addition of this new abstract >> method. >> >> The fix for this is simple: just change the _ids method to >> >> public String[] _ids() >> { >> return new String[0] ; >> } >> >> This causes the _is_a method to always return false for old >> implementations of local interfaces, which is a reasonable >> result, since old implementations were written before is_a >> support was available. >> >> Ken. >> >> > Date: Fri, 14 Dec 2001 13:29:28 +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: Ken Cavanaugh CC: vnatarajan@borland.com, java-rtf@omg.org Subject: Re: New issue: Error in resolution of issue 4699 References: <200112140656.fBE6uH725073@ha1sca-mail1.SFBay.Sun.COM> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: #JWd9:G'"!TIm!!W%8!! Ken, I don't think it is ever necessary to include IDL:omg.org/CORBA/Object:1.0 in id arrays. The ORB runtime should treat this specially. Simon Ken Cavanaugh wrote: > > >From: Vijaykumar Natarajan > >Subject: RE: New issue: Error in resolution of issue 4699 > >To: "'Ken Cavanaugh'" > >Cc: java-rtf@omg.org > >MIME-version: 1.0 > >X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 > >Content-transfer-encoding: 7BIT > >Importance: Normal > >X-Priority: 3 (Normal) > >X-MSMail-priority: Normal > > > >Ken, > > > >I would suggest > > > >... > >return new String[] { "IDL:omg.org/CORBA/LocalObject:1.0" }; > >.. > > > >As a friendly amendment. > > > >Vijay > > That could be a good idea, but I have a couple of questions: > > 1. Should this be LocalObject, which is not really a type, > or just IDL:omg.org/CORBA/Object:1.0? > > 2. Do we currently expect in the POA case that all id String[] > we get from stubs or skeletons end in IDL:omg.org/CORBA/Object:1.0? > > Another possibility is to make the code in LocalObject._is_a detect > that _ids was not implemented and throw a NO_IMPLEMENT exception in > that case. > > Comments? > > Thanks, > > Ken. > > >> -----Original Message----- > >> From: Ken Cavanaugh [mailto:Ken.Cavanaugh@Sun.COM] > >> Sent: Thursday, December 13, 2001 3:43 PM > >> To: issues@omg.org > >> Cc: java-rtf@omg.org > >> Subject: New issue: Error in resolution of issue 4699 > >> > >> > >> The resolution to issue 4699 introduced a new method in > >> org.omg.CORBA.LocalObject as follows: > >> > >> abstract public String[] _ids() ; > >> > >> Unfortunately this causes a big problem for current users of > >> portable interceptors: any user of PI who implements a local > >> interface (for example ServerRequestInterceptor) according to > >> the CORBA 2.5 spec will have written code that will not > >> function correctly under the CORBA 3.0 revision, due to the > >> addition of this new abstract > >> method. > >> > >> The fix for this is simple: just change the _ids method to > >> > >> public String[] _ids() > >> { > >> return new String[0] ; > >> } > >> > >> This causes the _is_a method to always return false for old > >> implementations of local interfaces, which is a reasonable > >> result, since old implementations were written before is_a > >> support was available. > >> > >> Ken. > >> > >> > > -- Simon C Nash, Chief Technical Officer, IBM Java Technology Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb Date: Tue, 18 Dec 2001 14:53:53 -0800 (PST) From: Ken Cavanaugh Reply-To: Ken Cavanaugh Subject: Proposed resolution for issue 4749 To: java-rtf@omg.org MIME-Version: 1.0 X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.5 SunOS 5.7 sun4u sparc Content-Type: MULTIPART/mixed; BOUNDARY=Bouguet_of_Pheasants_652_000 X-UIDL: -GX!!4C8!!m/kd9U3\!! Content-Type: TEXT/plain; charset=us-ascii Content-MD5: 86VA1mjPtuiaJL+tfl0tUQ== I have attached the resolution in html. I plan to include this in the upcoming vote 4. Ken. Content-Type: TEXT/html; name="4749.html"; charset=US-ASCII; x-unix-mode=0764 Content-Description: 4749.html Content-MD5: UPSjD/zr4FyvQjxktd3nIw== Issue 4749: New issue: Error in resolution of issue 4699 (java-rtf) Click here for this issue's archive. Source: Sun Microsystems (Mr. Ken Cavanaugh, kcavanaugh@acm.org ken.cavanaugh@eng.sun.com) Nature: Uncategorized Issue Severity: Summary: The resolution to issue 4699 introduced a new method in org.omg.CORBA.LocalObject as follows: abstract public String[] _ids() ; Unfortunately this causes a big problem for current users of portable interceptors: any user of PI who implements a local interface (for example ServerRequestInterceptor) according to the CORBA 2.5 spec will have written code that will not function correctly under the CORBA 3.0 revision, due to the addition of this new abstract method. The fix for this is simple: just change the _ids method to throw NO_IMPLEMENT, which results in is_a throwing NO_IMPLEMENT for old local interface implementations. This is correct according to the 2.5 specification. Newer local interface implementations that extend the generated LocalBase class will correctly support is_a. Proposed Resolution: Incorporate the revised text, make corresponding changes in the standard source files, and close the issue. Revised Text: In section 1.12.1, replace the local interfaces sub-section with: A new interface in org.omg.CORBA called LocalInterface is defined as: public interface LocalInterface extends org.omg.CORBA.Object {} A local interface is mapped to the following Java classes: public interface extends Operations, org.omg.CORBA.LocalInterface, org.omg.CORBA.portable.IDLEntity where interface and interface Operations are identical to the mapping for a non-local interface, except for the inheritance relationship of interface . In order to support _is_a, it is necessary to have information about the repository_ids of all super-interfaces of the local interface. This requires generating a base class that is used for implementations of local interfaces. This base class must satisfy the following requirements: The base class is a public abstract class named _LocalBase. It must define the _ids() method, which is an abstract method in org.omg.CORBA.LocalObject. The list of strings returned from the _ids() method must start with the repository ID of the most derived interface. An implementation of may then be written as follows: class Impl extends LocalBase { // whatever constructors this implementation needs ... // implementation of methods defined in Operations ... } and an instance would be created using the usual Java language construct: obj = new Impl( ... ) ; A holder class is generated as for non-local interfaces. A helper class is also generated according to normal riles, see Section 1.5, "Helpers", on page 1-13. ORB implementations shall detect attempts to marshal local objects and throw a CORBA::MARSHAL exception. For example, consider the following IDL definition: local interface Test { long ping( in long arg ) ; } ; This results in the following classes: public interface Test extends TestOperations, org.omg.CORBA.LocalInterface, org.omg.CORBA.IDLEntity { } public interface TestOperations { public int ping( int arg ) ; } public abstract class _TestLocalBase extends org.omg.CORBA.LocalObject implements Test { private String[] _type_ids = { "IDL:Test:1.0" } ; public String[] _ids() { return (String[])_type_ids.clone() ; } } In section 1.20.2.1, replace the _is_a method with: public boolean _is_a( String repository_id ) { String ids[] = _ids() ; for (int i=0; i