commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henrib <>
Subject Re: [JEXL] 2.0 JSR-223 initial implementation added - what next?
Date Sat, 01 Aug 2009 16:21:41 GMT

sebb-2-2 wrote:
> Thread-safety: is the interpreter thread-safe? 

Both the JexlEngine & UnifiedJEXL are intended to be thread-safe & shared.
Besides usage of final fields in any applicable case, the (Expression,
UnifiedJEXL.Expression, MethodMap & al) shared caches are synchronized for
get/put and the expression node cache are volatile to ensure atomic
read/write ops.
The Interpreter is a "transient" that's never used outside of an eval and
will not be shared.
For peace of mind, the methods that manipulate flags for the
JexlEngine/UnifiedJEXL setLenient, setDebug & al could be made synchronized
or using volatile fields but it does not make much sense to call those after
real usage has began.

The only edge case is the JexlContext (at least the instance created by
JexlHelper) which is *not* threadsafe being based on a HashMap.

View this message in context:
Sent from the Commons - Dev mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message