BleacherSeat (4) [Avatar] Offline
#1
I am using wormhole pattern pointcut in my system where I want to advise all the calls to log.debug() in a particulat execution path. However somewhere along the line in that particulat execution path, new threads are started and they do rest of the procresssing for a request. My aspect works fine till the point those new threads are started , whic is expected. How can I extend my aspect to include any threads that are started in an execution flow? Any advice is greatly appreciated.

Thanks
ramnivas (171) [Avatar] Offline
#2
Re: AspectJ and Threads
As you noted, wormhole doesn't extend new threads. A simple solution could be to use InheritableThreadLocal to set a boolean (or any other state) at the start of your execution path. Then in the advice that logs the calls, check for that state to decide if you should invoke log.debug().

-Ramnivas