Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2020 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.
|
||||||
@@ -231,8 +231,8 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {
|
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {
|
||||||
|
|
||||||
StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(
|
StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(
|
||||||
getClientInboundChannel(), getClientOutboundChannel(),
|
getClientInboundChannel(), getClientOutboundChannel(),
|
||||||
brokerChannel, getDestinationPrefixes());
|
brokerChannel, getDestinationPrefixes());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2020 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.
|
||||||
@@ -58,7 +58,6 @@ public interface WebSocketSession {
|
|||||||
* is closed. In a typical {@link WebSocketHandler} implementation this
|
* is closed. In a typical {@link WebSocketHandler} implementation this
|
||||||
* stream is composed into the overall processing flow, so that when the
|
* stream is composed into the overall processing flow, so that when the
|
||||||
* connection is closed, handling will end.
|
* connection is closed, handling will end.
|
||||||
*
|
|
||||||
* <p>See the class-level doc of {@link WebSocketHandler} and the reference
|
* <p>See the class-level doc of {@link WebSocketHandler} and the reference
|
||||||
* for more details and examples of how to handle the session.
|
* for more details and examples of how to handle the session.
|
||||||
*/
|
*/
|
||||||
@@ -68,7 +67,6 @@ public interface WebSocketSession {
|
|||||||
* Give a source of outgoing messages, write the messages and return a
|
* Give a source of outgoing messages, write the messages and return a
|
||||||
* {@code Mono<Void>} that completes when the source completes and writing
|
* {@code Mono<Void>} that completes when the source completes and writing
|
||||||
* is done.
|
* is done.
|
||||||
*
|
|
||||||
* <p>See the class-level doc of {@link WebSocketHandler} and the reference
|
* <p>See the class-level doc of {@link WebSocketHandler} and the reference
|
||||||
* for more details and examples of how to handle the session.
|
* for more details and examples of how to handle the session.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
ClassUtils.isPresent("javax.validation.Validator",
|
ClassUtils.isPresent("javax.validation.Validator",
|
||||||
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
private static boolean romePresent =
|
private static final boolean romePresent =
|
||||||
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
|
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
|
||||||
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
handlerMappingDef.getPropertyValues().add("contentNegotiationManager", contentNegotiationManager);
|
handlerMappingDef.getPropertyValues().add("contentNegotiationManager", contentNegotiationManager);
|
||||||
|
|
||||||
if (element.hasAttribute("enable-matrix-variables")) {
|
if (element.hasAttribute("enable-matrix-variables")) {
|
||||||
Boolean enableMatrixVariables = Boolean.valueOf(element.getAttribute("enable-matrix-variables"));
|
boolean enableMatrixVariables = Boolean.parseBoolean(element.getAttribute("enable-matrix-variables"));
|
||||||
handlerMappingDef.getPropertyValues().add("removeSemicolonContent", !enableMatrixVariables);
|
handlerMappingDef.getPropertyValues().add("removeSemicolonContent", !enableMatrixVariables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,7 +574,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertersElement == null || Boolean.valueOf(convertersElement.getAttribute("register-defaults"))) {
|
if (convertersElement == null || Boolean.parseBoolean(convertersElement.getAttribute("register-defaults"))) {
|
||||||
messageConverters.setSource(source);
|
messageConverters.setSource(source);
|
||||||
messageConverters.add(createConverterDefinition(ByteArrayHttpMessageConverter.class, source));
|
messageConverters.add(createConverterDefinition(ByteArrayHttpMessageConverter.class, source));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2020 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.
|
||||||
@@ -81,7 +81,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
|
|
||||||
private static final String RESOURCE_URL_PROVIDER = "mvcResourceUrlProvider";
|
private static final String RESOURCE_URL_PROVIDER = "mvcResourceUrlProvider";
|
||||||
|
|
||||||
private static final boolean isWebJarsAssetLocatorPresent = ClassUtils.isPresent(
|
private static final boolean webJarsPresent = ClassUtils.isPresent(
|
||||||
"org.webjars.WebJarAssetLocator", ResourcesBeanDefinitionParser.class.getClassLoader());
|
"org.webjars.WebJarAssetLocator", ResourcesBeanDefinitionParser.class.getClassLoader());
|
||||||
|
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isAutoRegistration) {
|
if (isAutoRegistration) {
|
||||||
if (isWebJarsAssetLocatorPresent) {
|
if (webJarsPresent) {
|
||||||
RootBeanDefinition webJarsResolverDef = new RootBeanDefinition(WebJarsResourceResolver.class);
|
RootBeanDefinition webJarsResolverDef = new RootBeanDefinition(WebJarsResourceResolver.class);
|
||||||
webJarsResolverDef.setSource(source);
|
webJarsResolverDef.setSource(source);
|
||||||
webJarsResolverDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
|
webJarsResolverDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2020 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.
|
||||||
@@ -120,6 +120,12 @@ public interface WebSocketSession extends Closeable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}.
|
* Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}.
|
||||||
|
* <p><strong>Note:</strong> The underlying standard WebSocket session (JSR-356) does
|
||||||
|
* not allow concurrent sending. Therefore sending must be synchronized. To ensure
|
||||||
|
* that, one option is to wrap the {@code WebSocketSession} with the
|
||||||
|
* {@link org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
|
||||||
|
* ConcurrentWebSocketSessionDecorator}.
|
||||||
|
* @see org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
|
||||||
*/
|
*/
|
||||||
void sendMessage(WebSocketMessage<?> message) throws IOException;
|
void sendMessage(WebSocketMessage<?> message) throws IOException;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user