Package org.quartz

Examples of org.quartz.JobExecutionException


        DefaultTaskWrapper wrapper = new DefaultTaskWrapper(jobDetail.getJobDataMap(), null);
        try {
            wrapper.execute();
        } catch (ExecutionException e) {
          log.error("Task execution failed: ", e);
          throw new JobExecutionException();
        }
    }
View Full Code Here


            getMarshaler().populateNormalizedMessage(message, context);
            exchange.setInMessage(message);
            send(exchange);
        }
        catch (MessagingException e) {
            throw new JobExecutionException(e);
        }
    }
View Full Code Here

*/
public class ServiceMixJob implements Job {
    public void execute(JobExecutionContext context) throws JobExecutionException {
        QuartzComponent component = (QuartzComponent) context.getJobDetail().getJobDataMap().get(QuartzComponent.COMPONENT_KEY);
        if (component == null) {
            throw new JobExecutionException("No quartz JBI component available for key: " + QuartzComponent.COMPONENT_KEY + ". Bad job data map");
        }
        component.onJobExecute(context);
    }
View Full Code Here

      NormalizedMessage message = inOnly.createMessage();
      getMarshaler().populateNormalizedMessage(message, context);
      inOnly.setInMessage(message);
      serviceContext.done(inOnly);
    } catch (MessagingException e) {
      throw new JobExecutionException(e);
    }
  }
View Full Code Here

*/
public class ServiceMixJob implements Job {
    public void execute(JobExecutionContext context) throws JobExecutionException {
        QuartzComponent component = (QuartzComponent) context.getJobDetail().getJobDataMap().get(QuartzComponent.COMPONENT_KEY);
        if (component == null) {
            throw new JobExecutionException("No quartz JBI component available for key: " + QuartzComponent.COMPONENT_KEY + ". Bad job data map");
        }
        component.onJobExecute(context);
    }
View Full Code Here

                // delete this job, we've assigned a final status
                try {
                    context.setResult(bundleDeploymentStatus); // Return status to possible listeners
                    scheduler.deleteJob(jobDetail.getName(), jobDetail.getGroup());
                } catch (SchedulerException e) {
                    throw new JobExecutionException("Could not delete the bundle deployment completion check job for "
                        + bundleDeployment + ".", e);
                }
            } else {
                // try again in 10s
                try {
                    Trigger trigger = QuartzUtil.getFireOnceOffsetTrigger(jobDetail, 10000L);
                    // just need a trigger name unique for this job
                    trigger.setName(String.valueOf(System.currentTimeMillis()));
                    scheduler.scheduleJob(trigger);
                } catch (SchedulerException e) {
                    throw new JobExecutionException(
                        "Could not schedule the bundle deployment completion check job for " + bundleDeployment + ".",
                        e);
                }
            }
        }
View Full Code Here

            log.error("Cancelled job [" + context.getJobDetail() + "]");
        } catch (Exception e) {
            String errorMsg = "Failed to sync repo in job [" + context.getJobDetail() + "]";

            log.error(errorMsg, e);
            JobExecutionException jobExecutionException = new JobExecutionException(errorMsg, e, false);

            // Do not retrigger if we threw IllegalStateException because it'll never work anyway
            if (!(e instanceof IllegalStateException)) {
                jobExecutionException.setUnscheduleAllTriggers(false);
            }

            throw jobExecutionException;
        }
    }
View Full Code Here

                syncImportedRepos(contentSource);
            }
        } catch (Exception e) {
            String errorMsg = "Failed to sync content source in job [" + context.getJobDetail() + "]";
            log.error(errorMsg, e);
            JobExecutionException jobExecutionException = new JobExecutionException(errorMsg, e, false);

            // should we unschedule so we never attempt to sync again?
            // That would mean any error will cause this sync to never occur again automatically until
            // we restart the server, restart the server-side content plugin container or somehow manually create
            // the schedule again.  I will assume we will allow this schedule to trigger again, not sure if
            // that is what we want, but we can flip this to true if we want the other behavior.
            // NOTE: we do NOT retrigger if we threw IllegalStateException because we know it'll never work anyway
            if (!(e instanceof IllegalStateException)) {
                jobExecutionException.setUnscheduleAllTriggers(false);
            }

            throw jobExecutionException;
        }
    }
View Full Code Here

                throw (CancelJobException) e;
            }

            String error = "Failed to execute scheduled operation [" + schedule + "]";
            LogFactory.getLog(GroupOperationJob.class).error(error, e);
            throw new JobExecutionException(error, e, false);
        } finally {
            // clean up our temporary session by logging out of it
            try {
                if (user != null) {
                    SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();
View Full Code Here

        // do not execute the job if the master plugin container has been stopped
        ServerPluginServiceMBean serverPluginService = LookupUtil.getServerPluginService();
        if (!serverPluginService.isMasterPluginContainerStarted()) {
            String msg = "The master plugin container is shutdown, will not execute job here, will resubmit";
            log.error(logMsg(pluginName, pluginType, jobId, msg, null));
            JobExecutionException exception = new JobExecutionException();

            // we only refire immediately if we are in an HA environment- which means another server might
            // be able to take over - and that other server might have its master PC running for us to execute in.
            boolean isHA = LookupUtil.getTopologyManager().getNormalServerCount() > 1;
            exception.setRefireImmediately(isHA);

            // abort this invocation now - we can't run without the plugin containers
            return;
        }
View Full Code Here

TOP

Related Classes of org.quartz.JobExecutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.