Skip to content
Advertisement

How to add Quartz JobListener

I am writing a java/spring library to include in other projects that are using quartz. I need it to log something before each task is executed.

I have a simple JobListener that looks like this:

JavaScript

I know we can do something like this to add joblisteners:

JavaScript

But how can I get the scheduler to add so I can add the listener?

I have tried implementing the SchedulerFactoryBeanCustomizer but can’t figure out how to add the listener (since the scheduler is not created yet?)

Advertisement

Answer

You can add a Postconstruct and add JobListener there.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement