Hi,
On Fri, Jan 16, 2015 at 10:47 PM, Bill Shannon <bill.shannon_at_oracle.com> wrote:
> arjan tijms wrote on 01/16/15 09:46:
> Yes, interesting. Thanks for trying it out! It seems that we're
> pretty close to being able to do this!
You're welcome. It's indeed pretty close for the case of just calling
a method asynchronously.
A somewhat more faithful clone of @Asyncronous would additionally need
to have (a new) request scope activated as well, but for the basics
this is pretty close.
>> If you clone the InvocationContext and pass the clone to the async work,
> does that work? Although it's not clear the spec requires that that *should*
> work, so something like you suggest above may still be necessary.
Funny that you mention that as I just wanted to try that ;) But if
that would work at all, then I guess it's still by chance as I
wouldn't know in advance what things from the original context a
shallow clone would still reference. From the top of my head, I think
Weld indeed has the interceptor counter stored in another object
referenced from the InvocationContext.
Kind regards,
Arjan