Is spelExpression in spring -el thread safe?

Expression exp = parser.parseExpression("myParam.getValue()"); 

Is Expression Stream Stream Safe? I would like to store it in a global cache, like ConcurrentHashMap , to avoid compiling with every access.

+4
source share
1 answer

Well, Expression is an interface, not a class. But yes, if your parser is the standard SpelExpressionParser , the resulting implementation of SpelExpression is thread safe. In general, evaluation contexts, too, if you do not mutate them (for example, change variables, functions) during use.

+2
source

Source: https://habr.com/ru/post/1482985/


All Articles