Package de.xima.fc.timing
Class CdiAwareJobFactory
- java.lang.Object
-
- de.xima.fc.timing.CdiAwareJobFactory
-
- All Implemented Interfaces:
org.quartz.spi.JobFactory
public class CdiAwareJobFactory extends Object implements org.quartz.spi.JobFactory
A custom implementation of the Quartz `JobFactory` that integrates with CDI (Contexts and Dependency Injection). This factory creates job instances, either directly or as CDI-managed beans, depending on the job class annotations.
-
-
Constructor Summary
Constructors Constructor Description CdiAwareJobFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.quartz.JobnewJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler)Creates a new job instance.
-
-
-
Method Detail
-
newJob
public org.quartz.Job newJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler) throws org.quartz.SchedulerExceptionCreates a new job instance. If the job class is a CDI bean, it is instantiated using the CDI container. Otherwise, the job instance is created directly using reflection.- Specified by:
newJobin interfaceorg.quartz.spi.JobFactory- Parameters:
bundle- The `TriggerFiredBundle` containing the job details.scheduler- The Quartz `Scheduler` instance.- Returns:
- The created job instance.
- Throws:
org.quartz.SchedulerException- If the job instance cannot be created.
-
-