提交 5915b23e 编写于 作者: R Rossen Stoyanchev

Rename method in MessageBrokerConfigurer

上级 930d1877
...@@ -49,7 +49,7 @@ import org.springframework.context.annotation.Import; ...@@ -49,7 +49,7 @@ import org.springframework.context.annotation.Import;
* @Bean * @Bean
* public void configureMessageBroker(MessageBrokerConfigurer configurer) { * public void configureMessageBroker(MessageBrokerConfigurer configurer) {
* configurer.enableStompBrokerRelay("/queue/", "/topic/"); * configurer.enableStompBrokerRelay("/queue/", "/topic/");
* configurer.setAnnotationMethodDestinationPrefixes("/app/"); * configurer.setApplicationDestinationPrefixes("/app/");
* } * }
* } * }
* </pre> * </pre>
......
...@@ -37,7 +37,7 @@ public class MessageBrokerConfigurer { ...@@ -37,7 +37,7 @@ public class MessageBrokerConfigurer {
private StompBrokerRelayRegistration stompRelay; private StompBrokerRelayRegistration stompRelay;
private String[] annotationMethodDestinationPrefixes; private String[] applicationDestinationPrefixes;
private String userDestinationPrefix; private String userDestinationPrefix;
...@@ -67,10 +67,10 @@ public class MessageBrokerConfigurer { ...@@ -67,10 +67,10 @@ public class MessageBrokerConfigurer {
} }
/** /**
* Configure one or more prefixes to filter destinations targeting annotated * Configure one or more prefixes to filter destinations targeting application
* application methods. For example destinations prefixed with "/app" may be processed * annotated methods. For example destinations prefixed with "/app" may be
* by annotated application methods while other destinations may target the message * processed by annotated methods while other destinations may target the
* broker (e.g. "/topic", "/queue"). * message broker (e.g. "/topic", "/queue").
* <p> * <p>
* When messages are processed, the matching prefix is removed from the destination in * When messages are processed, the matching prefix is removed from the destination in
* order to form the lookup path. This means annotations should not contain the * order to form the lookup path. This means annotations should not contain the
...@@ -78,8 +78,8 @@ public class MessageBrokerConfigurer { ...@@ -78,8 +78,8 @@ public class MessageBrokerConfigurer {
* <p> * <p>
* Prefixes that do not have a trailing slash will have one automatically appended. * Prefixes that do not have a trailing slash will have one automatically appended.
*/ */
public MessageBrokerConfigurer setAnnotationMethodDestinationPrefixes(String... destinationPrefixes) { public MessageBrokerConfigurer setApplicationDestinationPrefixes(String... prefixes) {
this.annotationMethodDestinationPrefixes = destinationPrefixes; this.applicationDestinationPrefixes = prefixes;
return this; return this;
} }
...@@ -118,9 +118,9 @@ public class MessageBrokerConfigurer { ...@@ -118,9 +118,9 @@ public class MessageBrokerConfigurer {
return (this.stompRelay != null) ? this.stompRelay.getMessageHandler() : null; return (this.stompRelay != null) ? this.stompRelay.getMessageHandler() : null;
} }
protected Collection<String> getAnnotationMethodDestinationPrefixes() { protected Collection<String> getApplicationDestinationPrefixes() {
return (this.annotationMethodDestinationPrefixes != null) return (this.applicationDestinationPrefixes != null)
? Arrays.asList(this.annotationMethodDestinationPrefixes) : null; ? Arrays.asList(this.applicationDestinationPrefixes) : null;
} }
protected String getUserDestinationPrefix() { protected String getUserDestinationPrefix() {
......
...@@ -136,7 +136,7 @@ public abstract class WebSocketMessageBrokerConfigurationSupport { ...@@ -136,7 +136,7 @@ public abstract class WebSocketMessageBrokerConfigurationSupport {
SimpAnnotationMethodMessageHandler handler = SimpAnnotationMethodMessageHandler handler =
new SimpAnnotationMethodMessageHandler(brokerMessagingTemplate(), webSocketResponseChannel()); new SimpAnnotationMethodMessageHandler(brokerMessagingTemplate(), webSocketResponseChannel());
handler.setDestinationPrefixes(getMessageBrokerConfigurer().getAnnotationMethodDestinationPrefixes()); handler.setDestinationPrefixes(getMessageBrokerConfigurer().getApplicationDestinationPrefixes());
handler.setMessageConverter(simpMessageConverter()); handler.setMessageConverter(simpMessageConverter());
webSocketRequestChannel().subscribe(handler); webSocketRequestChannel().subscribe(handler);
return handler; return handler;
......
...@@ -217,7 +217,7 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg ...@@ -217,7 +217,7 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg
@Override @Override
public void configureMessageBroker(MessageBrokerConfigurer configurer) { public void configureMessageBroker(MessageBrokerConfigurer configurer) {
configurer.setAnnotationMethodDestinationPrefixes("/app"); configurer.setApplicationDestinationPrefixes("/app");
configurer.enableSimpleBroker("/topic", "/queue"); configurer.enableSimpleBroker("/topic", "/queue");
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册