Hi,
By looking into the code, I assume this is a missing piece in Tuscany to
track/control the lifecycle of the request scope. Ideally, when a new
request comes into SCA, we create a request scope container and all of the
request-scoped component instances will be associated with the scope
container. Once the request is finished, all the component instances in the
scope container will be notified to perform the @Destroy actions. Please
open a JIRA.
Thanks,
Raymond
--------------------------------------------------
From: "Gilbert Kwan" <[EMAIL PROTECTED]>
Sent: Tuesday, April 22, 2008 8:52 AM
To: <tuscany-dev@ws.apache.org>
Subject: Request scope service works as composite scope service
We created a test to test the "SCA Java Annotations And APIs V1"
specification lines 290 to 293.
"There are times when a local request scoped service is called without
there being a remotable service earlier in the call stack, such as
when a local service is called from a non-SCA entity. In these cases,
a remote request is always considered to be present, but the lifetime
of the request is implementation dependent. For example, a timer event
could be treated as a remote request."
There are 3 components
- JComponent (composite scope)
- KComponent (stateless scope)
- LComponent (request scope)
When the composite runs, composite scope service JComponent kicks off
a timer by the @Init method. The timer triggers JComponent every
second to invoke a method that calls an operation on the reference to
a stateless scope sevice KComponent. KComponent calls a request scope
service LComponent multiple times.
We found that there was only one instance of LComponent be used and
the state was also preserved. Although it was declared as a request
scope service, it worked like as a composite scope service. (See the
attached powerpoint.)
As the spec says, "... the lifetime of the request is implementation
dependent.". Is there a bug?
Thanks
Gilbert