protected JobDetail retrieveJob(Connection conn, JobKey key) throws JobPersistenceException { try { return getDelegate().selectJobDetail(conn, key, getClassLoadHelper()); } catch (ClassNotFoundException e) { throw new JobPersistenceException( "Couldn't retrieve job because a required class was not found: " + e.getMessage(), e); } catch (IOException e) { throw new JobPersistenceException( "Couldn't retrieve job because the BLOB couldn't be deserialized: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't retrieve job: " + e.getMessage(), e); } }
protected JobDetail retrieveJob(Connection conn, JobKey key) throws JobPersistenceException { try { return getDelegate().selectJobDetail(conn, key, getClassLoadHelper()); } catch (ClassNotFoundException e) { throw new JobPersistenceException( "Couldn't retrieve job because a required class was not found: " + e.getMessage(), e); } catch (IOException e) { throw new JobPersistenceException( "Couldn't retrieve job because the BLOB couldn't be deserialized: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't retrieve job: " + e.getMessage(), e); } }
/** * <P> * Get the driver delegate for DB operations. * </p> */ protected DriverDelegate getDelegate() throws NoSuchDelegateException { synchronized(this) { if(null == delegate) { try { if(delegateClassName != null) { delegateClass = getClassLoadHelper().loadClass(delegateClassName, DriverDelegate.class); } delegate = delegateClass.newInstance(); delegate.initialize(getLog(), tablePrefix, instanceName, instanceId, getClassLoadHelper(), canUseProperties(), getDriverDelegateInitString()); } catch (InstantiationException e) { throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage(), e); } catch (IllegalAccessException e) { throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage(), e); } catch (ClassNotFoundException e) { throw new NoSuchDelegateException("Couldn't load delegate class: " + e.getMessage(), e); } } return delegate; } }
/** * <P> * Get the driver delegate for DB operations. * </p> */ protected DriverDelegate getDelegate() throws NoSuchDelegateException { synchronized(this) { if(null == delegate) { try { if(delegateClassName != null) { delegateClass = getClassLoadHelper().loadClass(delegateClassName, DriverDelegate.class); } delegate = delegateClass.newInstance(); delegate.initialize(getLog(), tablePrefix, instanceName, instanceId, getClassLoadHelper(), canUseProperties(), getDriverDelegateInitString()); } catch (InstantiationException e) { throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage(), e); } catch (IllegalAccessException e) { throw new NoSuchDelegateException("Couldn't create delegate: " + e.getMessage(), e); } catch (ClassNotFoundException e) { throw new NoSuchDelegateException("Couldn't load delegate class: " + e.getMessage(), e); } } return delegate; } }
protected boolean replaceTrigger(Connection conn, TriggerKey key, OperableTrigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key); if (job == null) { return false; } if (!newTrigger.getJobKey().equals(job.getKey())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, key); storeTrigger(conn, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean replaceTrigger(Connection conn, TriggerKey key, OperableTrigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key); if (job == null) { return false; } if (!newTrigger.getJobKey().equals(job.getKey())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, key); storeTrigger(conn, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean removeTrigger(Connection conn, TriggerKey key) throws JobPersistenceException { boolean removedTrigger; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key, false); removedTrigger = deleteTriggerAndChildren(conn, key); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getKey()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, job.getKey()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
protected boolean removeTrigger(Connection conn, TriggerKey key) throws JobPersistenceException { boolean removedTrigger; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, getClassLoadHelper(), key, false); removedTrigger = deleteTriggerAndChildren(conn, key); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getKey()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, job.getKey()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
if(delegateClassName != null) { delegateClass = getClassLoadHelper().loadClass(delegateClassName);
if(delegateClassName != null) { delegateClass = getClassLoadHelper().loadClass(delegateClassName);
protected JobDetail retrieveJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName) throws JobPersistenceException { try { JobDetail job = getDelegate().selectJobDetail(conn, jobName, groupName, getClassLoadHelper()); if (job != null) { String[] listeners = getDelegate().selectJobListeners(conn, jobName, groupName); for (int i = 0; i < listeners.length; ++i) { job.addJobListener(listeners[i]); } } return job; } catch (ClassNotFoundException e) { throw new JobPersistenceException( "Couldn't retrieve job because a required class was not found: " + e.getMessage(), e, SchedulerException.ERR_PERSISTENCE_JOB_DOES_NOT_EXIST); } catch (IOException e) { throw new JobPersistenceException( "Couldn't retrieve job because the BLOB couldn't be deserialized: " + e.getMessage(), e, SchedulerException.ERR_PERSISTENCE_JOB_DOES_NOT_EXIST); } catch (SQLException e) { throw new JobPersistenceException("Couldn't retrieve job: " + e.getMessage(), e); } }
protected boolean replaceTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, Trigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); if (job == null) { return false; } if (!newTrigger.getJobName().equals(job.getName()) || !newTrigger.getJobGroup().equals(job.getGroup())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); storeTrigger(conn, ctxt, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected JobDetail retrieveJob(Connection conn, SchedulingContext ctxt, String jobName, String groupName) throws JobPersistenceException { try { JobDetail job = getDelegate().selectJobDetail(conn, jobName, groupName, getClassLoadHelper()); if (job != null) { String[] listeners = getDelegate().selectJobListeners(conn, jobName, groupName); for (int i = 0; i < listeners.length; ++i) { job.addJobListener(listeners[i]); } } return job; } catch (ClassNotFoundException e) { throw new JobPersistenceException( "Couldn't retrieve job because a required class was not found: " + e.getMessage(), e, SchedulerException.ERR_PERSISTENCE_JOB_DOES_NOT_EXIST); } catch (IOException e) { throw new JobPersistenceException( "Couldn't retrieve job because the BLOB couldn't be deserialized: " + e.getMessage(), e, SchedulerException.ERR_PERSISTENCE_JOB_DOES_NOT_EXIST); } catch (SQLException e) { throw new JobPersistenceException("Couldn't retrieve job: " + e.getMessage(), e); } }
protected boolean replaceTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName, Trigger newTrigger) throws JobPersistenceException { try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); if (job == null) { return false; } if (!newTrigger.getJobName().equals(job.getName()) || !newTrigger.getJobGroup().equals(job.getGroup())) { throw new JobPersistenceException("New trigger is not related to the same job as the old trigger."); } boolean removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); storeTrigger(conn, ctxt, newTrigger, job, false, STATE_WAITING, false, false); return removedTrigger; } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } }
protected boolean removeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName) throws JobPersistenceException { boolean removedTrigger = false; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getName(), job.getGroup()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, ctxt, job.getName(), job.getGroup()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
protected boolean removeTrigger(Connection conn, SchedulingContext ctxt, String triggerName, String groupName) throws JobPersistenceException { boolean removedTrigger = false; try { // this must be called before we delete the trigger, obviously JobDetail job = getDelegate().selectJobForTrigger(conn, triggerName, groupName, getClassLoadHelper()); removedTrigger = deleteTriggerAndChildren(conn, triggerName, groupName); if (null != job && !job.isDurable()) { int numTriggers = getDelegate().selectNumTriggersForJob(conn, job.getName(), job.getGroup()); if (numTriggers == 0) { // Don't call removeJob() because we don't want to check for // triggers again. deleteJobAndChildren(conn, ctxt, job.getName(), job.getGroup()); } } } catch (ClassNotFoundException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } catch (SQLException e) { throw new JobPersistenceException("Couldn't remove trigger: " + e.getMessage(), e); } return removedTrigger; }
job = getDelegate().selectJobDetail(conn, newTrigger.getJobName(), newTrigger.getJobGroup(), getClassLoadHelper());
job = getDelegate().selectJobDetail(conn, newTrigger.getJobName(), newTrigger.getJobGroup(), getClassLoadHelper());