<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Quartz on Pandurang Patil</title><link>https://www.pandurangpatil.com/tags/quartz/</link><description>Recent content in Quartz on Pandurang Patil</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 27 Apr 2014 10:37:00 -0700</lastBuildDate><atom:link href="https://www.pandurangpatil.com/tags/quartz/index.xml" rel="self" type="application/rss+xml"/><item><title>Quartz Scheduler with Google Guice</title><link>https://www.pandurangpatil.com/post/2014-04-27-quartz-scheduler-with-google-guice/</link><pubDate>Sun, 27 Apr 2014 10:37:00 -0700</pubDate><guid>https://www.pandurangpatil.com/post/2014-04-27-quartz-scheduler-with-google-guice/</guid><description>To integrate Quartz with Guice. One can follow below steps. The most important part is, we should be able to inject dependencies inside Job.
To provide injectable Scheduler Instance we need to write Scheduler provider as follows:
import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.impl.StdSchedulerFactory; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; /** * @author Pandurang Patil 27-Apr-2014 * */ @Singleton public class SchedulerProvider implements Provider&amp;lt;Scheduler&amp;gt; { private Scheduler scheduler; @Inject public SchedulerProvider(SchedulerJobFactory jobFactory) throws SchedulerException { scheduler = new StdSchedulerFactory().</description></item></channel></rss>