public Quartz with ( final Class < ? extends Job > jobClass , final BiConsumer < JobBuilder , TriggerBuilder < Trigger > > configurer ) { requireNonNull ( jobClass , "Job class is required." ) ; JobBuilder job = JobBuilder . newJob ( jobClass ) . withIdentity ( JobKey . jobKey ( jobClass . getSimpleName ( ) , jobClass . getPackage ( ) . getName ( ) ) ) ; TriggerBuilder < Trigger > trigger = TriggerBuilder . newTrigger ( ) . withIdentity ( TriggerKey . triggerKey ( jobClass . getSimpleName ( ) , jobClass . getPackage ( ) . getName ( ) ) ) ; configurer . accept ( job , trigger ) ; return with ( job . build ( ) , trigger . build ( ) ) ; }
Schedule the provided job and trigger . This method will setup a default name and group for both .