[ 
https://issues.apache.org/jira/browse/JEXL-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15279844#comment-15279844
 ] 

Dmitri Blinov commented on JEXL-194:
------------------------------------

If my thoughts may be of any use here, it seems options are either to introduce 
kind of *synchronized* keyword into JEXL syntax to protect needed blocks of 
code, which would give maximum flexibility, or at least introduce specialized 
form of *for statement* (lets say, foreach {}), which unlike basic version of 
*for statement* would lock collection for the duration of iteration, while 
necessarily synchronizing any modification (not sure about  access) operators 
inside JEXL. 

May be more promising approach would be to provide extension points for 
*statements* in a way JexlArithmetic provides for *operators*, where it would 
be possible to add some custom logic without polluting JEXL code with 
questionable implementations.

> synchronize on iterableValue in foreach statement
> -------------------------------------------------
>
>                 Key: JEXL-194
>                 URL: https://issues.apache.org/jira/browse/JEXL-194
>             Project: Commons JEXL
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Minor
>
> Since it is a requirement to synchronize on simple Collections and 
> synchronized Collections while iterating over them and since jexl has no 
> instrument to control synchronization in script, I think its reasonable to 
> implement synchronization in jexl itself on iterableValue. In case of 
> concurrent collections it will possibly block other threads only if they are 
> synchronizing on those collections themselves, which will be complementary to 
> required synchronization in jexl.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to