-
1. Re: Weld standalone SE and threads
pieter.martin Jan 22, 2010 6:27 PM (in response to pieter.martin)Ok, I was being an idiot using new Runnable et al. Using Instance..get() makes the injection work.
However I'd still like to know if a ThreadScope is possible?
Thanks
Pieter -
2. Re: Weld standalone SE and threads
pieter.martin Jan 22, 2010 7:07 PM (in response to pieter.martin)I see there is some ThreadScope code in trunk, will have a look at that.
Cheers
Pieter -
3. Re: Weld standalone SE and threads
peteroyle.howardmoon.hitcity.com.au Jan 29, 2010 3:20 AM (in response to pieter.martin)Hi Pieter,
Yes there is support for Threads in SE but it's currently disabled due to a bug with Decorators. I think that bug has been recently closed, so hopefully I will get a chance to activate this ThreadContext support again soon.
Basically it is a decorator which wraps Runnable.run, activating the ThreadContext on a ThreadLocal before the call to run, and deactivating the context afterwards.
There are some example tests in the code which you may have already seen.
You will therefore need to activate the decorator in your beans.xml for it to work. I'll post more when I get it working again, and will hopefully add some documentation as well.
Cheers,
Pete.
-
4. Re: Weld standalone SE and threads
peteroyle.howardmoon.hitcity.com.au Feb 2, 2010 1:41 PM (in response to pieter.martin)Pieter, the ThreadScoped code is now enabled in trunk.
-
5. Re: Weld standalone SE and threads
pieter.martin Feb 3, 2010 3:07 PM (in response to pieter.martin)Thanks, great stuff, will have a look.