|
|
|
@ -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"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -142,7 +142,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A hook for sub-classes to customize the message channel for inbound messages |
|
|
|
* A hook for subclasses to customize the message channel for inbound messages |
|
|
|
* from WebSocket clients. |
|
|
|
* from WebSocket clients. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void configureClientInboundChannel(ChannelRegistration registration) { |
|
|
|
protected void configureClientInboundChannel(ChannelRegistration registration) { |
|
|
|
@ -175,7 +175,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A hook for sub-classes to customize the message channel for messages from |
|
|
|
* A hook for subclasses to customize the message channel for messages from |
|
|
|
* the application or message broker to WebSocket clients. |
|
|
|
* the application or message broker to WebSocket clients. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void configureClientOutboundChannel(ChannelRegistration registration) { |
|
|
|
protected void configureClientOutboundChannel(ChannelRegistration registration) { |
|
|
|
@ -223,7 +223,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A hook for sub-classes to customize message broker configuration through the |
|
|
|
* A hook for subclasses to customize message broker configuration through the |
|
|
|
* provided {@link MessageBrokerRegistry} instance. |
|
|
|
* provided {@link MessageBrokerRegistry} instance. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void configureMessageBroker(MessageBrokerRegistry registry) { |
|
|
|
protected void configureMessageBroker(MessageBrokerRegistry registry) { |
|
|
|
@ -252,7 +252,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
addReturnValueHandlers(returnValueHandlers); |
|
|
|
addReturnValueHandlers(returnValueHandlers); |
|
|
|
handler.setCustomReturnValueHandlers(returnValueHandlers); |
|
|
|
handler.setCustomReturnValueHandlers(returnValueHandlers); |
|
|
|
|
|
|
|
|
|
|
|
PathMatcher pathMatcher = this.getBrokerRegistry().getPathMatcher(); |
|
|
|
PathMatcher pathMatcher = getBrokerRegistry().getPathMatcher(); |
|
|
|
if (pathMatcher != null) { |
|
|
|
if (pathMatcher != null) { |
|
|
|
handler.setPathMatcher(pathMatcher); |
|
|
|
handler.setPathMatcher(pathMatcher); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -260,7 +260,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Protected method for plugging in a custom sub-class of |
|
|
|
* Protected method for plugging in a custom subclass of |
|
|
|
* {@link org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler |
|
|
|
* {@link org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler |
|
|
|
* SimpAnnotationMethodMessageHandler}. |
|
|
|
* SimpAnnotationMethodMessageHandler}. |
|
|
|
* @since 4.2 |
|
|
|
* @since 4.2 |
|
|
|
@ -320,7 +320,6 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Expose alias for 4.1 compatibility
|
|
|
|
// Expose alias for 4.1 compatibility
|
|
|
|
|
|
|
|
|
|
|
|
@Bean(name={"messageBrokerTaskScheduler", "messageBrokerSockJsTaskScheduler"}) |
|
|
|
@Bean(name={"messageBrokerTaskScheduler", "messageBrokerSockJsTaskScheduler"}) |
|
|
|
public ThreadPoolTaskScheduler messageBrokerTaskScheduler() { |
|
|
|
public ThreadPoolTaskScheduler messageBrokerTaskScheduler() { |
|
|
|
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); |
|
|
|
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); |
|
|
|
@ -395,9 +394,9 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
protected abstract SimpUserRegistry createLocalUserRegistry(); |
|
|
|
protected abstract SimpUserRegistry createLocalUserRegistry(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* As of 4.2, UserSessionRegistry is deprecated in favor of SimpUserRegistry |
|
|
|
* As of 4.2, {@code UserSessionRegistry} is deprecated in favor of {@link SimpUserRegistry} |
|
|
|
* exposing information about all connected users. The MultiServerUserRegistry |
|
|
|
* exposing information about all connected users. The {@link MultiServerUserRegistry} |
|
|
|
* implementation in combination with UserRegistryMessageHandler can be used |
|
|
|
* implementation in combination with {@link UserRegistryMessageHandler} can be used |
|
|
|
* to share user registries across multiple servers. |
|
|
|
* to share user registries across multiple servers. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Deprecated |
|
|
|
@Deprecated |
|
|
|
@ -465,9 +464,9 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void handleMessage(Message<?> message) { |
|
|
|
public void handleMessage(Message<?> message) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private class NoOpBrokerMessageHandler extends AbstractBrokerMessageHandler { |
|
|
|
private class NoOpBrokerMessageHandler extends AbstractBrokerMessageHandler { |
|
|
|
|
|
|
|
|
|
|
|
public NoOpBrokerMessageHandler() { |
|
|
|
public NoOpBrokerMessageHandler() { |
|
|
|
|