-
Jun 18th, 2012, 03:18 AM
#1
Intercepting async calls
Hi everyone !
Simple question : I'm using the @Async annotation and I'm wondering if there is an existing interceptor allowing to execute some in-house code :
- (1) just before the async thread is started (we're on the caller thread)
- (2) just after the async thread is started (we're on the called thread)
In (1) I'd like to be able to transmit caller stacktrace to called thread, via a special method parameter
In (2) I'd like to populate current thread local with latter special method parameter values
WDYT ?
-
Jun 18th, 2012, 09:04 AM
#2
From what I've read, AspectJ pointcuts can target specific annotations. I don't think there's any particular reason why you couldn't target @Async; if I were you I would give it a try. Of course with @Before and @AfterReturning you could pass all the parameters you need...for that, just take a look at the specific section in the Spring reference guide.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules