You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Dan Becker <da...@gmail.com> on 2008/07/10 22:20:23 UTC

Question on Atom bindings (and SCA references in general)

This a question on the Atom binding implementation in 
java/sca/modules/binding-atom-abdera, but the answer might also be 
interesting to general SCA users as well.

There is an SCA Consumer.composite that has this SCA component and 
binding mentioned in it:
     <component name="CustomerClient">
         <implementation.java 
class="org.apache.tuscany.sca.binding.atom.CustomerClientImpl"/>
         <reference name="resourceCollection">
         	<tuscany:binding.atom uri="http://localhost:8084/customer"/>
         </reference>
     </component>

If I look into the CustomerClientImpl class, I see a reference to a 
number of resources exposed as a Collection (this is an atom.collection, 
not to be confused with a java.util.Collection) as such:
    public class CustomerClientImpl implements CustomerClient {
        @Reference
        public Collection resourceCollection;
        ...
    }

Can someone explain to be the accessibility of this implementation 
field? Even if I expose this in the CustomerClient interface (e.g. 
public Collection getCollection() ), I find that clients cannot access 
this collection and use the Collection methods (get, put, post, delete, 
...). I see this type of exception:
    org.osoa.sca.ServiceRuntimeException: java.net.ConnectException: 
Connection refused: connect
         at 
org.apache.tuscany.sca.binding.atom.provider.AtomBindingInvoker$PostInvoker.invoke(AtomBindingInvoker.java:207)
         at 
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)

Is there a limit to the visibility/usability fields of a binding? Or is 
there another way to access this field from a client? Hints are appreciated.

-- 
Thanks, Dan Becker

Re: Question on Atom bindings (and SCA references in general)

Posted by Dan Becker <da...@gmail.com>.
Raymond Feng wrote:
> Do you already have a service running with binding.atom at 
> http://localhost:8084/customer?
> 
> Your client is trying to connect to this address using the ATOM over HTTP.
> 

Ahhh, there you go. Must get the service on the other end of the wire!

-- 
Thanks, Dan Becker

Re: Question on Atom bindings (and SCA references in general)

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Do you already have a service running with binding.atom at 
http://localhost:8084/customer?

Your client is trying to connect to this address using the ATOM over HTTP.

Thanks,
Raymond
--------------------------------------------------
From: "Dan Becker" <da...@gmail.com>
Sent: Thursday, July 10, 2008 1:20 PM
To: <de...@tuscany.apache.org>
Subject: Question on Atom bindings (and SCA references in general)

> This a question on the Atom binding implementation in 
> java/sca/modules/binding-atom-abdera, but the answer might also be 
> interesting to general SCA users as well.
>
> There is an SCA Consumer.composite that has this SCA component and binding 
> mentioned in it:
>     <component name="CustomerClient">
>         <implementation.java 
> class="org.apache.tuscany.sca.binding.atom.CustomerClientImpl"/>
>         <reference name="resourceCollection">
>         <tuscany:binding.atom uri="http://localhost:8084/customer"/>
>         </reference>
>     </component>
>
> If I look into the CustomerClientImpl class, I see a reference to a number 
> of resources exposed as a Collection (this is an atom.collection, not to 
> be confused with a java.util.Collection) as such:
>    public class CustomerClientImpl implements CustomerClient {
>        @Reference
>        public Collection resourceCollection;
>        ...
>    }
>
> Can someone explain to be the accessibility of this implementation field? 
> Even if I expose this in the CustomerClient interface (e.g. public 
> Collection getCollection() ), I find that clients cannot access this 
> collection and use the Collection methods (get, put, post, delete, ...). I 
> see this type of exception:
>    org.osoa.sca.ServiceRuntimeException: java.net.ConnectException: 
> Connection refused: connect
>         at 
> org.apache.tuscany.sca.binding.atom.provider.AtomBindingInvoker$PostInvoker.invoke(AtomBindingInvoker.java:207)
>         at 
> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>
> Is there a limit to the visibility/usability fields of a binding? Or is 
> there another way to access this field from a client? Hints are 
> appreciated.
>
> -- 
> Thanks, Dan Becker