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

Raymond Feng commented on TUSCANY-1860:
---------------------------------------

Hi, I checked in the itest under r586542. Thank you, Mark.

> Tuscany does not support performing call backs using a separate thread to the 
> original invoking thread
> ------------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1860
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1860
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-1.0
>         Environment: SVN Head revision #586349
> Linux
>            Reporter: Mark Combellack
>             Fix For: Java-SCA-Next
>
>         Attachments: CallbackInSeparateThreadITest.patch
>
>
> The current implementation of Tuscany does not allow a Component 
> implementation to invoke the call back using a separate thread.
> Consider the scenario:
>     1) Client invokes a method on a Service.
>     2) The Service obtains the CallableReference of the client using @Callback
>     3) The Service spawns a new thread and passes the CallableReference to 
> the thread
>     4) The original calling thread from the client returns
> Meanwhile - the newly spawned thread:
>     5) Does some stuff
>     6) Invokes the getService() on the CallableReference to get a proxy to 
> the client
>     7) Invokes the callback method on the proxy to the client
>     8) The client will have it's  callback method invoked
>     9) The separate thread ends as it's job is done.
>  
> The problem is with the way that Tuscany uses ThreadLocal to store the 
> callback location. The newly spawned thread will not have the callback 
> location attached to it's ThreadLocal.
> The above scenario will fail at step 7 with the following exception:
> Exception in thread "Timer-0" org.osoa.sca.ServiceRuntimeException: No 
> callback wire found for /
>       at 
> org.apache.tuscany.sca.core.invocation.JDKCallbackInvocationHandler.invoke(JDKCallbackInvocationHandler.java:63)
>       at $Proxy12.eventNotification(Unknown Source)
>       at 
> org.apache.tuscany.sca.itest.EventProcessorServiceImpl.receiveEvent(EventProcessorServiceImpl.java:114)
>       at 
> org.apache.tuscany.sca.itest.EventProcessorServiceImpl.access$0(EventProcessorServiceImpl.java:102)
>       at 
> org.apache.tuscany.sca.itest.EventProcessorServiceImpl$EventGenerator$EventGeneratorTimerTask.run(EventProcessorServiceImpl.java:193)
>       at java.util.TimerThread.mainLoop(Timer.java:512)
>       at java.util.TimerThread.run(Timer.java:462)

-- 
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