Polishing

This commit is contained in:
Juergen Hoeller 2018-08-16 13:02:27 +02:00
parent 5d7fb1a1c2
commit dc55da0988
2 changed files with 13 additions and 10 deletions

View File

@ -44,12 +44,13 @@ import org.springframework.util.Assert;
* lifecycle of the listener containers, in particular within the lifecycle
* of the application context.
*
* <p>Contrary to {@link MessageListenerContainer MessageListenerContainers} created manually, listener
* containers managed by registry are not beans in the application context and
* are not candidates for autowiring. Use {@link #getListenerContainers()} if
* you need to access this registry's listener containers for management purposes.
* If you need to access to a specific message listener container, use
* {@link #getListenerContainer(String)} with the id of the endpoint.
* <p>Contrary to {@link MessageListenerContainer MessageListenerContainers}
* created manually, listener containers managed by registry are not beans
* in the application context and are not candidates for autowiring.
* Use {@link #getListenerContainers()} if you need to access this registry's
* listener containers for management purposes. If you need to access to a
* specific message listener container, use {@link #getListenerContainer(String)}
* with the id of the endpoint.
*
* @author Stephane Nicoll
* @author Juergen Hoeller

View File

@ -251,7 +251,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
/**
* Configure a {@link MessageHeaderInitializer} to pass on to
* {@link org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandlers}
* {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers}
* that send messages from controller return values.
* <p>By default, this property is not set.
*/
@ -332,7 +332,8 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
// Annotation-based return value types
SendToMethodReturnValueHandler sendToHandler = new SendToMethodReturnValueHandler(this.brokerTemplate, true);
SendToMethodReturnValueHandler sendToHandler =
new SendToMethodReturnValueHandler(this.brokerTemplate, true);
sendToHandler.setHeaderInitializer(this.headerInitializer);
handlers.add(sendToHandler);
@ -341,10 +342,11 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
subscriptionHandler.setHeaderInitializer(this.headerInitializer);
handlers.add(subscriptionHandler);
// custom return value types
// Custom return value types
handlers.addAll(getCustomReturnValueHandlers());
// catch-all
// Catch-all
sendToHandler = new SendToMethodReturnValueHandler(this.brokerTemplate, false);
sendToHandler.setHeaderInitializer(this.headerInitializer);