Allow stateful namespaces (ns:function) 
----------------------------------------

                 Key: JEXL-94
                 URL: https://issues.apache.org/jira/browse/JEXL-94
             Project: Commons JEXL
          Issue Type: Improvement
            Reporter: Henri Biestro
            Assignee: Henri Biestro
             Fix For: 2.0


The current basic behavior of namespaces only allows stateless execution.
In some cases, this is not convenient enough (SCXML for instance); by having 
namespaces instantiated at script/expression evaluation time and passing the 
JexlContext as their constructor argument, the namespace can define members 
that functions (namespace methods) can use. It makes namespaces almost as 
potent as regular JexlContext variables, full blown objects.
Convention will be that a namespace whose value is a class having a constructor 
that uses a JexlContext as argument is such a 'stateful' namespace.
They are instantiated on need and their lifetime spans the evaluation call.
Experience suggests that the JexlContext should probably be derived to contain 
the information necessary to instantiate the namespace without polluting the 
variable space.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to