Пример #1
0
 @After
 public void after() throws Exception {
   if (taskSchedulerHelper != null) {
     taskSchedulerHelper.stop();
     taskSchedulerHelper = null;
   }
 }
Пример #2
0
 protected Scheduler createScheduler(String name, int threadPoolSize) throws SchedulerException {
   try {
     this.taskSchedulerHelper = new TaskSchedulerHelper(database.getInstance());
     this.taskSchedulerHelper.init(threadPoolSize, new SimpleJobFactory());
     this.taskSchedulerHelper.start();
     return ((QuartzSchedulerSPI) taskSchedulerHelper.getScheduler()).getScheduler();
   } catch (Exception e) {
     throw Throwables.propagate(e);
   }
 }