You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Mike Edwards <mi...@gmail.com> on 2011/07/13 15:44:08 UTC

[2.x] Problems and Proposed changes for the OASIS Java Client API

Folks,

I understand that there are some problems with the standard OASIS Java Client API that are affecting 
Tuscany.

I'd be grateful if people who know about these problems could list the problems and the proposed 
fixes - there is a short window of opportunity to get the OASIS code updated, if the problems and 
the fixes can be fully described.


Yours,  Mike.

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API - OASIS Issue raised, with Proposal

Posted by Mike Edwards <mi...@gmail.com>.
Folks,

An OASIS Java TC issue has been raised for these problems:

http://www.osoa.org/jira/browse/JAVA-243

along with the proposed updates, which can be seen in Section B.1.3 of this updated spec:


http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42910/sca-javacaa-1.1-spec-wd052.pdf
http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42909/sca-javacaa-1.1-spec-wd052.doc


Yours,  Mike.

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API - OASIS Issue raised, with Proposal

Posted by Mike Edwards <mi...@gmail.com>.
On 20/07/2011 10:37, ant elder wrote:
> I think that one didn't make it in time to be considered.
>
> Now that the OASIS code was changed to pass the
> SCAClientFactory.newInstance properties on to the impl we might be
> able to add a Tuscany specific property to support that. Eg something
> like:
>
> Properties p = new Properties();
> p.addProperty("allowsPassByReference", "true");
> SCAClientFactory.newInstance(p, domainURI).getService(...);
>
>     ...ant
>
Ant,

Good suggestion.  I much prefer this compared with another change to the API.

This approach would permit other kinds of settings if the client implementation code wishes.

I note that the runtime (and hence also the client implementation) does not have to implement 
allowsPassByReference and can validly always treat everything as if remotable and hence using pass 
by value semantics.  Hence not interpreting that property value is perfectly valid for other runtimes.


Yours,  Mike.

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API - OASIS Issue raised, with Proposal

Posted by ant elder <an...@gmail.com>.
I think that one didn't make it in time to be considered.

Now that the OASIS code was changed to pass the
SCAClientFactory.newInstance properties on to the impl we might be
able to add a Tuscany specific property to support that. Eg something
like:

Properties p = new Properties();
p.addProperty("allowsPassByReference", "true");
SCAClientFactory.newInstance(p, domainURI).getService(...);

   ...ant

On Mon, Jul 18, 2011 at 5:07 PM, Raymond Feng <en...@gmail.com> wrote:
> Mike, can I raise another issue?
> For the following API:
> org.oasisopen.sca.client.SCAClientFactory.getService(Class<T>, String)
> Can we add an option for "allowsPassByReference"? The latest SCA spec
> requires that both reference and service impl to allow pass-by-reference to
> avoid copying data over remotable interfaces. Without an option for the
> client API, we always need to pay the penalty.
> Thanks,
> Raymond
> ________________________________________________________________
> Raymond Feng
> rfeng@apache.org
> Apache Tuscany PMC member and committer: tuscany.apache.org
> Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
> Personal Web Site: www.enjoyjava.com
> ________________________________________________________________
> On Jul 18, 2011, at 3:55 AM, Mike Edwards wrote:
>
> Folks,
>
> An OASIS Java TC issue has been raised for these problems:
>
> http://www.osoa.org/jira/browse/JAVA-243
>
> along with the proposed updates, which can be seen in Section B.1.3 of this
> updated spec:
>
>
> http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42910/sca-javacaa-1.1-spec-wd052.pdf
> http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42909/sca-javacaa-1.1-spec-wd052.doc
>
>
> Yours,  Mike.
>
>

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API - OASIS Issue raised, with Proposal

Posted by Raymond Feng <en...@gmail.com>.
Mike, can I raise another issue?

For the following API:

org.oasisopen.sca.client.SCAClientFactory.getService(Class<T>, String)

Can we add an option for "allowsPassByReference"? The latest SCA spec requires that both reference and service impl to allow pass-by-reference to avoid copying data over remotable interfaces. Without an option for the client API, we always need to pay the penalty.

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Jul 18, 2011, at 3:55 AM, Mike Edwards wrote:

> Folks,
> 
> An OASIS Java TC issue has been raised for these problems:
> 
> http://www.osoa.org/jira/browse/JAVA-243
> 
> along with the proposed updates, which can be seen in Section B.1.3 of this updated spec:
> 
> 
> http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42910/sca-javacaa-1.1-spec-wd052.pdf
> http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42909/sca-javacaa-1.1-spec-wd052.doc
> 
> 
> Yours,  Mike.


Re: [2.x] Problems and Proposed changes for the OASIS Java Client API - OASIS Issue raised, with Proposal

Posted by Mike Edwards <mi...@gmail.com>.
Folks,

An OASIS Java TC issue has been raised for these problems:

http://www.osoa.org/jira/browse/JAVA-243

along with the proposed updates, which can be seen in Section B.1.3 of this updated spec:


http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42910/sca-javacaa-1.1-spec-wd052.pdf
http://www.oasis-open.org/apps/org/workgroup/sca-j/download.php/42909/sca-javacaa-1.1-spec-wd052.doc


Yours,  Mike.

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API

Posted by ant elder <an...@gmail.com>.
On Wed, Jul 13, 2011 at 3:01 PM, Simon Laws <si...@googlemail.com> wrote:
> On Wed, Jul 13, 2011 at 2:44 PM, Mike Edwards
> <mi...@gmail.com> wrote:
>> Folks,
>>
>> I understand that there are some problems with the standard OASIS Java
>> Client API that are affecting Tuscany.
>>
>> I'd be grateful if people who know about these problems could list the
>> problems and the proposed fixes - there is a short window of opportunity to
>> get the OASIS code updated, if the problems and the fixes can be fully
>> described.
>>
>>
>> Yours,  Mike.
>>
>
> The changes we currently have are.
>
> 1/ Put a doPrivileged around the call to get TCCL
>
> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java?r1=1145485&r2=1145484&pathrev=1145485
>
> 2/ Allow for null domain name
>
> http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java?r1=1140682&r2=1140681&pathrev=1140682
>

The reason for using null in the domain URI is an attempt to get a
"default" domain, I'm not totally sure how much sense that really
makes so an alternative could be for the spec group could comment on
the default domain concept and maybe instead just documenting that it
shouldn't be null or even changing the SCAClientFactory.newInstance to
validate its not null.


> I also note that Ant raised a comment on the OASIS list but it never
> made it as far as a registered issue.
>
> http://markmail.org/message/scgm4ygpkmo6bxbv#query:+page:1+mid:scgm4ygpkmo6bxbv+state:results
>

A diff for a change to implement that is:

Index: src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
===================================================================
--- src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
(revision 1146630)
+++ src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java
(working copy)
@@ -79,7 +79,7 @@
                                                           classLoader);
                final SCAClientFactory factory =
                        instantiateSCAClientFactoryClass(factoryImplClass,
-                                                                  domainURI );
+
domainURI, properties );
                return factory;
        }

@@ -258,14 +258,14 @@
      */
     private static SCAClientFactory instantiateSCAClientFactoryClass(
                        Class<? extends SCAClientFactory> factoryImplClass,
-                       URI domainURI)
+                       URI domainURI, Properties properties)
         throws NoSuchDomainException, ServiceRuntimeException {

         try {
             Constructor<? extends SCAClientFactory> URIConstructor =
-               factoryImplClass.getConstructor(URI.class);
+               factoryImplClass.getConstructor(URI.class, Properties.class);
             SCAClientFactory provider =
-               URIConstructor.newInstance( domainURI );
+               URIConstructor.newInstance( domainURI, properties );
             return provider;
         } catch (Throwable ex) {
             throw new ServiceRuntimeException(

Re: [2.x] Problems and Proposed changes for the OASIS Java Client API

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Jul 13, 2011 at 2:44 PM, Mike Edwards
<mi...@gmail.com> wrote:
> Folks,
>
> I understand that there are some problems with the standard OASIS Java
> Client API that are affecting Tuscany.
>
> I'd be grateful if people who know about these problems could list the
> problems and the proposed fixes - there is a short window of opportunity to
> get the OASIS code updated, if the problems and the fixes can be fully
> described.
>
>
> Yours,  Mike.
>

The changes we currently have are.

1/ Put a doPrivileged around the call to get TCCL

http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java?r1=1145485&r2=1145484&pathrev=1145485

2/ Allow for null domain name

http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/sca-api/src/main/java/org/oasisopen/sca/client/impl/SCAClientFactoryFinderImpl.java?r1=1140682&r2=1140681&pathrev=1140682

I also note that Ant raised a comment on the OASIS list but it never
made it as far as a registered issue.

http://markmail.org/message/scgm4ygpkmo6bxbv#query:+page:1+mid:scgm4ygpkmo6bxbv+state:results

Simon


-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com