You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gianluca Morello <mo...@mytv.it> on 2005/10/26 13:42:33 UTC

Synchronized pipeline or functions

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.

Thank you for your help

Gianluca Morello

morello@mytv.it





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


Re: Synchronized pipeline or functions

Posted by Sylvain Wallez <sy...@apache.org>.
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


Re: Synchronized pipeline or functions

Posted by Philippe Gassmann <ph...@anyware-tech.com>.
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 ?

Philippe.

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


Re: Synchronized pipeline or functions

Posted by Sylvain Wallez <sy...@apache.org>.
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

-- 
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