Hello. Ralph Goers a écrit :
The easiest answer is to tell you to look at the FileGenerator. It is cacheable and poolable.
My generator have the same skeleton, i've just copied the file ;)
When components (such as generators) are pooled they are first initialized by calling the lifecycle methods you have declared, such as service, configure, etc. The service method simply gives you access to the service manager. If you need this then just extend ServiceableGenerator.
That's what i've done.
Each time the generator is used its setup method is called first. This should be as light as possible. They validity methods will then be called to determine if the cached version can be used. If it cannot, the generate method is then called.
I've read the Wiki "Writing cache for efficiency", who explain that very well IMHO.
You only need to use the Disposable interface (and thus the dispose() method) if you acquire a resource from the service manager that must be released when your generator is freed by the component manager. If you acquire resources during the generate method they should be released there.
ok, the dispose() comes from interface Disposable() from avalon framework then?
BTW - these principals apply to most Avalon based components, not just generators.
I've just discovered http://cocoon.zones.apache.org/daisy/documentation/g2/610.html
Thanks for all your answer.
HTH Ralph
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
