Support SendTo at class-level
Issue: SPR-13578
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -157,7 +157,7 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint {
|
||||
*/
|
||||
protected String getDefaultResponseDestination() {
|
||||
Method specificMethod = getMostSpecificMethod();
|
||||
SendTo ann = AnnotationUtils.getAnnotation(specificMethod, SendTo.class);
|
||||
SendTo ann = getSendTo(specificMethod);
|
||||
if (ann != null) {
|
||||
Object[] destinations = ann.value();
|
||||
if (destinations.length != 1) {
|
||||
@@ -169,6 +169,16 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint {
|
||||
return null;
|
||||
}
|
||||
|
||||
private SendTo getSendTo(Method specificMethod) {
|
||||
SendTo ann = AnnotationUtils.getAnnotation(specificMethod, SendTo.class);
|
||||
if (ann != null) {
|
||||
return ann;
|
||||
}
|
||||
else {
|
||||
return AnnotationUtils.getAnnotation(specificMethod.getDeclaringClass(), SendTo.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the specified value if possible.
|
||||
* @see ConfigurableBeanFactory#resolveEmbeddedValue
|
||||
|
||||
Reference in New Issue
Block a user