cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From footh <fo...@yahoo.com>
Subject Re: Accessing App Context from a CronJob
Date Tue, 02 Aug 2005 18:29:48 GMT
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 under
the "context" key.

--- Owen Tallman <owen.tallman@gmail.com> wrote:

> 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
> 
> ObjectModelHelper.getContext(objectModel);
> 
> The class I defined has this derivation:
> 
> public class FakeJob extends ServiceableCronJob
>                          implements Configurable,
> ConfigurableCronJob { ...
> 
> 
> it has a setup() method which takes  parameters and
> a map, but if I
> don't initialize the job entry with them, they don't
> have any values. 
> How can I access the context from a component like
> this?
> 
> Thanks in advance for any suggestions,
> 
> Owen
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
> 
> 



		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message