Christopher Oliver wrote:

Taking Sylvain's idea of ContinuationLocal variables, I prototyped an implementation. Since the continuation local variable must be associated with the object managing the actual continuations, I made FOM_Cocoon the factory for creating these (but another object could provide this role). I've called these variables "PageLocal" rather than ContinuationLocal as in this case they are associated with the continuation of sendPageAndWait(), and not with any arbitrary continuation

You create a page local object by calling "cocoon.createPageLocal()". The returned object behaves like a normal JavaScript Object but restores the property values it had when sendPageAndWait() was originally called, each time the page is resubmitted..


<snip/>

One thing to beware of with this approach, however, is memory growth, as each continuation has its own copy of the page local variables.


Yep, but this is the price to pay for this feature...

WDYT?


+1000! Cool work!

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