List of usage examples for org.springframework.scheduling.quartz SchedulerFactoryBean getScheduler
@Override
public Scheduler getScheduler()
From source file:org.openmeetings.cli.Admin.java
private void shutdownScheduledJobs(String ctxName) throws SchedulerException { SchedulerFactoryBean sfb = getApplicationContext(ctxName).getBean(SchedulerFactoryBean.class); sfb.getScheduler().shutdown(false); }
From source file:org.apache.fineract.infrastructure.jobs.service.JobRegisterServiceImpl.java
private Scheduler createScheduler(final String name, final int noOfThreads, JobListener... jobListeners) throws Exception { final SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); schedulerFactoryBean.setSchedulerName(name); schedulerFactoryBean.setGlobalJobListeners(jobListeners); final TriggerListener[] globalTriggerListeners = { globalSchedulerTriggerListener }; schedulerFactoryBean.setGlobalTriggerListeners(globalTriggerListeners); final Properties quartzProperties = new Properties(); quartzProperties.put(SchedulerFactoryBean.PROP_THREAD_COUNT, Integer.toString(noOfThreads)); schedulerFactoryBean.setQuartzProperties(quartzProperties); schedulerFactoryBean.afterPropertiesSet(); schedulerFactoryBean.start();/*from ww w . j av a2s . c o m*/ return schedulerFactoryBean.getScheduler(); }
From source file:org.apache.openmeetings.cli.Admin.java
private WebApplicationContext getApplicationContext() { if (ctx == null) { Long lngId = StringValue.valueOf(cfg.defaultLangId).toLong(1L); ctx = ApplicationHelper.getApplicationContext(lngId); SchedulerFactoryBean sfb = ctx.getBean(SchedulerFactoryBean.class); try {//from ww w. j ava 2 s .c om sfb.getScheduler().shutdown(false); } catch (Exception e) { handleError("Unable to shutdown schedulers", e); } } return ctx; }