@Override public void execute(final JobExecutionContext context) throws JobExecutionException { try { if (bosJob != null) { bosJob.execute(); } } catch (final SBonitaException e) { JobExecutionException jobExecutionException = new JobExecutionException(e); jobExecutionException.setUnscheduleFiringTrigger(true);//job log will be registered throw jobExecutionException; } }
@Override public void execute(final JobExecutionContext context) throws JobExecutionException { try { if (bosJob != null) { bosJob.execute(); } } catch (final SBonitaException e) { JobExecutionException jobExecutionException = new JobExecutionException(e); jobExecutionException.setUnscheduleFiringTrigger(true);//job log will be registered throw jobExecutionException; } }
protected void throwJobExecutionException(String pluginName, Object pluginType, String jobId, String errorMsg, Throwable t) throws JobExecutionException { log.error(logMsg(pluginName, pluginType, jobId, errorMsg, t)); JobExecutionException jobException; if (t != null) { jobException = new JobExecutionException(t, false); } else { jobException = new JobExecutionException(false); } jobException.setUnscheduleFiringTrigger(true); throw jobException; }
jobEx.setRefireImmediately(refire); jobEx.setUnscheduleAllTriggers(unscheduleAllTrigger); jobEx.setUnscheduleFiringTrigger(unscheduleTrigger);
@SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"}) @Override public void execute(JobExecutionContext context) throws JobExecutionException { final SchedulingContext schedulingContext = new SchedulingContextImpl(context); try { task.execute(schedulingContext); } catch (final Exception ex) { final JobExecutionException e = new JobExecutionException("Error during job execution", ex); Scheduled scheduled = task.getClass().getAnnotation(Scheduled.class); if (scheduled != null) { if (ExceptionPolicy.REFIRE_IMMEDIATELY.equals(scheduled.exceptionPolicy())) { e.setRefireImmediately(true); } else if (ExceptionPolicy.UNSCHEDULE_FIRING_TRIGGER.equals(scheduled.exceptionPolicy())) { e.setUnscheduleFiringTrigger(true); } else if (ExceptionPolicy.UNSCHEDULE_ALL_TRIGGERS.equals(scheduled.exceptionPolicy())) { e.setUnscheduleAllTriggers(true); } } throw e; } } }