INT-3749: Revert setters for EC

JIRA: https://jira.spring.io/browse/INT-3749

Since some target application could inject there is `EvaluationContext` before, removal of
 `setIntegrationEvaluationContext()` is breaking change.

 This fix reverts all those setters.
This commit is contained in:
Artem Bilan
2015-06-27 12:36:33 -04:00
parent 3392d4e1ab
commit 9c96a14cd1
15 changed files with 115 additions and 24 deletions

View File

@@ -185,6 +185,10 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
this.forceReleaseAdviceChain = forceReleaseAdviceChain;
}
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
this.evaluationContext = evaluationContext;
}
@Override
public void setTaskScheduler(TaskScheduler taskScheduler) {
super.setTaskScheduler(taskScheduler);
@@ -224,7 +228,9 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
((SequenceSizeReleaseStrategy) this.releaseStrategy).setReleasePartialSequences(releasePartialSequences);
}
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
if (this.evaluationContext == null) {
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
/*
* Disallow any further changes to the lock registry

View File

@@ -56,10 +56,16 @@ public abstract class ExpressionMessageProducerSupport extends MessageProducerSu
this.payloadExpression = payloadExpression;
}
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
this.evaluationContext = evaluationContext;
}
@Override
protected void onInit() {
super.onInit();
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
if (this.evaluationContext == null) {
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory());
}
}
protected Object evaluatePayloadExpression(Object payload){

View File

@@ -79,6 +79,10 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy
this.expression = expression;
}
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
this.evaluationContext = evaluationContext;
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
@@ -86,7 +90,9 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy
@Override
public void afterPropertiesSet() throws Exception {
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.beanFactory);
if (this.evaluationContext == null) {
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.beanFactory);
}
}
@Override

View File

@@ -71,6 +71,10 @@ public class ExpressionEvaluatingTransactionSynchronizationProcessor extends Int
private volatile MessageChannel afterRollbackChannel = new NullChannel();
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
this.evaluationContext = evaluationContext;
}
public void setBeforeCommitChannel(MessageChannel beforeCommitChannel) {
Assert.notNull(beforeCommitChannel, "'beforeCommitChannel' must not be null");
this.beforeCommitChannel = beforeCommitChannel;
@@ -104,7 +108,9 @@ public class ExpressionEvaluatingTransactionSynchronizationProcessor extends Int
@Override
protected void onInit() throws Exception {
super.onInit();
this.evaluationContext = createEvaluationContext();
if (this.evaluationContext == null) {
this.evaluationContext = createEvaluationContext();
}
}
public void processBeforeCommit(IntegrationResourceHolder holder) {

View File

@@ -244,6 +244,10 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler
this.shouldClonePayload = shouldClonePayload;
}
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
this.sourceEvaluationContext = evaluationContext;
}
@Override
public String getComponentType() {
return "enricher";
@@ -303,7 +307,9 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler
this.gateway.afterPropertiesSet();
}
this.sourceEvaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
if (this.sourceEvaluationContext == null) {
this.sourceEvaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
StandardEvaluationContext targetContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
// bean resolution is NOT allowed for the target of the enrichment