Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-94

Allow stateful namespaces (ns:function)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None

    Description

      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.

      Attachments

        Activity

          People

            henrib Henri Biestro
            henrib Henri Biestro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: