[ 
https://issues.apache.org/jira/browse/TUSCANY-2524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620035#action_12620035
 ] 

Lou Amodeo commented on TUSCANY-2524:
-------------------------------------

I did some additional investigation and I see what causes this problem and I am 
not sure what to make of it now.  I had a SCDL with the 2 references shown 
below but my client implementatoin has only has 1 @Reference.   When I added 
the 2nd @Reference the 2nd callback service was then activated and the callback 
ran successfully.  This implies that the callback services will only function 
(be activated?) if reference injection is employed?   Does this make sense?     


client impl: 

package helloworld;

import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
import org.osoa.sca.annotations.Service;

/**
 * This client component 
 */
@Scope("COMPOSITE")
@Service(HelloWorldLocal.class)
public class HelloWorldServiceComponent implements HelloWorldLocal, 
HelloWorldCallback {
   
    private String msg = "callback failed";
    private HelloWorldService helloWorldService;
    private HelloWorldService helloWorldService2;


    public HelloWorldService getHelloWorldService() {
        return helloWorldService;
    }

    @Reference
    public void setHelloWorldService(HelloWorldService helloWorldService) {
        this.helloWorldService = helloWorldService;
    }

     @Reference
    public void setHelloWorldService2(HelloWorldService helloWorldService2) {
        this.helloWorldService2 = helloWorldService2;
    }


    public void getHello(String name) {
        helloWorldService.getGreetings(name);
        helloWorldService2.getGreetings(name + "2");
    }

    public void getGreetingsCallback(String getGreetingsReturn) {
        System.out.println("Callback: " + getGreetingsReturn);
        msg = "Callback: " + getGreetingsReturn;
    }
   
    public String getmsg() {
        return msg;
    }
    
}
 

Result:  

Callback: Hola World Sam2 


> Callback service not being activated for binding.ws with multiple references
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-2524
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2524
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Assembly Model
>    Affects Versions: Java-SCA-1.3
>            Reporter: Lou Amodeo
>
> I am seeing an issue where callback services are not being properly 
> activated.  My scenario has 2 referernces to the same service that implement 
> a callback.  What I am seeing is the 1st referecne has a service created and 
> activated,  the 2nd reference has a service created but not activated.  I see 
> this code in CompositeActivatorImpl that skips over the activation: 
> public void activate(RuntimeComponent component, RuntimeComponentService 
> service) {
>         if (service.getService() == null) {
>             if (logger.isLoggable(Level.WARNING)) {
>                 logger.warning("Skipping component service not defined in the 
> component type: " + component.getURI()
>                     + "#"
>                     + service.getName());
>             }
>             return;
> The 2nd reference does not have a callback service active.....  
> SCDL: 
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
>            targetNamespace="http://helloworld";
>            name="helloworldwsclient">
>     <component name="HelloWorldClientComponent">
>       <implementation.java class="helloworld.HelloWorldServiceComponent"/>   
>   
>       <reference name="helloWorldService">
>           <interface.java interface="helloworld.HelloWorldService"
>                 callbackInterface="helloworld.HelloWorldCallback"/>  
>           <binding.ws 
> wsdlElement="http://soa/sca/hello-ws-async#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
>           <callback>
>             <binding.ws 
> wsdlElement="http://soa/sca/hello-ws-async#wsdl.binding(HelloWorldCallbackSoapBinding)"/>
>           </callback> 
>       </reference>
>       <reference name="helloWorldService2">
>           <interface.java interface="helloworld.HelloWorldService"
>                 callbackInterface="helloworld.HelloWorldCallback"/>  
>           <binding.ws 
> wsdlElement="http://soa/sca/hello-ws-async#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
>           <callback>
>             <binding.ws 
> wsdlElement="http://soa/sca/hello-ws-async#wsdl.binding(HelloWorldCallbackSoapBinding)"/>
>           </callback> 
>       </reference>
>     </component>
> </composite>

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

Reply via email to