|
|
|
After some debugging, I found out, that the problem ist not the BeanFactory being destroyed, but rather the scheduler being destroyed because it is registered as a dependency to the <MyJobClass>Trigger class (see methods registerDependentBean() and destroySingleton() of org.springframework.beans.factory.support.DefaultSingletonBeanRegistry).
The solution is to avoid these dependencies by delaying the registration of the job triggers. The attached patch registers the job triggers in doWithApplicationContext() instead of doWithSpring(). Changed and newly created jobs are now created/updated correctly without the scheduler being shut down. One issue remains: If an existing job is deleted (e.g: rm grails-app/jobs/MyJob.groovy), the job will still be running. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When the job class is reloaded, the bean factory, which created the scheduler is destroyed. This leads to the scheduler being shut down, which in turn prohibits (re-)scheduling jobs.
This happens in QuartzGrailsPlugin.groovy:123:
def onChange = { event ->
...
event.ctx.registerBeanDefinition("${fullName}", beans.getBeanDefinition("${fullName}"))
...
}