Class CdiAwareJobFactory
java.lang.Object
de.xima.fc.timing.CdiAwareJobFactory
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionorg.quartz.JobnewJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler) Creates a new job instance.
-
Constructor Details
-
CdiAwareJobFactory
public CdiAwareJobFactory()
-
-
Method Details
-
newJob
public org.quartz.Job newJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler) throws org.quartz.SchedulerException Creates 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.
-