Spring 2.5 and quartz 1.6.2 how to use

581 Views Asked by At

in our project we use spring 2.5 and i cannot change it. At the same time this version has inbuilt quartz library version 1.6.2

and now I'm trying to crete some scheduled tasks using this inbuilt lib, but it doesn't seem to work, I also cannot find any docs for this library.

I have two questions

First - is it possible to use quartz of higher version, if yes, how do I use in conjunction with Spring?

Second - why there is no docs for quartz 1.6.2 anywhere((

1

There are 1 best solutions below

0
On

I am not sure about the bundled version of Spring coming with Quartz. But you can solve your problem by simply injecting the scheduler into your Beans.

 <bean id="scheduler" class="org.quartz.impl.StdSchedulerFactory" factory-method="getDefaultScheduler">

Create a wrapper over Quartz and inject this bean in the wrapper. Also make sure you have an init method for starting the scheduler.

<bean id="QuartzManager" init-method="startScheduler" class="com.test.YourWrapperQuartzManager" destroy-method="shutDownScheduler">
        <property name="quartzScheduler" ref="scheduler"/>
    </bean>