Package org.quartz

Examples of org.quartz.JobExecutionException


   
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            String componentName = (String) context.getJobDetail().getJobDataMap().get(COMPONENT_NAME);
            if (componentName == null) {
                throw new JobExecutionException("No property '" + COMPONENT_NAME + "' defined. Bad job data map");
            }
            QuartzComponent component = (QuartzComponent) context.getScheduler().getContext().get(componentName);
            if (component == null) {
                throw new JobExecutionException("No quartz JBI component available for key: " + componentName + "."
                        + " Bad job data map");
            }
            String endpointName = (String) context.getJobDetail().getJobDataMap().get(ENDPOINT_NAME);
            if (endpointName == null) {
                throw new JobExecutionException("No property '" + ENDPOINT_NAME + "' defined. Bad job data map");
            }
            QuartzEndpoint endpoint = (QuartzEndpoint) component.getRegistry().getEndpoint(endpointName);
            if (endpoint == null) {
                throw new JobExecutionException("No quartz JBI endpoint available for key: " + endpointName + "."
                        + " Bad job data map");
            }
            endpoint.onJobExecute(context);
        } catch (SchedulerException e) {
            throw new JobExecutionException(e);
        }
    }
View Full Code Here


        try {
            balancer.process(exchange);

            if (exchange.getException() != null) {
                // propagate the exception back to Quartz
                throw new JobExecutionException(exchange.getException());
            }
        } catch (Exception e) {
            // log the error
            LOG.error(CamelExchangeException.createExceptionMessage("Error processing exchange", exchange, e));

            // and rethrow to let quartz handle it
            if (e instanceof JobExecutionException) {
                throw (JobExecutionException) e;
            }
            throw new JobExecutionException(e);
        }
    }
View Full Code Here

        try {
            getLoadBalancer().process(exchange);

            if (exchange.getException() != null) {
                // propagate the exception back to Quartz
                throw new JobExecutionException(exchange.getException());
            }
        } catch (Exception e) {
            // log the error
            LOG.error(ExchangeHelper.createExceptionMessage("Error processing exchange", exchange, e));

            // and rethrow to let quartz handle it
            if (e instanceof JobExecutionException) {
                throw (JobExecutionException) e;
            }
            throw new JobExecutionException(e);
        }
    }
View Full Code Here

    public void execute(final JobExecutionContext context) throws JobExecutionException {
        SchedulerContext schedulerContext;
        try {
            schedulerContext = context.getScheduler().getContext();
        } catch (SchedulerException e) {
            throw new JobExecutionException("Failed to obtain scheduler context for job " + context.getJobDetail().getName());
        }

        CamelContext camelContext = (CamelContext) schedulerContext.get(QuartzConstants.QUARTZ_CAMEL_CONTEXT);
        String endpointUri = (String) context.getJobDetail().getJobDataMap().get(QuartzConstants.QUARTZ_ENDPOINT);
        QuartzEndpoint quartzEndpoint = (QuartzEndpoint) camelContext.getEndpoint(endpointUri);
View Full Code Here

public class CamelJob implements Job, Serializable {

    public void execute(JobExecutionContext context) throws JobExecutionException {
        QuartzEndpoint endpoint = (QuartzEndpoint) context.getJobDetail().getJobDataMap().get(QuartzConstants.QUARTZ_ENDPOINT);
        if (endpoint == null) {
            throw new JobExecutionException("No quartz endpoint available for key: " + QuartzConstants.QUARTZ_ENDPOINT);
        }
        endpoint.onJobExecute(context);
    }
View Full Code Here

        {
            taskQueue.put( task );
        }
        catch ( TaskQueueException e )
        {
            throw new JobExecutionException( e );
        }
    }
View Full Code Here

                        catch (final RuntimeException re)
                        {
                            final Integer maxRefireCount = (Integer) jobDataMap.get(MAX_REFIRE_COUNT) ;
                            if ((maxRefireCount != null) && (maxRefireCount > context.getRefireCount()))
                            {
                                final JobExecutionException jobEx = new JobExecutionException(re, true);
                                jobEx.setErrorCode(JobExecutionException.ERR_JOB_EXECUTION_THREW_EXCEPTION);
                                throw jobEx ;
                            }
                            else
                            {
                                if (job != null)
View Full Code Here

            {
                listener.onSchedule() ;
            }
            catch (final SchedulingException se)
            {
                final JobExecutionException jobException = new JobExecutionException("Scheduling exception on " + jobExecutionContext.getTrigger().getName()) ;
                jobException.initCause(se) ;
                throw jobException ;
            }
            catch (final Throwable th)
            {
                final JobExecutionException jobException = new JobExecutionException("Unexpected exception on " + jobExecutionContext.getTrigger().getName()) ;
                jobException.initCause(th) ;
                throw jobException ;
            }
            finally
            {
                thread.setContextClassLoader(currentClassLoader) ;
View Full Code Here

        }
    }

    private void handleException(String msg) throws JobExecutionException {
        log.error(msg);
        throw new JobExecutionException(msg);
    }
View Full Code Here

        throw new JobExecutionException(msg);
    }

    private void handleException(String msg, Exception e) throws JobExecutionException {
        log.error(msg, e);
        throw new JobExecutionException(msg, e);
    }
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.