Accessing App Context from a CronJob

2005-08-02 Thread Owen Tallman
Hello, From a CronJob componentI need to access our ApplicationContext object which gets initialized by a ServletContextListener before Cocoon starts. If this were a sitemap component, it would have a setup method that got called with an ObjectModel map, so I could call

Re: Accessing App Context from a CronJob

2005-08-02 Thread footh
Try implementing the Contextualizable interface which will give you the Avalon context. Then call the getObjectModel static method of the ContextHelper class and pass in the Avalon context. From there you can use your ObjectModelHelper, or just retrieve the object returned in the Map that is

Re: Accessing App Context from a CronJob

2005-08-02 Thread Owen Tallman
Excellent! I don't know how long I would have had to grope around to figure that out. Thanks! For the record, here's a code snippet of the working result, after adding the Contextualizable interface: // org.apache.cocoon.environment.Context (not Avalon context) private Context

Re: Accessing App Context from a CronJob

2005-08-02 Thread footh
no problem, I spent many hours over the last week poring over documents and code to figure out something very similar. The least I could do was spare someone else the headache (although I did learn alot). --- Owen Tallman [EMAIL PROTECTED] wrote: Excellent! I don't know how long I would have