Issue 1746: Conext support in Java (java-rtf) Source: (, ) Nature: Revision Severity: Summary: Summary: Below are the proposed spec changes to support Contexts in IDL/Java. It turns out that some type of API change will be required. As I was investigating this further today I realized that one of the methods on ORB we have to support Context streaming is a proprietary method and not a standard method, so there is no way to create a Context object given an InputStream. This makes demarshalling of contexts impossible in the stream-based model as it exists today. The proposal adds one new method each to InputStream and OutputStream. Also, as requested by Simon I have text which states how the Context parameters are used in interface method declarations. Resolution: closed issue Revised Text: Actions taken: July 27, 1998: received issue June 4, 1999: closed issue Discussion: End of Annotations:===== Return-Path: Sender: "George Scott" Date: Mon, 27 Jul 1998 19:09:01 -0700 From: "George M. Scott" Organization: Inprise Corporation To: java-rtf@omg.org Subject: Conext support in Java Below are the proposed spec changes to support Contexts in IDL/Java. It turns out that some type of API change will be required. As I was investigating this further today I realized that one of the methods on ORB we have to support Context streaming is a proprietary method and not a standard method, so there is no way to create a Context object given an InputStream. This makes demarshalling of contexts impossible in the stream-based model as it exists today. The proposal adds one new method each to InputStream and OutputStream. Also, as requested by Simon I have text which states how the Context parameters are used in interface method declarations. ============== Add the following new section to 23.11, 23.11.3 Implicit Arguments to Operations If an operation in an OMG IDL specification has a context specification, then a org.omg.CORBA.Context input parameter (Insert cross-ref to Context here) follows all operation-specific arguments. =============== Add the following method to OutputStream: public void write_Context(org.omg.CORBA.Context ctx, org.omg.CORBA.ContextList contexts) { throw new org.omg.CORBA.NO_IMPLEMENT(); } The write_Context method writes the specified Context to the stream. The Context is marshalled as a sequence of strings as specified in (insert cross-ref to GIOP Context encoding section). The write method writes only those Context values specified in the contexts parameter. =============== Add the following method to InputStream: public org.omg.CORBA.Context read_Context() { throw new org.omg.CORBA.NO_IMPLEMENT(); } The read_Context method reads a Context from the stream. The context is read from the stream as a sequence of strings as specified in (insert cross-ref to GIOP Context encoding section). George Return-Path: Date: Tue, 28 Jul 1998 08:26:11 +0100 From: Simon Nash Reply-To: nash@hursley.ibm.com Organization: IBM To: "George M. Scott" Cc: java-rtf@omg.org Subject: Re: Conext support in Java References: <35BD32BD.4CD94CF4@inprise.com> George, See my comment below. Simon George M. Scott wrote: > > Below are the proposed spec changes to support Contexts in IDL/Java. > It turns out that some type of API change will be required. As I > was > investigating this further today I realized that one of the methods > on ORB we have to support Context streaming is a proprietary method > and not a standard method, so there is no way to create a Context > object given an InputStream. This makes demarshalling of contexts > impossible in the stream-based model as it exists today. The > proposal > adds one new method each to InputStream and OutputStream. Also, as > requested by Simon I have text which states how the Context > parameters > are used in interface method declarations. > > ============== > Add the following new section to 23.11, > > 23.11.3 Implicit Arguments to Operations > > If an operation in an OMG IDL specification has a context > specification, > then a org.omg.CORBA.Context input parameter (Insert cross-ref to > Context > here) follows all operation-specific arguments. > I don't like the mix of argument/parameter terminology. Could we use "parameter" consistently here? Also, an example of an IDL interface with a context and the Java interface that is generated would be > helpful. > =============== > Add the following method to OutputStream: > > public void write_Context(org.omg.CORBA.Context ctx, > org.omg.CORBA.ContextList contexts) { > throw new org.omg.CORBA.NO_IMPLEMENT(); > } > > The write_Context method writes the specified Context to the stream. > The Context is marshalled as a sequence of strings as specified in > (insert cross-ref to GIOP Context encoding section). The write > method > writes only those Context values specified in the contexts > parameter. > > =============== > Add the following method to InputStream: > > public org.omg.CORBA.Context read_Context() { > throw new org.omg.CORBA.NO_IMPLEMENT(); > } > > The read_Context method reads a Context from the stream. The > context > is read from the stream as a sequence of strings as specified in > (insert > cross-ref to GIOP Context encoding section). > > George -- Simon C Nash, IBM Java Technology Centre, Hursley, UK MailPoint 146, x245156 Tel. 01962 815156 or +44-1962-815156 Internet: nash@hursley.ibm.com Notes mail: Simon Nash@ibmgb Return-Path: Sender: akv@Eng.Sun.COM Date: Tue, 28 Jul 1998 11:19:10 -0700 From: "Anil K. Vijendran" Organization: Sun Microsystems Inc, Java Software Division To: "George M. Scott" CC: java-rtf@omg.org Subject: Re: Conext support in Java References: <35BD32BD.4CD94CF4@inprise.com> George, Is there an example of what the stubs with context support will look like? George M. Scott wrote: > Below are the proposed spec changes to support Contexts in IDL/Java. > It turns out that some type of API change will be required. As I > was > investigating this further today I realized that one of the methods > on ORB we have to support Context streaming is a proprietary method > and not a standard method, so there is no way to create a Context > object given an InputStream. This makes demarshalling of contexts > impossible in the stream-based model as it exists today. The > proposal > adds one new method each to InputStream and OutputStream. Also, as > requested by Simon I have text which states how the Context > parameters > are used in interface method declarations. > > ============== > Add the following new section to 23.11, > > 23.11.3 Implicit Arguments to Operations > > If an operation in an OMG IDL specification has a context > specification, > then a org.omg.CORBA.Context input parameter (Insert cross-ref to > Context > here) follows all operation-specific arguments. > > =============== > Add the following method to OutputStream: > > public void write_Context(org.omg.CORBA.Context ctx, > org.omg.CORBA.ContextList contexts) { > throw new org.omg.CORBA.NO_IMPLEMENT(); > } > > The write_Context method writes the specified Context to the stream. > The Context is marshalled as a sequence of strings as specified in > (insert cross-ref to GIOP Context encoding section). The write > method > writes only those Context values specified in the contexts > parameter. > > =============== > Add the following method to InputStream: > > public org.omg.CORBA.Context read_Context() { > throw new org.omg.CORBA.NO_IMPLEMENT(); > } > > The read_Context method reads a Context from the stream. The > context > is read from the stream as a sequence of strings as specified in > (insert > cross-ref to GIOP Context encoding section). > > George -- Peace, Anil V7n +<:-) Return-Path: Sender: "George Scott" Date: Tue, 28 Jul 1998 19:26:28 -0700 From: "George M. Scott" Organization: Inprise Corporation To: nash@hursley.ibm.com CC: java-rtf@omg.org Subject: Re: Conext support in Java References: <35BD32BD.4CD94CF4@inprise.com> <35BD7D13.CF229E1F@mailserver.hursley.ibm.com> Simon Nash wrote: > > George, > See my comment below. > > Simon > > George M. Scott wrote: > > ============== > > Add the following new section to 23.11, > > > > 23.11.3 Implicit Arguments to Operations > > > > If an operation in an OMG IDL specification has a context > specification, > > then a org.omg.CORBA.Context input parameter (Insert cross-ref to > Context > > here) follows all operation-specific arguments. > > > I don't like the mix of argument/parameter terminology. Could we > use > "parameter" consistently here? Also, an example of an IDL interface > with a context and the Java interface that is generated would be > helpful. That is fine by me. Just to note, that the text I provided was lifted directly from the C++ languge mapping text. Here is a quick example: //IDL interface Bar { void op() context("a", "b"); }; would generate: public interface BarOperations { public void op(org.omg.CORBA.Context _context); }; The marshalling code would something like this: public void op(org.omg.CORBA.Context _context) { org.omg.CORBA.portable.OutputStream _output; org.omg.CORBA.portable.InputStream _input; while(true) { try { _output = this._request("op", true); org.omg.CORBA.ContextList _contexts = _orb().create_context_list(); _contexts.add("a"); _contexts.add("b"); _output.write_Context(_context, _contexts); _input = this._invoke(_output); } catch(ApplicationException e) { throw new org.omg.CORBA.MARSHAL(e.toString()); } catch(RemarshalExcpetion e) { continue; } finally { _releaseReply(_input); } } } George