How to stop quartz scheduler externally which is running from main method
executable-jar, jar, java, quartz-scheduler
Solution
Use `new StdSchedulerFactory().getScheduler()` in the Other thread to obtain a reference to the scheduler started in the Main thread.
Why does this work? Invocations of StdSchedulerFactory#getScheduler on both factory instances use the same SchedulerRepository singleton that contains a map of all running quartz schedulers, which in this case is just the default scheduler.
Problem
``` public static void main(String[] test) { try { JobKey jobKeyA = new JobKey("JobAssignVehicleDailyrideFixedVehicle", "group1"); JobDetail jobA = JobBuilder.newJob(JobAssignVehicleDailyrideFixedVehicle.class) .withIdentity(jobKeyA).build(); Trigger trigger1 = TriggerBuilder .newTrigger() .withIdentity("Trigger1", "group1") .withSchedule( CronScheduleBuilder.cronSchedule("0/5 * * * * ?")) .build(); scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); scheduler.scheduleJob(jobA, trigger1); } catch (SchedulerException e) { logger.error(e); } } ``` I am running this method from main class from jar file. How can i shutdown quartz properly without just terminating java processes. Is there a way to call shutdown method on scheduler for current running quartz