You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ricky Szeto <rs...@cryptologic.com> on 2000/01/31 23:47:07 UTC

Re: Cocoon Question...

Hmm... maybe a better question to ask is this..

Are producers created once and used over and over again for all? or are
they just throw-away objects that are disgarded after the execution of
the request?

What I originally assumed, was that the producers are kept and reused.
That is why I wanted to have it get a properties list to know where to
load up action handler classes(non-producers) that it can delegate
operations to instead of doing them all by itself or having several
producers doing these jobs. If producers where throw-away objects, then
this design would be very undesireable, as a producer would be loading
several action handlers for each request(while only using 1 of them) and
then being discarded after the request is fulfilled.

Any thoughts?


Re: Cocoon Question...

Posted by Mike Engelhart <me...@earthtrip.com>.
Ricky Szeto wrote:

> Hmm... maybe a better question to ask is this..
> 
> Are producers created once and used over and over again for all? or are
> they just throw-away objects that are disgarded after the execution of
> the request?
> 
> What I originally assumed, was that the producers are kept and reused.
> That is why I wanted to have it get a properties list to know where to
> load up action handler classes(non-producers) that it can delegate
> operations to instead of doing them all by itself or having several
> producers doing these jobs. If producers where throw-away objects, then
> this design would be very undesireable, as a producer would be loading
> several action handlers for each request(while only using 1 of them) and
> then being discarded after the request is fulfilled.
> 
> Any thoughts?

No, you're right, they are not throw-away objects. I would try overriding
init() (see the org.apache.cocoon.framework.* API documentation.  Every
object that implements Actor gets it's init() method called when the object
is created so since AbstractProducer and Producer both implement init(), you
can override it to add your property information to the Producer.  Also see
the Configurable interface if you want it to read in properties files.  You
can then just have your producers implement Configurable and override the
init(Configurations conf) method..

Mike