cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Synchronized pipeline or functions
Date Thu, 27 Oct 2005 11:38:24 GMT
Philippe Gassmann wrote:
> Sylvain Wallez wrote:
>
>> Gianluca Morello wrote:
>>
>>> Hi,
>>>
>>> I have a cocoon app with a pipeline that read (generator) and write
>>> (writesource) the some xml file.
>>> Because i have many concurrent requests i was wondering if is it 
>>> possible to
>>> declare a pipeline as synchronized.  
>>
>>
>> No you can't. You have to handle the locking by other means in a 
>> controller (action or flowscript).
>>
>> Sylvain
>>
> How can you do that with actions ?

Well...

synchronized(lockObject) {
    Source syncedPipeline = resolver.resolveURI("cocoon://synced-pipeline");
    try {
        doSomeThingWith(synchedPipeline.getInputStream());
    } finally {
       resolver.release(syncedPipeline);
    }
}

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message