/** * Recover any failed or misfired jobs and clean up the data store as * appropriate. * * @throws JobPersistenceException if jobs could not be recovered */ protected void recoverJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void executeVoid(Connection conn) throws JobPersistenceException { recoverJobs(conn); } }, null); }
/** * Recover any failed or misfired jobs and clean up the data store as * appropriate. * * @throws JobPersistenceException if jobs could not be recovered */ protected void recoverJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void executeVoid(Connection conn) throws JobPersistenceException { recoverJobs(conn); } }, null); }
return executeInNonManagedTXLock(LOCK_TRIGGER_ACCESS, new TransactionCallback<List<TriggerFiredResult>>() { public List<TriggerFiredResult> execute(Connection conn) throws JobPersistenceException {
return executeInNonManagedTXLock(LOCK_TRIGGER_ACCESS, new TransactionCallback<List<TriggerFiredResult>>() { public List<TriggerFiredResult> execute(Connection conn) throws JobPersistenceException {
lockName = null; return executeInNonManagedTXLock(lockName, new TransactionCallback<List<OperableTrigger>>() { public List<OperableTrigger> execute(Connection conn) throws JobPersistenceException {
protected <T> T retryExecuteInNonManagedTXLock(String lockName, TransactionCallback<T> txCallback) { for (int retry = 1; !shutdown; retry++) { try { return executeInNonManagedTXLock(lockName, txCallback, null); } catch (JobPersistenceException jpe) { if(retry % 4 == 0) { schedSignaler.notifySchedulerListenersError("An error occurred while " + txCallback, jpe); } } catch (RuntimeException e) { getLog().error("retryExecuteInNonManagedTXLock: RuntimeException " + e.getMessage(), e); } try { Thread.sleep(getDbRetryInterval()); // retry every N seconds (the db connection must be failed) } catch (InterruptedException e) { throw new IllegalStateException("Received interrupted exception", e); } } throw new IllegalStateException("JobStore is shutdown - aborting retry"); }
protected <T> T retryExecuteInNonManagedTXLock(String lockName, TransactionCallback<T> txCallback) { for (int retry = 1; !shutdown; retry++) { try { return executeInNonManagedTXLock(lockName, txCallback, null); } catch (JobPersistenceException jpe) { if(retry % 4 == 0) { schedSignaler.notifySchedulerListenersError("An error occurred while " + txCallback, jpe); } } catch (RuntimeException e) { getLog().error("retryExecuteInNonManagedTXLock: RuntimeException " + e.getMessage(), e); } try { Thread.sleep(getDbRetryInterval()); // retry every N seconds (the db connection must be failed) } catch (InterruptedException e) { throw new IllegalStateException("Received interrupted exception", e); } } throw new IllegalStateException("JobStore is shutdown - aborting retry"); }
lockName = null; return executeInNonManagedTXLock(lockName, new TransactionCallback<List<OperableTrigger>>() { public List<OperableTrigger> execute(Connection conn) throws JobPersistenceException {
/** * Removes all volatile data. * * @throws JobPersistenceException If jobs could not be recovered. */ protected void cleanVolatileTriggerAndJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { cleanVolatileTriggerAndJobs(conn); } }); }
/** * <p> * Inform the <code>JobStore</code> that the scheduler no longer plans to * fire the given <code>Trigger</code>, that it had previously acquired * (reserved). * </p> */ public void releaseAcquiredTrigger(final SchedulingContext ctxt, final Trigger trigger) throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { releaseAcquiredTrigger(conn, ctxt, trigger); } }); }
/** * Recover any failed or misfired jobs and clean up the data store as * appropriate. * * @throws JobPersistenceException if jobs could not be recovered */ protected void recoverJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { recoverJobs(conn); } }); }
/** * Removes all volatile data. * * @throws JobPersistenceException If jobs could not be recovered. */ protected void cleanVolatileTriggerAndJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { cleanVolatileTriggerAndJobs(conn); } }); }
/** * Recover any failed or misfired jobs and clean up the data store as * appropriate. * * @throws JobPersistenceException if jobs could not be recovered */ protected void recoverJobs() throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { recoverJobs(conn); } }); }
/** * <p> * Inform the <code>JobStore</code> that the scheduler no longer plans to * fire the given <code>Trigger</code>, that it had previously acquired * (reserved). * </p> */ public void releaseAcquiredTrigger(final SchedulingContext ctxt, final Trigger trigger) throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { releaseAcquiredTrigger(conn, ctxt, trigger); } }); }
/** * <p> * Get a handle to the next N triggers to be fired, and mark them as 'reserved' * by the calling scheduler. * </p> * * @see #releaseAcquiredTrigger(SchedulingContext, Trigger) */ public Trigger acquireNextTrigger(final SchedulingContext ctxt, final long noLaterThan) throws JobPersistenceException { return (Trigger)executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new TransactionCallback() { public Object execute(Connection conn) throws JobPersistenceException { return acquireNextTrigger(conn, ctxt, noLaterThan); } }); }
/** * <p> * Inform the <code>JobStore</code> that the scheduler has completed the * firing of the given <code>Trigger</code> (and the execution its * associated <code>Job</code>), and that the <code>{@link org.quartz.JobDataMap}</code> * in the given <code>JobDetail</code> should be updated if the <code>Job</code> * is stateful. * </p> */ public void triggeredJobComplete(final SchedulingContext ctxt, final Trigger trigger, final JobDetail jobDetail, final int triggerInstCode) throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { triggeredJobComplete(conn, ctxt, trigger, jobDetail,triggerInstCode); } }); }
/** * <p> * Inform the <code>JobStore</code> that the scheduler has completed the * firing of the given <code>Trigger</code> (and the execution its * associated <code>Job</code>), and that the <code>{@link org.quartz.JobDataMap}</code> * in the given <code>JobDetail</code> should be updated if the <code>Job</code> * is stateful. * </p> */ public void triggeredJobComplete(final SchedulingContext ctxt, final Trigger trigger, final JobDetail jobDetail, final int triggerInstCode) throws JobPersistenceException { executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new VoidTransactionCallback() { public void execute(Connection conn) throws JobPersistenceException { triggeredJobComplete(conn, ctxt, trigger, jobDetail,triggerInstCode); } }); }
/** * Execute the given callback having optionally aquired the given lock. * This uses the non-managed transaction connection. This version is just a * handy wrapper around executeInNonManagedTXLock that doesn't require a return * value. * * @param lockName The name of the lock to aquire, for example * "TRIGGER_ACCESS". If null, then no lock is aquired, but the * lockCallback is still executed in a non-managed transaction. * * @see #executeInNonManagedTXLock(String, TransactionCallback) */ protected void executeInNonManagedTXLock( final String lockName, final VoidTransactionCallback txCallback) throws JobPersistenceException { executeInNonManagedTXLock( lockName, new TransactionCallback() { public Object execute(Connection conn) throws JobPersistenceException { txCallback.execute(conn); return null; } }); }
/** * Execute the given callback having optionally aquired the given lock. * This uses the non-managed transaction connection. This version is just a * handy wrapper around executeInNonManagedTXLock that doesn't require a return * value. * * @param lockName The name of the lock to aquire, for example * "TRIGGER_ACCESS". If null, then no lock is aquired, but the * lockCallback is still executed in a non-managed transaction. * * @see #executeInNonManagedTXLock(String, TransactionCallback) */ protected void executeInNonManagedTXLock( final String lockName, final VoidTransactionCallback txCallback) throws JobPersistenceException { executeInNonManagedTXLock( lockName, new TransactionCallback() { public Object execute(Connection conn) throws JobPersistenceException { txCallback.execute(conn); return null; } }); }
return (Trigger)executeInNonManagedTXLock( LOCK_TRIGGER_ACCESS, new TransactionCallback() { return (Trigger)executeInNonManagedTXLock(