You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by "Hatfield, Dan" <da...@hp.com> on 2010/02/01 22:42:52 UTC

RE: Callbacks

Hi Ivan,
I've just started looking at this type of scenario as well.
Did you see this email thread?

http://www.mail-archive.com/dev@tuscany.apache.org/msg10983.html

Seems to confirm your findings. Although I don't see anything about STATELESS being disallowed.

 

-----Original Message-----
From: keinmensch [mailto:keinmensch@mailhaven.com] 
Sent: Saturday, January 30, 2010 11:05 PM
To: user@tuscany.apache.org
Subject: Callbacks

Hi!
I continue with my explorations of Tuscany 2.0 and SCA 1.1 and have come
to callbacks.
Having written a small example program, I run into the following
peculiarities:

- If the service and callback interfaces are not annotated with
@Remotable, Tuscany complains about interfaces being incompatible and
the program fails to execute. If the service and callback interfaces are
annotated with @Remotable, the problem goes away.
As far as I understand, this is the TUSCANY-3251 bug.

- I have a BulkChecksumService that asynchronously calls a
ChecksumService, which in turn is to callback the BulkChecksumService to
deliver the result of computations.
The ChecksumService is called multiple times from one and the same
BulkChecksumService instance.
If the BulkChecksumService is scoped STATELESS, then for each call, even
the callback calls, a new instance of the BulkChecksumService is created.
This causes a slight problem, since I was expecting the callback to be
done on the instance of BulkChecksumService from which the invocation of
ChecksumService originated, so that results received could be
accumulated in an array and, when having checksummed all items, return
the results (synchronously) to the client.
I read on the developer's mailing list that the SCA specification
disallows using the STATELESS scope with callbacks - is this an example
of when this applies?
I haven't been able to find this in the SCA 1.1 specifications and if
this construct is indeed disallowed, could someone point me to the place
in the SCA 1.1 specifications that states this?

Finally, I want to mention that I have only tried to use the SCA binding
in my example program and that both components are running in the same JVM.
Best wishes!
 Ivan

Re: Callbacks

Posted by keinmensch <ke...@mailhaven.com>.
Hatfield, Dan wrote:
> Hi Ivan,
> I've just started looking at this type of scenario as well.
> Did you see this email thread?
>
> http://www.mail-archive.com/dev@tuscany.apache.org/msg10983.html
>
> Seems to confirm your findings. Although I don't see anything about STATELESS being disallowed.
Thanks a lot for the link!
After having looked at it, I found section 7.2.2 in Service Component
Architecture SCA-J Common Annotations and APIs Specification Version
1.1, which confirms the behaviour I have been seeing:
"If the client implementation has STATELESS scope, the callback is
dispatched using a newly initialized instance."
So, using a STATELESS client is allowed, but it will never be called back.

I am going to look more closely at how to solve my problem once I have
finished the simpler callback examples I am playing with.
Best wishes!
 Ivan