/** * @see org.quartz.spi.JobStore#schedulerStarted() */ public void schedulerStarted() throws SchedulerException { if (isClustered()) { clusterManagementThread = new ClusterManager(); if(initializersLoader != null) clusterManagementThread.setContextClassLoader(initializersLoader); clusterManagementThread.initialize(); } else { try { recoverJobs(); } catch (SchedulerException se) { throw new SchedulerConfigException( "Failure occured during job recovery.", se); } } misfireHandler = new MisfireHandler(); if(initializersLoader != null) misfireHandler.setContextClassLoader(initializersLoader); misfireHandler.initialize(); schedulerRunning = true; getLog().debug("JobStore background threads started (as scheduler was started)."); }
@Override public void run() { while (!shutdown) { long sTime = System.currentTimeMillis(); RecoverMisfiredJobsResult recoverMisfiredJobsResult = manage(); if (recoverMisfiredJobsResult.getProcessedMisfiredTriggerCount() > 0) { signalSchedulingChangeImmediately(recoverMisfiredJobsResult.getEarliestNewTime()); } if (!shutdown) { long timeToSleep = 50l; // At least a short pause to help balance threads if (!recoverMisfiredJobsResult.hasMoreMisfiredTriggers()) { timeToSleep = getMisfireThreshold() - (System.currentTimeMillis() - sTime); if (timeToSleep <= 0) { timeToSleep = 50l; } if(numFails > 0) { timeToSleep = Math.max(getDbRetryInterval(), timeToSleep); } } try { Thread.sleep(timeToSleep); } catch (Exception ignore) { } }//while !shutdown } } }
public void run() { while (!shutdown) { long sTime = System.currentTimeMillis(); RecoverMisfiredJobsResult recoverMisfiredJobsResult = manage(); if (recoverMisfiredJobsResult.getProcessedMisfiredTriggerCount() > 0) { signalSchedulingChange(recoverMisfiredJobsResult.getEarliestNewTime()); } if (!shutdown) { long timeToSleep = 50l; // At least a short pause to help balance threads if (!recoverMisfiredJobsResult.hasMoreMisfiredTriggers()) { timeToSleep = getMisfireThreshold() - (System.currentTimeMillis() - sTime); if (timeToSleep <= 0) { timeToSleep = 50l; } if(numFails > 0) { timeToSleep = Math.max(getDbRetryInterval(), timeToSleep); } } try { Thread.sleep(timeToSleep); } catch (Exception ignore) { } }//while !shutdown } } }
public void run() { while (!shutdown) { long sTime = System.currentTimeMillis(); RecoverMisfiredJobsResult recoverMisfiredJobsResult = manage(); if (recoverMisfiredJobsResult.getProcessedMisfiredTriggerCount() > 0) { signalSchedulingChange(recoverMisfiredJobsResult.getEarliestNewTime()); } if (!shutdown) { long timeToSleep = 50l; // At least a short pause to help balance threads if (!recoverMisfiredJobsResult.hasMoreMisfiredTriggers()) { timeToSleep = getMisfireThreshold() - (System.currentTimeMillis() - sTime); if (timeToSleep <= 0) { timeToSleep = 50l; } if(numFails > 0) { timeToSleep = Math.max(getDbRetryInterval(), timeToSleep); } } try { Thread.sleep(timeToSleep); } catch (Exception ignore) { } }//while !shutdown } } }
/** * @see org.quartz.spi.JobStore#schedulerStarted() */ public void schedulerStarted() throws SchedulerException { if (isClustered()) { clusterManagementThread = new ClusterManager(); if(initializersLoader != null) clusterManagementThread.setContextClassLoader(initializersLoader); clusterManagementThread.initialize(); } else { try { recoverJobs(); } catch (SchedulerException se) { throw new SchedulerConfigException( "Failure occured during job recovery.", se); } } misfireHandler = new MisfireHandler(); if(initializersLoader != null) misfireHandler.setContextClassLoader(initializersLoader); misfireHandler.initialize(); }
/** * @see org.quartz.spi.JobStore#schedulerStarted() */ public void schedulerStarted() throws SchedulerException { if (isClustered()) { clusterManagementThread = new ClusterManager(); if(initializersLoader != null) clusterManagementThread.setContextClassLoader(initializersLoader); clusterManagementThread.initialize(); } else { try { recoverJobs(); } catch (SchedulerException se) { throw new SchedulerConfigException( "Failure occured during job recovery.", se); } } misfireHandler = new MisfireHandler(); if(initializersLoader != null) misfireHandler.setContextClassLoader(initializersLoader); misfireHandler.initialize(); }
/** * <p> * Called by the QuartzScheduler to inform the <code>JobStore</code> that * it should free up all of it's resources because the scheduler is * shutting down. * </p> */ public void shutdown() { if (clusterManagementThread != null) { clusterManagementThread.shutdown(); } if (misfireHandler != null) { misfireHandler.shutdown(); } try { DBConnectionManager.getInstance().shutdown(getDataSource()); } catch (SQLException sqle) { getLog().warn("Database connection shutdown unsuccessful.", sqle); } }
/** * <p> * Called by the QuartzScheduler to inform the <code>JobStore</code> that * it should free up all of it's resources because the scheduler is * shutting down. * </p> */ public void shutdown() { if (clusterManagementThread != null) { clusterManagementThread.shutdown(); } if (misfireHandler != null) { misfireHandler.shutdown(); } try { DBConnectionManager.getInstance().shutdown(getDataSource()); } catch (SQLException sqle) { getLog().warn("Database connection shutdown unsuccessful.", sqle); } }
public void shutdown() { shutdown = true; this.interrupt(); }
public void initialize() { //this.manage(); this.start(); }
public void shutdown() { shutdown = true; this.interrupt(); }
public void initialize() { //this.manage(); this.start(); }
@Override public void run() { while (!shutdown) { long sTime = System.currentTimeMillis(); RecoverMisfiredJobsResult recoverMisfiredJobsResult = manage(); if (recoverMisfiredJobsResult.getProcessedMisfiredTriggerCount() > 0) { signalSchedulingChangeImmediately(recoverMisfiredJobsResult.getEarliestNewTime()); } if (!shutdown) { long timeToSleep = 50l; // At least a short pause to help balance threads if (!recoverMisfiredJobsResult.hasMoreMisfiredTriggers()) { timeToSleep = getMisfireThreshold() - (System.currentTimeMillis() - sTime); if (timeToSleep <= 0) { timeToSleep = 50l; } if(numFails > 0) { timeToSleep = Math.max(getDbRetryInterval(), timeToSleep); } } try { Thread.sleep(timeToSleep); } catch (Exception ignore) { } }//while !shutdown } } }
/** * @see org.quartz.spi.JobStore#schedulerStarted() */ public void schedulerStarted() throws SchedulerException { if (isClustered()) { clusterManagementThread = new ClusterManager(); if(initializersLoader != null) clusterManagementThread.setContextClassLoader(initializersLoader); clusterManagementThread.initialize(); } else { try { recoverJobs(); } catch (SchedulerException se) { throw new SchedulerConfigException( "Failure occured during job recovery.", se); } } misfireHandler = new MisfireHandler(); if(initializersLoader != null) misfireHandler.setContextClassLoader(initializersLoader); misfireHandler.initialize(); schedulerRunning = true; getLog().debug("JobStore background threads started (as scheduler was started)."); }
public void shutdown() { shutdown = true; this.interrupt(); }
public void shutdown() { shutdown = true; this.interrupt(); }