Torsten Curdt wrote:

<snip/>

This means that the interpreter must "externalize" its state (compiled scripts and global scope) in an object stored in the treeprocessor for a sitemap (in the FlowNode).


yes

Or another solution is to change Interpreter into InterpreterFactory: the state mentioned above would then be the interpreter itself.


huh? do you mean there is exactly one interpreter for a specific state accessable through the factory? please explain :)


Let's explain it in (pseudo-)code:

FlowNode.java:

// the flow interpreter for this sitemap
private Interpreter interpreter;

public void initialize() {
 IntepreterFactory factory =
   (InterpreterFactory)this.manager.lookup(InterpreterFactory.ROLE);
 // flowconfig is the <map:flow> element whose content (<map:script>)
 // is specific to the particular flow implementation
 this.interpreter = factory.createIntepreter(flowconfig);
 this.manager.release(factory);
}


The "interpreter" object contains the state (scripts + global scope) that belong to this sitemap.


Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to