INT-3665: Remove Deprecations and Resolve Issues
https://jira.spring.io/browse/INT-3665 Fixes according Travis report Introduce `...ExpressionString(String)` setter Some further fixes and polishing Address PR comments
This commit is contained in:
committed by
Gary Russell
parent
84fdd98428
commit
cf528c0b5d
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2015 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.
|
||||
@@ -18,6 +18,7 @@ package org.springframework.integration.redis.config;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.config.xml.AbstractConsumerEndpointParser;
|
||||
@@ -70,7 +71,8 @@ public class RedisOutboundGatewayParser extends AbstractConsumerEndpointParser {
|
||||
}
|
||||
|
||||
if (hasArgumentExpressions) {
|
||||
BeanDefinitionBuilder argumentsBuilder = BeanDefinitionBuilder.genericBeanDefinition(ExpressionArgumentsStrategy.class)
|
||||
BeanDefinitionBuilder argumentsBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition(ExpressionArgumentsStrategy.class)
|
||||
.addConstructorArgValue(argumentExpressions)
|
||||
.addConstructorArgValue(element.getAttribute("use-command-variable"));
|
||||
builder.addPropertyValue("argumentsStrategy", argumentsBuilder.getBeanDefinition());
|
||||
@@ -85,9 +87,14 @@ public class RedisOutboundGatewayParser extends AbstractConsumerEndpointParser {
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel", "outputChannel");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout", "sendTimeout");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "command-expression");
|
||||
BeanDefinition expressionDef =
|
||||
IntegrationNamespaceUtils.createExpressionDefIfAttributeDefined("command-expression", element);
|
||||
if (expressionDef != null) {
|
||||
builder.addPropertyValue("commandExpression", expressionDef);
|
||||
}
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "arguments-serializer");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,22 +72,29 @@ public class RedisOutboundGateway extends AbstractReplyProducingMessageHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated in favor of {@link #setExpressionCommand}. Will be changed in a future release
|
||||
* to use an {@link Expression} parameter.
|
||||
* @param commandExpression the expression to set.
|
||||
* @param commandExpression the String in SpEL syntax.
|
||||
* @since 4.3
|
||||
*/
|
||||
@Deprecated
|
||||
public void setCommandExpression(String commandExpression) {
|
||||
Assert.hasText(commandExpression, "'commandExpression' must not be an empty string");
|
||||
setExpressionCommand(PARSER.parseExpression(commandExpression));
|
||||
public void setCommandExpression(Expression commandExpression) {
|
||||
this.commandExpression = commandExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporary, will be changed to {@link #setCommandExpression} in a future release.
|
||||
* @param commandExpression the expression to set.
|
||||
* @param commandExpression the String in SpEL syntax.
|
||||
* @since 4.3
|
||||
*/
|
||||
public void setCommandExpressionString(String commandExpression) {
|
||||
Assert.hasText(commandExpression, "'commandExpression' must not be empty");
|
||||
this.commandExpression = EXPRESSION_PARSER.parseExpression(commandExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param commandExpression the expression to set.
|
||||
* @deprecated in favor of {@link #setCommandExpression}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setExpressionCommand(Expression commandExpression) {
|
||||
this.commandExpression = commandExpression;
|
||||
setCommandExpression(commandExpression);
|
||||
}
|
||||
|
||||
public void setArgumentsStrategy(ArgumentsStrategy argumentsStrategy) {
|
||||
|
||||
@@ -66,17 +66,6 @@ public class RedisPublishingMessageHandler extends AbstractMessageHandler {
|
||||
this.messageConverter = messageConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultTopic The default topic.
|
||||
*
|
||||
* @deprecated in favor of {@link #setTopicExpression(Expression)} or {@link #setTopic(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setDefaultTopic(String defaultTopic) {
|
||||
Assert.hasText(defaultTopic, "'defaultTopic' must not be an empty string.");
|
||||
this.setTopicExpression(new LiteralExpression(defaultTopic));
|
||||
}
|
||||
|
||||
public void setTopic(String topic) {
|
||||
Assert.hasText(topic, "'topic' must not be an empty string.");
|
||||
this.setTopicExpression(new LiteralExpression(topic));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.redis.rules;
|
||||
|
||||
import org.junit.Assume;
|
||||
@@ -40,6 +41,7 @@ public final class RedisAvailableRule implements MethodRule {
|
||||
try {
|
||||
connectionFactory = new JedisConnectionFactory();
|
||||
connectionFactory.setPort(REDIS_PORT);
|
||||
connectionFactory.setTimeout(10000);
|
||||
connectionFactory.afterPropertiesSet();
|
||||
connectionFactory.getConnection();
|
||||
connectionFactoryResource.set(connectionFactory);
|
||||
|
||||
Reference in New Issue
Block a user