On 08.Mar.2002 -- 11:37 AM, Leo Sutic wrote:
> Berin,
> 
> this may be something that's needed for the ContainerManager.
> 
>     <component role="quux" handler="..."/>
> 
>     <component role="foo" handler="...">
>         <instance xyz/>
>     </component>
> 
>     <component role="bar" handler="barhandler" depends="foo,quux">
>         <instance abc/> <!-- needs foo for setup -->
>     </component>
> 

If the order would be preserved (e.g. if BucketMap would keep keys in
a list as well), it might be easier than to do the necessary
topological sorting. Would make add / remove operations a bit more
expensive, though.

I've tried to do it but wasn't successful. Think, I would need to spend
much more time on understanding BucketMap than I have to make it work :-( 

> >
> > Is it possible to have components that depend on others from the same
> > configuration file? Like
> >
> >    <component foo>
> >        <instance xyz/>
> >    </compopnent foo>
> >
> >    <component bar>
> >        <instance abc/> <!-- needs foo for setup -->
> >    </component bar>
> 
> Christian,
> 
> The only solution I can think of is that you use lazy initialization in bar.
> For every method you expose through bar's interface, call a synchronized
> setup() method that will set up the component if it has not been done yet.
> 
> Use the compose(), configure() and contextualize() method just to get
> references
> to the CM, config and context, and store them in member variables so setup()
> can use them.

Thanks Leo,

actually, I discovered this behaviour because Cocoon ignores it and it
breaks for me. Interestingly enough, we got away with it for a long
time now.

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

Reply via email to