@Test @SuppressWarnings("resource") public void schedulerAutoStartupFalse() throws Exception { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(SchedulerFactoryBean.class) .addPropertyValue("autoStartup", false).getBeanDefinition(); context.registerBeanDefinition("scheduler", beanDefinition); Scheduler bean = context.getBean("scheduler", Scheduler.class); assertFalse(bean.isStarted()); context.refresh(); assertFalse(bean.isStarted()); }
@Test @SuppressWarnings("resource") public void schedulerAutoStartsOnContextRefreshedEventByDefault() throws Exception { StaticApplicationContext context = new StaticApplicationContext(); context.registerBeanDefinition("scheduler", new RootBeanDefinition(SchedulerFactoryBean.class)); Scheduler bean = context.getBean("scheduler", Scheduler.class); assertFalse(bean.isStarted()); context.refresh(); assertTrue(bean.isStarted()); }
scheduler.startAsync(); scheduler.awaitRunning(10, TimeUnit.SECONDS); Assert.assertTrue(scheduler._scheduler.getScheduler().isStarted());
public boolean isStarted() { boolean started = false; try { started = this.scheduler != null && this.scheduler.isStarted(); } catch (SchedulerException e) { //ignore } return started; }
@Override public boolean isRunning() { try { return scheduler.isStarted(); } catch (SchedulerException e) { return false; } }
@Override public boolean isSchedulerStarted() { try { return quartzScheduler != null && quartzScheduler.isStarted(); } catch (SchedulerException e) { return false; } }
@Override public boolean isRunning() { try { return scheduler.isStarted(); } catch (SchedulerException e) { return false; } }
@Override public boolean isRunning() { try { return scheduler.isStarted(); } catch (SchedulerException e) { log.debug("Failed to find if the scheduler is running", e); } return false; } }
@Override public boolean isRunning() { try { return scheduler.isStarted(); } catch (SchedulerException e) { log.debug("Failed to find if the scheduler is running", e); } return false; } }
@Override public boolean isStarted() throws QuartzException { try { return delegate.isStarted(); } catch (SchedulerException e) { throw new QuartzException(e); } }
public boolean isStarted() { try { return scheduler.isStarted(); } catch (SchedulerException e) { throw new QuartzRuntimeException(e); } }
@Override public boolean isStarted() throws QuartzException { try { return delegate.isStarted(); } catch (SchedulerException e) { throw new QuartzException(e); } }
/** * Check if the scheduler is started. * * @throws JobSchedulerException thrown if the scheduler status cannot be checked */ public boolean isStarted() throws JobSchedulerException { try { return scheduler.isStarted(); } catch (SchedulerException e) { throw new JobSchedulerException("An exception occurred during checking if the scheduler is started", e); } }
public boolean isStarted() throws MuleException { try { return quartzScheduler.isStarted(); } catch (SchedulerException e) { throw new DefaultMuleException(couldNotGetSchedulerStatus(), e); } }
@Override public boolean isStarted() throws SSchedulerException { try { return scheduler != null && scheduler.isStarted() && !scheduler.isShutdown(); } catch (final SchedulerException e) { throw new SSchedulerException(e); } }
private void assertStarted() { try { synchronized (lock) { if (!scheduler.isStarted()) { throw new SynapseTaskException("Scheduler has not been started yet", logger); } } } catch (SchedulerException e) { throw new SynapseTaskException("Error determine start state of the scheduler ", e, logger); } }
@Override public boolean isStarted() throws SSchedulerException { try { return scheduler != null && scheduler.isStarted() && !scheduler.isShutdown(); } catch (final SchedulerException e) { throw new SSchedulerException(e); } }
@Test public void testSimple() throws Exception { final Scheduler scheduler = injector.getInstance(Scheduler.class); Assert.assertNotNull(scheduler); Assert.assertFalse(scheduler.isStarted()); }
protected void removeJob(String jobID) { if (scheduler == null) return; JobKey triggerKey = new JobKey(jobID); try { if (scheduler.isStarted() && !scheduler.isShutdown() && scheduler.checkExists(triggerKey)) { scheduler.deleteJob(triggerKey); } } catch (SchedulerException e) { logger.error("Failed to delete job " + jobID, e); } }
private Boolean isQuartzSchedulerRunning() { Scheduler quartzScheduler = getGlobalExecutionManager().getQuartzScheduler(); if (quartzScheduler == null) { return null; } try { return quartzScheduler.isStarted() && !quartzScheduler.isInStandbyMode() && !quartzScheduler.isShutdown(); } catch (SchedulerException e) { LoggingUtils.logUnexpectedException(LOGGER, "Cannot determine Quartz scheduler state", e); return null; } }