Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Nov 9, 2020
1 parent 09c8586 commit 4ba1743
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -223,8 +223,8 @@ protected String getUserRegistryBroadcast() {
}


@Override
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {

StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(
getClientInboundChannel(), getClientOutboundChannel(),
brokerChannel, getDestinationPrefixes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
ClassUtils.isPresent("javax.validation.Validator",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());

private static boolean romePresent =
private static final boolean romePresent =
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());

Expand Down Expand Up @@ -197,7 +197,7 @@ public BeanDefinition parse(Element element, ParserContext context) {
handlerMappingDef.getPropertyValues().add("contentNegotiationManager", contentNegotiationManager);

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);
}
else if (element.hasAttribute("enableMatrixVariables")) {
Expand Down Expand Up @@ -545,7 +545,7 @@ private ManagedList<?> getMessageConverters(Element element, Object source, Pars
}
}

if (convertersElement == null || Boolean.valueOf(convertersElement.getAttribute("register-defaults"))) {
if (convertersElement == null || Boolean.parseBoolean(convertersElement.getAttribute("register-defaults"))) {
messageConverters.setSource(source);
messageConverters.add(createConverterDefinition(ByteArrayHttpMessageConverter.class, source));

Expand Down
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,7 +80,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {

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());


Expand Down Expand Up @@ -329,7 +329,7 @@ private void parseResourceResolversTransformers(boolean isAutoRegistration,
}

if (isAutoRegistration) {
if (isWebJarsAssetLocatorPresent) {
if (webJarsPresent) {
RootBeanDefinition webJarsResolverDef = new RootBeanDefinition(WebJarsResourceResolver.class);
webJarsResolverDef.setSource(source);
webJarsResolverDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -114,6 +114,12 @@ public interface WebSocketSession extends Closeable {

/**
* 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;

Expand Down

0 comments on commit 4ba1743

Please sign in to comment.