Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: Later
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Currently, we create new ELResolvers for every ElContext (which is cached in the execution).
Better practice would be to make them reusable. Following resolvers should be re-factored:
- ExecutionVariableElResolver
- ApplicationContextElResolver
Access of Execution and ApplicationContext in the resolvers should work with ElContext.getContext and ElContext.putContext, as proposed on the forum:
Hi,
I was browsing the EL-related code in Activiti, where a point came into my mind:
The ExecutionVariableElResolver class needs an instance of Execution for looking up variables.
So, everytime an ELContext instance is needed, it is created with brand-new resolvers, so that execution can be set into them.
(I know it is cached for each execution)
But instead of creating resolvers everytime (I think they are stateless, except for ExecutionVariableElResolver)
you can set the execution in the ELContext using putContext method, and look it up in ExecutionVariableElResolver class using getContext method.
This is a more logical place, imho, to keep the execution in the el context object model.
And if any other resolvers need the execution instance in any way, is can be easier for them to access.
-Hamed
Activity
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | Later [ 16893 ] |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Won't Fix [ 2 ] |