cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Nasty flowscript issue - nailed
Date Tue, 06 Jul 2004 12:25:22 GMT
Gianugo Rabellino wrote:

> On Jul 6, 2004, at 12:26 PM, Sylvain Wallez wrote:
>
>>>> There is a solution, though: there's a different FlowIntepreter 
>>>> for  each Processor instance (they are SingleThreaded), and so 
>>>> each  interpreter instance could produce a unique identifier and 
>>>> use it as  the result of getSitemapPath (which should therefore be 
>>>> renamed).
>>>
>>>
>>> Any suggestions for a good unique identifier?
>>>
>>> Thanks so much,
>>
>>
>>
>> Since ID uniqueness doesn't have to survive JVM restart, a date-based 
>> generator like this should do the job (sorry, no time to commit it 
>> myself):
>
>
> Uhm, I might be missing something here. I understood that scope should 
> be reused (resurrected?) when inside the same sitemap: in this case, 
> your IDGenerator would yield a different result every time, hence a 
> new scope. Is this what is needed? If that's the case, well, fair 
> enough. :-)


Sorry, I wasn't clear in my explanation (I was hungry and ready to run 
for lunch, which isn't good for clarity ;-)

JavaScriptInterpreter should have an id attribute intialized once, whose 
value is used instead of getSitemapPath(), e.g.
    private String interpreterID = IDGenerator.getNewID();

and
    scope = (ThreadScope)userScopes.get(getSitemapPath());
becomes
    scope = (ThreadScope)userScopes.get(this.interpreterID);

Hope this is clearer.

Sylvain

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


Mime
View raw message