You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2009/03/20 16:37:17 UTC
Re: svn commit: r756264 - in /tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly: builder/impl/ComponentServiceEndpointBuilderImpl.java impl/Endpoint2Impl.java
Hi,
I was trying to make the accessor to Collection properties consistent. In
Tuscany, we only have the getter for a Collection property.
For the issue you pointed out, can we fix it by calling
endpoint.getCallbackEndpointReferences().add...() whenever the
callbackEndpointReferences are created?
Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <si...@googlemail.com>
Sent: Friday, March 20, 2009 6:34 AM
To: <de...@tuscany.apache.org>
Subject: Re: svn commit: r756264 - in
/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly:
builder/impl/ComponentServiceEndpointBuilderImpl.java
impl/Endpoint2Impl.java
> 2009/3/19 <rf...@apache.org>:
>> Author: rfeng
>> Date: Thu Mar 19 23:40:07 2009
>> New Revision: 756264
>>
>> URL: http://svn.apache.org/viewvc?rev=756264&view=rev
>> Log:
>> Fix the NPE when callback is not present
>>
>> Modified:
>>
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceEndpointBuilderImpl.java
>>
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
>>
>> Modified:
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceEndpointBuilderImpl.java
>> URL:
>> http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceEndpointBuilderImpl.java?rev=756264&r1=756263&r2=756264&view=diff
>> ==============================================================================
>> ---
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceEndpointBuilderImpl.java
>> (original)
>> +++
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentServiceEndpointBuilderImpl.java
>> Thu Mar 19 23:40:07 2009
>> @@ -138,7 +138,9 @@
>> endpoint.setComponent(endpointComponent);
>> endpoint.setService(endpointService);
>> endpoint.setBinding(binding);
>> -
>> endpoint.getCallbackEndpointReferences().addAll(callbackEndpointReferences);
>> + if (callbackEndpointReferences != null) {
>> +
>> endpoint.getCallbackEndpointReferences().addAll(callbackEndpointReferences);
>> + }
>> endpoint.setUnresolved(false);
>> service.getEndpoints().add(endpoint);
>> }
>>
>> Modified:
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
>> URL:
>> http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java?rev=756264&r1=756263&r2=756264&view=diff
>> ==============================================================================
>> ---
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
>> (original)
>> +++
>> tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/Endpoint2Impl.java
>> Thu Mar 19 23:40:07 2009
>> @@ -108,15 +108,6 @@
>> return callbackEndpointReferences;
>> }
>>
>> - /**
>> - * Set the reference callback endpoint refefences
>> - *
>> - * @param callbackEndpoint the reference callback endpoint
>> - */
>> - public void setCallbackEndpointReferences(List<EndpointReference2>
>> callbackEndpointReferences)
>> - {
>> - this.callbackEndpointReferences = callbackEndpointReferences;
>> - }
>> /*
>> public String getURI() {
>> return uri;
>>
>>
>>
>
> Hi So this isn't going to do what you expect it to as the callback
> endpoint references won't have been created at the point you are
> trying to copy them into the service. I'll look at moving the loop
> that copies the endpoint references in to after the point that the
> references get created.
>
> Simon
Re: svn commit: r756264 - in /tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly:
builder/impl/ComponentServiceEndpointBuilderImpl.java impl/Endpoint2Impl.java
Posted by Simon Laws <si...@googlemail.com>.
On Fri, Mar 20, 2009 at 3:37 PM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> I was trying to make the accessor to Collection properties consistent. In
> Tuscany, we only have the getter for a Collection property.
>
> For the issue you pointed out, can we fix it by calling
> endpoint.getCallbackEndpointReferences().add...() whenever the
> callbackEndpointReferences are created?
>
> Thanks,
> Raymond
>
Hi Raymond
I agree with having the api consistent. I went in a little earlier and
made the change to delay the assignment until after endpoint reference
creation. So I think we're good now.
Simon