cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [RT] Making Cocoon instance available to other components
Date Fri, 29 Nov 2002 16:46:22 GMT
Bruno Dumon wrote:

>I'm thinking about making some Avalon component (managed by Cocoon's
>ECM) which would start its own thread. From that thread, I would like it
>to send requests to Cocoon (directly, not over HTTP). So I guess I would
>need access to the Cocoon instance (a protected variable in the
>CocoonServlet), and implement some appropriate environment classes.
>The problem in the above scenario is that there is currently, AFAIK, no
>possibility to get access to the Cocoon object. So I was thinking, since
>the Cocoon class itself is already an Avalon component, it could be made
>available via Composable (using a small parent component manager or an
>extra check in the lookup method of the CocoonComponentManager).
>So some quick yes/no questions:
> - Am I correct that there is indeed no way in which a seperate thread
>can send requests directly to cocoon? (I now there is the cocoon:
>protocol, but I thought that only works inside the request-handling
>thread, and I would need access to a SourceResolver for that)
> - Does anyone see conceptual problems with making the Cocoon object (or
>in fact the Processor interface) publicly available?

The Cocoon object is an Avalon component, but in fact doesn't need to be 
: it is conceptually a container, which loads the configuration, creates 
an ECM and delegates the implementation of the Processor interface to 
the component implementing this interface that is managed by the ECM 
(look at Cocoon.process()).

So what you are looking for may be simply looking up the Processor role 
in the ECM that manages your component, which will return the sitemap 
engine, and call process() on that object.

Hope this helps,

Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

To unsubscribe, e-mail:
For additional commands, email:

View raw message