From bb5a53f7f75b6b963d077478d3ab783a7c6f1e4a Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 2 Dec 2013 21:55:44 -0500 Subject: [PATCH] Update websocket xml namespace attributes --- .../MessageBrokerBeanDefinitionParser.java | 30 +++++++++---------- .../config/WebSocketNamespaceUtils.java | 4 +-- .../socket/config/spring-websocket-4.0.xsd | 12 ++++---- .../config/websocket-config-broker-relay.xml | 10 ++----- ...cket-config-handlers-sockjs-attributes.xml | 11 ++----- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java index eb1ace09d3..f166903828 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java @@ -304,25 +304,25 @@ class MessageBrokerBeanDefinitionParser implements BeanDefinitionParser { if(!relayPort.isEmpty()) { mpvs.add("relayPort", Integer.valueOf(relayPort)); } - String systemLogin = brokerRelayElem.getAttribute("system-login"); - if(!systemLogin.isEmpty()) { - mpvs.add("systemLogin",systemLogin); + String attrValue = brokerRelayElem.getAttribute("login"); + if(!attrValue.isEmpty()) { + mpvs.add("systemLogin",attrValue); } - String systemPasscode = brokerRelayElem.getAttribute("system-passcode"); - if(!systemPasscode.isEmpty()) { - mpvs.add("systemPasscode",systemPasscode); + attrValue = brokerRelayElem.getAttribute("passcode"); + if(!attrValue.isEmpty()) { + mpvs.add("systemPasscode", attrValue); } - String systemHeartbeatSendInterval = brokerRelayElem.getAttribute("system-heartbeat-send-interval"); - if(!systemHeartbeatSendInterval.isEmpty()) { - mpvs.add("systemHeartbeatSendInterval",Long.parseLong(systemHeartbeatSendInterval)); + attrValue = brokerRelayElem.getAttribute("heartbeat-send-interval"); + if(!attrValue.isEmpty()) { + mpvs.add("systemHeartbeatSendInterval", Long.parseLong(attrValue)); } - String systemHeartbeatReceiveInterval = brokerRelayElem.getAttribute("system-heartbeat-receive-interval"); - if(!systemHeartbeatReceiveInterval.isEmpty()) { - mpvs.add("systemHeartbeatReceiveInterval",Long.parseLong(systemHeartbeatReceiveInterval)); + attrValue = brokerRelayElem.getAttribute("heartbeat-receive-interval"); + if(!attrValue.isEmpty()) { + mpvs.add("systemHeartbeatReceiveInterval", Long.parseLong(attrValue)); } - String virtualHost = brokerRelayElem.getAttribute("virtual-host"); - if(!virtualHost.isEmpty()) { - mpvs.add("virtualHost",virtualHost); + attrValue = brokerRelayElem.getAttribute("virtual-host"); + if(!attrValue.isEmpty()) { + mpvs.add("virtualHost", attrValue); } Class handlerType = StompBrokerRelayMessageHandler.class; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java index a81801f437..5e92bb6512 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/WebSocketNamespaceUtils.java @@ -67,7 +67,7 @@ class WebSocketNamespaceUtils { // TODO: polish the way constructor arguments are set - String customTaskSchedulerName = sockJsElement.getAttribute("task-scheduler"); + String customTaskSchedulerName = sockJsElement.getAttribute("scheduler"); if (!customTaskSchedulerName.isEmpty()) { cavs.addIndexedArgumentValue(0, new RuntimeBeanReference(customTaskSchedulerName)); } @@ -126,7 +126,7 @@ class WebSocketNamespaceUtils { if (!attrValue.isEmpty()) { sockJsServiceDef.getPropertyValues().add("disconnectDelay", Long.valueOf(attrValue)); } - attrValue = sockJsElement.getAttribute("http-message-cache-size"); + attrValue = sockJsElement.getAttribute("message-cache-size"); if (!attrValue.isEmpty()) { sockJsServiceDef.getPropertyValues().add("httpMessageCacheSize", Integer.valueOf(attrValue)); } diff --git a/spring-websocket/src/main/resources/org/springframework/web/socket/config/spring-websocket-4.0.xsd b/spring-websocket/src/main/resources/org/springframework/web/socket/config/spring-websocket-4.0.xsd index 2454cf8ea4..53cd347ddd 100644 --- a/spring-websocket/src/main/resources/org/springframework/web/socket/config/spring-websocket-4.0.xsd +++ b/spring-websocket/src/main/resources/org/springframework/web/socket/config/spring-websocket-4.0.xsd @@ -100,11 +100,11 @@ - + - + @@ -112,10 +112,10 @@ - - - - + + + + diff --git a/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-broker-relay.xml b/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-broker-relay.xml index 03e2cdfb4a..11746ff9d3 100644 --- a/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-broker-relay.xml +++ b/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-broker-relay.xml @@ -9,14 +9,8 @@ - diff --git a/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-handlers-sockjs-attributes.xml b/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-handlers-sockjs-attributes.xml index e6ef9cdd50..b8cb777b79 100644 --- a/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-handlers-sockjs-attributes.xml +++ b/spring-websocket/src/test/resources/org/springframework/web/socket/config/websocket-config-handlers-sockjs-attributes.xml @@ -7,14 +7,9 @@ - +