You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Yang Lei (JIRA)" <tu...@ws.apache.org> on 2007/08/29 22:06:30 UTC

[jira] Created: (TUSCANY-1636) There should not be an SCABinding created under reference if there is no target on the reference 558780

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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1636) There should not be an SCABinding created under reference if there is no target on the reference 558780

Posted by "Jean-Sebastien Delfino (JIRA)" <tu...@ws.apache.org>.
    [ 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1636) There should not be an SCABinding created under reference if there is no target on the reference 558780

Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523669 ] 

Raymond Feng commented on TUSCANY-1636:
---------------------------------------

Adding a SCABinding if there is no explicit bindings conforms to the SCA assembly spec.  There might be different cases where the target is not present, for exaample, the multiplicity is 0..1 or 0..N, or wiredByImpl = true. 

I agree we need to have a better exception than NPE, but removing the SCA binding maybe is not the correct fix :-). 

> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1636) There should not be an SCABinding created under reference if there is no target on the reference 558780

Posted by "Yang Lei (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524781 ] 

Yang Lei commented on TUSCANY-1636:
-----------------------------------

As this SCABinding is created for a component reference by Tuscany, the bindingProvider is invoked always. Even if SCABinding provider can implement by checking if there is target or not and return null object, Tuscany will use the result of the bindingProvider invoke to inject a value to the component's reference.  I thought the correct logic is , if we do not declare a component reference, the component's implementation should be able to keep the default value in the component implementation for that reference, instead of getting the value override with a null object.

> 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
>             Fix For: Java-SCA-Next
>
>
> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org