An Action is a SitemapComponent. This means it is managed by a ComponentManager that 
is bound to the current sitemap. Whenever you change something in the sitemap, the 
sitemap gets reloaded and ComponentManager gets disposed/renewed. This is IIUC what 
the IllegalAccessException is about.

To prevent this from happening, the best way to implement your 
BackgroundProcessManager, is not as an Action but as a more general component you can 
declare in cocoon.xconf. The ComponentManager that manages these components does not 
get reloaded whenever your sitemap changes.

Then in your action you do a lookup on the ComponentManager (implement Composable) to 
use that component. You should make sure that BackgroundProcessManager implements 
ThreadSafe marker interface, this ensures that there is only one instance of it 
running at any one time. As it is now, because you have implemented the 
BackgroundProcessManager as an Action - wich is a transient type object instead of a 
singleton type object - parralel requests will obtain different instances of it, wich 
kind of defeats the purpose of the max_parallel_bgps parameter.

Hope this helps, Unico

Stephanie Zohner wrote:
> 
> 
> Hi,
> 
> I have developed a "BackgroundProcessManager" as a Cocoon Action.
> 
> *************
> What it does
> *************
> With it, multiple requests  (to Cocoon pipelines) can be 
> processed at a time
> and their responses can be saved to the filesystem.
> After the reponses have been saved, for each process (BGP) an email is
> generated which gives a feedback about the generation process 
> (if everything
> worked fine, or if there were errors).
> So everytime my action is called, there are 2 requests to 
> Cocoon. Firstly
> the request to a Cocoon Pipeline which does a (time intensive)
> xml-generation and transformation and secondly the request to 
> the Email
> Pipeline.
> 
> So far so good.
> 
> ***************
> The Problem
> ***************
> The action has a configuration parameter, which defines the 
> maximul number
> of requests that can be processed in parallel. (I implemented the
> Parameterizable interface, to get the parameter value.)
> 
> <map:action logger="bgpm" name="bgpm"
> src="bgpm.acting.BackgroundProcessManager">
> 
>     <parameter name="max_parallel_bgps" value="3"/>
> 
> </map:action>
> 
> 
> When I change the parameter while requests are processed, I 
> encounter an
> 
> "IllegalStateException. You cannot lookup components on a disposed
> ComponentLocator".
> 
> Okay, one solution whould be, not to change the parameter 
> while requests are
> processed.
>  However this is not the best solution.
> 
> Does anybody have a better solution. What the right way to do ist?
> can somebody explain the Background of this Exception? Why is 
> it thrown?
> 
> Regards,
> 
> Stephanie
> 
> -- 
> NEU F�R ALLE - GMX MediaCenter - f�r Fotos, Musik, Dateien...
> Fotoalbum, File Sharing, MMS, Multimedia-Gru�, GMX FotoService
> 
> Jetzt kostenlos anmelden unter http://www.gmx.net
> 
> +++ GMX - die erste Adresse f�r Mail, Message, More! +++
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to