PDA

View Full Version : Scheduler and Service Layer



fmourioux
Oct 19th, 2004, 07:46 AM
hi,

i need to manage the scheduler from my service layer in order to add, remove / modify jobs which are define in the applicationContexte.xml file.

How to pass a ref of the scheduler to my manager ?

Thanks,

Fabien

pietercoucke
Oct 20th, 2004, 05:30 AM
You probably have something like this in your XML:



<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFac toryBean">

The SchedulerFactoryBean implements the FactoryBean interface, which means that instead of returning an instance of that class, it creates new objects.

So you can just use
context.getBean&#40;"scheduler"&#41;
The returned instance will be of type StdSchedulerFactory, unless you specify another one with the property schedulerFactoryClass.