INT-1431, added SimpleMessageProducingHandlerMonitor to maintain semantics of some MessageHandlers also being MessageProducers

This commit is contained in:
Oleg Zhurakousky
2010-09-15 13:50:16 -04:00
parent d99739a6bf
commit b2533c0788
6 changed files with 144 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ public class MessagePublishingInterceptor implements MethodInterceptor {
final StandardEvaluationContext context = new StandardEvaluationContext();
context.addPropertyAccessor(new MapAccessor());
Class<?> targetClass = AopUtils.getTargetClass(invocation.getThis());
Method method = AopUtils.getMostSpecificMethod(invocation.getMethod(), targetClass);
final Method method = AopUtils.getMostSpecificMethod(invocation.getMethod(), targetClass);
String[] argumentNames = this.resolveArgumentNames(method);
context.setVariable(PublisherMetadataSource.METHOD_NAME_VARIABLE_NAME, method.getName());
if (invocation.getArguments().length > 0 && argumentNames != null) {
@@ -114,6 +114,16 @@ public class MessagePublishingInterceptor implements MethodInterceptor {
}
finally {
publishMessage(method, context);
// Thread t = new Thread(new Runnable() {
// public void run() {
// try {
// publishMessage(method, context);
// } catch (Exception e) {
// e.printStackTrace(); }
//
// }
// });
// t.start();
}
}