[ 
https://issues.apache.org/jira/browse/TUSCANY-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524179
 ] 

Jean-Sebastien Delfino commented on TUSCANY-1636:
-------------------------------------------------

Raymond is correct, it is valid to have a binding with no target, as 
implementations should be able to wire the reference later, dynamically (this 
is not exposed by the Java SCA API at this point but is allowed by the SCA BPEL 
programming model for example).

Can the SCA binding code just test for a null URI?

Also, what did u mean by "there is a null object set to the reference, which 
will override existing reference value in the component"?

> There should not be an SCABinding created under reference if there is no 
> target on the reference 558780
> -------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1636
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1636
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Assembly Model
>            Reporter: Yang Lei
>
> In CompositeBuilderImpl, we create defeault SCABinding where there is no 
> binding defined under reference. This will break the SCABinding handling if 
> the reference does not have a target, then SCABinding willl still get 
> executed so either there is a NPE as we are not expecting target is not 
> there, or there is a null object set to the reference, which will override 
> existing reference value in the component. 
> I did the following to remove the SCABinding at the end of the 
> CompositeBuilderImpl.connectComponentReferences, the else block
>             if (!targets.isEmpty()) {
>                       ....
>             }else
>             {
>                 // need to remove the SCABinding we created that did not have 
> target
>                 if (componentReference.getBindings().size()==1)
>                 {
>                     SCABinding binding = 
> componentReference.getBinding(SCABinding.class);
>                     if (binding!=null && binding.getURI()==null)
>                     {
>                         componentReference.getBindings().clear();
>                     }
>                 }
>             }
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to