You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kalle Korhonen <ka...@gmail.com> on 2010/07/12 23:08:04 UTC

Re: Quartz Job setup with JobDetails requires parameter free constructor - how to inject Service bindings

You create a JobSchedulingBundle (service), create a JobDataMap in it,
add all the services to the map you need in your Job and then then get
the map via executionContext.getMergedJobDataMap(). The concept behind
JobDataMap is solid but you could arguably make a tighter and
easier-to-use Tapestry-specific integration for Quartz. I'd love to be
able to do just:
configuration.add("0 0 0 * * ?", myJob);

But I'm too lazy/busy to work on it myself since even the current
Chenillekit-provided integration works fine with the expense of a few
redundant lines of code.

Kalle


make On Mon, Jul 12, 2010 at 1:20 PM, Daniel Henze
<dh...@googlemail.com> wrote:
> Hi there,
>
> I am using chenillekit-quartz integration and followed the example setup on
> the module homepage
> (http://chenillekit.codehaus.org/chenillekit-quartz/index.html). All good so
> far, got things up and running. But now I want to run a job that has other
> services (DAO, MailService) as dependencies. Setup is done via JobDetails
> class which uses a parameter free constructor to instantiate the
> implementation of an Interface:
>
> new JobDetail("MailSenderJob", null, MailSenderJob.class)
>
> I tried binding that clas (MailSenderJob) with build method in Application
> module and @Inject annotation, but nothing did work, always getting a
> NullpointerException when it comes to that service. I also could not find a
> JobDetail constructor that allows for setting dependencies, but no luck.
>
> How can I get the service dependencies in MailSenderJob set up since Quartz
> does only use default constructor?
>
> Thankful for any hints
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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