Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-3749: Get rid of IECA logic #1482

Closed
wants to merge 1 commit into from

Conversation

artembilan
Copy link
Member

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

Since IntegrationEvaluationContextAware isn't so "context-free" resource like BeanFactory
and ApplicationContext, but just a specific bean in the context, we can't follow with BeanPostProcessor logic - bad architecture by level of responsibility.
Therefore we should follow with standard Dependency Injection mechanism to retrieve evaluationContext for the particular component.

Since we can't rely on the @Autowired because SI can be used from the raw XML configuration,
we use utility method instead. The pattern to get the proper integrationEvaluationContext is:

 @Override
 protected void onInit() throws Exception {
        super.onInit();
        this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
 }

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

Since `IntegrationEvaluationContextAware` isn't so "context-free" resource like `BeanFactory`
 and `ApplicationContext`, but just a specific bean in the context, we can't follow with `BeanPostProcessor` logic - bad architecture by level of responsibility.
 Therefore we should follow with standard Dependency Injection mechanism to retrieve `evaluationContext` for the particular component.

 Since we can't rely on the `@Autowired` because SI can be used from the raw XML configuration,
 we use utility method instead. The pattern to get the proper `integrationEvaluationContext` is:
 ```
 @OverRide
 protected void onInit() throws Exception {
 		super.onInit();
 		this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
 }
 ```
@garyrussell
Copy link
Contributor

Won't this just take us back to the original problem? (early instantiation of everything due to getBeansOfType()) ?

@artembilan
Copy link
Member Author

The "early access" issue has place in the BPP. When container calls afterPropertiesSet, all BPPs and bean are already there and ready to be access on normal manner.

@garyrussell
Copy link
Contributor

ok; will review - we should remove the interface, and we'll need a migration guide entry

@artembilan
Copy link
Member Author

Well, I made it backward compatible and deprecated as well.
Of course, we can remove this stuff altogether, but we can be smooth and even there is no need in migration guide note, because deprecation warn is thrown for the end-application.

@garyrussell
Copy link
Contributor

Sorry - IDE problems - it showed no references 😦

@artembilan
Copy link
Member Author

Right, it showed, because no one our class implements this interface any more, as well as all those our EXT projects, which are fixed by those my linked PRs.
I left it here just in case some other end-project uses our SpEL stuff for its purposes.

@garyrussell
Copy link
Contributor

Rebased, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants