Replace LiteralExpression to ValueExpression
This commit is contained in:
@@ -53,4 +53,5 @@ public class AbstractRouterSpec<S extends AbstractRouterSpec<S, R>, R extends Ab
|
||||
protected R doGet() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.common.LiteralExpression;
|
||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||
import org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler;
|
||||
import org.springframework.integration.aggregator.CorrelationStrategy;
|
||||
@@ -27,6 +26,7 @@ import org.springframework.integration.aggregator.ReleaseStrategy;
|
||||
import org.springframework.integration.config.CorrelationStrategyFactoryBean;
|
||||
import org.springframework.integration.config.ReleaseStrategyFactoryBean;
|
||||
import org.springframework.integration.dsl.core.IntegrationComponentSpec;
|
||||
import org.springframework.integration.expression.ValueExpression;
|
||||
import org.springframework.integration.store.MessageGroupStore;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
@@ -73,7 +73,7 @@ public abstract class CorrelationHandlerSpec<S extends CorrelationHandlerSpec<S,
|
||||
}
|
||||
|
||||
public S groupTimeout(long groupTimeout) {
|
||||
this.groupTimeoutExpression = new LiteralExpression("" + groupTimeout);
|
||||
this.groupTimeoutExpression = new ValueExpression<Long>(groupTimeout);
|
||||
return _this();
|
||||
}
|
||||
|
||||
|
||||
@@ -98,12 +98,12 @@ public class EnricherSpec extends IntegrationComponentSpec<EnricherSpec, Content
|
||||
return _this();
|
||||
}
|
||||
|
||||
public EnricherSpec header(String name, Object value) {
|
||||
public <V> EnricherSpec header(String name, V value) {
|
||||
return this.header(name, value, null);
|
||||
}
|
||||
|
||||
public EnricherSpec header(String name, Object value, Boolean overwrite) {
|
||||
AbstractHeaderValueMessageProcessor<?> headerValueMessageProcessor = new StaticHeaderValueMessageProcessor<Object>(value);
|
||||
public <V> EnricherSpec header(String name, V value, Boolean overwrite) {
|
||||
AbstractHeaderValueMessageProcessor<V> headerValueMessageProcessor = new StaticHeaderValueMessageProcessor<V>(value);
|
||||
headerValueMessageProcessor.setOverwrite(overwrite);
|
||||
return this.header(name, headerValueMessageProcessor);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class EnricherSpec extends IntegrationComponentSpec<EnricherSpec, Content
|
||||
return this.header(name, headerValueMessageProcessor);
|
||||
}
|
||||
|
||||
public EnricherSpec header(String name, HeaderValueMessageProcessor<?> headerValueMessageProcessor) {
|
||||
public <V> EnricherSpec header(String name, HeaderValueMessageProcessor<V> headerValueMessageProcessor) {
|
||||
Assert.notNull(name);
|
||||
this.headerExpressions.put(name, headerValueMessageProcessor);
|
||||
return _this();
|
||||
|
||||
@@ -69,36 +69,28 @@ public class HeaderEnricherSpec extends IntegrationComponentSpec<HeaderEnricherS
|
||||
return this.messageProcessor(new BeanNameMessageProcessor<Object>(beanName, methodName));
|
||||
}
|
||||
|
||||
public HeaderEnricherSpec header(String name, Object value) {
|
||||
public <V> HeaderEnricherSpec header(String name, V value) {
|
||||
return this.header(name, value, null);
|
||||
}
|
||||
|
||||
public HeaderEnricherSpec header(String name, Object value, Boolean overwrite) {
|
||||
AbstractHeaderValueMessageProcessor<?> headerValueMessageProcessor = new StaticHeaderValueMessageProcessor<Object>(value);
|
||||
public <V> HeaderEnricherSpec header(String name, V value, Boolean overwrite) {
|
||||
AbstractHeaderValueMessageProcessor<V> headerValueMessageProcessor = new StaticHeaderValueMessageProcessor<V>(value);
|
||||
headerValueMessageProcessor.setOverwrite(overwrite);
|
||||
return this.header(name, headerValueMessageProcessor);
|
||||
}
|
||||
|
||||
public HeaderEnricherSpec headerExpression(String name, String expression) {
|
||||
return this.headerExpression(name, expression, null, null);
|
||||
return this.headerExpression(name, expression, null);
|
||||
}
|
||||
|
||||
public HeaderEnricherSpec headerExpression(String name, String expression, Boolean overwrite) {
|
||||
return this.headerExpression(name, expression, overwrite, null);
|
||||
}
|
||||
|
||||
public <T> HeaderEnricherSpec headerExpression(String name, String expression, Class<T> type) {
|
||||
return this.headerExpression(name, expression, null, type);
|
||||
}
|
||||
|
||||
public <T> HeaderEnricherSpec headerExpression(String name, String expression, Boolean overwrite, Class<T> type) {
|
||||
AbstractHeaderValueMessageProcessor<T> headerValueMessageProcessor =
|
||||
new ExpressionEvaluatingHeaderValueMessageProcessor<T>(expression, type);
|
||||
AbstractHeaderValueMessageProcessor<?> headerValueMessageProcessor =
|
||||
new ExpressionEvaluatingHeaderValueMessageProcessor<Object>(expression, null);
|
||||
headerValueMessageProcessor.setOverwrite(overwrite);
|
||||
return this.header(name, headerValueMessageProcessor);
|
||||
}
|
||||
|
||||
public HeaderEnricherSpec header(String name, HeaderValueMessageProcessor<?> headerValueMessageProcessor) {
|
||||
public <V> HeaderEnricherSpec header(String name, HeaderValueMessageProcessor<V> headerValueMessageProcessor) {
|
||||
Assert.notNull(name);
|
||||
this.headerToAdd.put(name, headerValueMessageProcessor);
|
||||
return _this();
|
||||
|
||||
Reference in New Issue
Block a user