jeudi 9 avril 2015

java.lang.reflect.Method.invoke and Spring @Async

I have a scenario where a method needs to be invoked if it has a particular annotation. The method also needs to run in a separate thread so I used @Async, however, it is not run concurrently.


if java.lang.reflect.Method.invoke is not used and good old Object.methodName() is used, the method does run asynchronously.


Is there a limitation in such a scenario? I'm using JDK 1.7 and Spring 4.x.


Aucun commentaire:

Enregistrer un commentaire