Examples of TriggerKey


Examples of org.quartz.TriggerKey

            throw new JobExecutionException("Failed to obtain scheduler context for job " + context.getJobDetail().getKey());
        }
    }

    protected QuartzEndpoint lookupQuartzEndpoint(CamelContext camelContext, JobExecutionContext quartzContext) throws JobExecutionException {
        TriggerKey triggerKey = quartzContext.getTrigger().getKey();
        if (LOG.isDebugEnabled()) {
            LOG.debug("Looking up existing QuartzEndpoint with triggerKey={}", triggerKey);
        }

        // check all active routes for the quartz endpoint this task matches
        // as we prefer to use the existing endpoint from the routes
        for (Route route : camelContext.getRoutes()) {
            Endpoint endpoint = route.getEndpoint();
            if (endpoint instanceof DelegateEndpoint) {
                endpoint = ((DelegateEndpoint)endpoint).getEndpoint();  
            }
            if (endpoint instanceof QuartzEndpoint) {
                QuartzEndpoint quartzEndpoint = (QuartzEndpoint) endpoint;
                TriggerKey checkTriggerKey = quartzEndpoint.getTriggerKey();
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Checking route endpoint={} with checkTriggerKey={}", quartzEndpoint, checkTriggerKey);
                }
                if (triggerKey.equals(checkTriggerKey)) {
                    return quartzEndpoint;
View Full Code Here

Examples of org.quartz.TriggerKey

    public void testEnabledJobCreation() throws Exception {
        quartzManagementService.enableScheduler();

        final long jobId = 1234;
        JobKey jobKey = QzerverKeyUtils.jobKey(jobId);
        TriggerKey triggerKey = QzerverKeyUtils.triggerKey(jobId);

        String jobCron = composeCronExpression(DEFAULT_SCHEDULE_ADVANCE_MS);
        quartzManagementService.createJob(jobId, jobCron, GLOBAL_TIMEZONE, true);

        List<String> jobGroups = scheduler.getJobGroupNames();
View Full Code Here

Examples of org.quartz.TriggerKey

    public void testToggleJob() throws Exception {
        quartzManagementService.enableScheduler();

        final long jobId = 1234;
        JobKey jobKey = QzerverKeyUtils.jobKey(jobId);
        TriggerKey triggerKey = QzerverKeyUtils.triggerKey(jobId);

        String jobCron = composeCronExpression(DEFAULT_SCHEDULE_ADVANCE_MS);
        quartzManagementService.createJob(jobId, jobCron, GLOBAL_TIMEZONE, true);
        Assert.assertTrue(quartzManagementService.isJobActive(jobId));
View Full Code Here

Examples of org.quartz.TriggerKey

    public void testRescheduleJob() throws Exception {
        quartzManagementService.enableScheduler();

        final long jobId = 1234;
        JobKey jobKey = QzerverKeyUtils.jobKey(jobId);
        TriggerKey triggerKey = QzerverKeyUtils.triggerKey(jobId);

        String jobCron = composeCronExpression(DEFAULT_SCHEDULE_ADVANCE_MS);
        quartzManagementService.createJob(jobId, jobCron, GLOBAL_TIMEZONE, true);

        String jobRescheduledCron = composeCronExpression(DEFAULT_SCHEDULE_ADVANCE_MS + 10);
View Full Code Here

Examples of org.quartz.TriggerKey

   
    public Trigger getTrigger() {
       
        if (scheduler != null) {
            try {
                final TriggerKey key = new TriggerKey(trigger.getName(), trigger.getGroup());
                if (scheduler.checkExists(key)) {
                    return scheduler.getTrigger(key);
                }
            } catch (SchedulerException e) {
                return null;
View Full Code Here

Examples of org.quartz.TriggerKey

    private void ensureNoDupTriggerKey() {
        for (Route route : getCamelContext().getRoutes()) {
            if (route.getEndpoint() instanceof QuartzEndpoint) {
                QuartzEndpoint quartzEndpoint = (QuartzEndpoint) route.getEndpoint();
                TriggerKey checkTriggerKey = quartzEndpoint.getTriggerKey();
                if (triggerKey.equals(checkTriggerKey)) {
                    throw new IllegalArgumentException("Trigger key " + triggerKey + " is already in used by " + quartzEndpoint);
                }
            }
        }
View Full Code Here

Examples of org.quartz.TriggerKey

        Map<String, Object> triggerParameters = IntrospectionSupport.extractProperties(parameters, "trigger.");
        Map<String, Object> jobParameters = IntrospectionSupport.extractProperties(parameters, "job.");

        // Create quartz endpoint
        QuartzEndpoint result = new QuartzEndpoint(uri, this);
        TriggerKey triggerKey = createTriggerKey(uri, remaining, result);
        result.setTriggerKey(triggerKey);
        result.setTriggerParameters(triggerParameters);
        result.setJobParameters(jobParameters);
        return result;
    }
View Full Code Here

Examples of org.quartz.TriggerKey

        if (prefixJobNameWithEndpointId) {
            name = endpoint.getId() + "_" + name;
        }

        return new TriggerKey(name, group);
    }
View Full Code Here

Examples of org.quartz.TriggerKey

    private void ensureNoDupTriggerKey() {
        for (Route route : getCamelContext().getRoutes()) {
            if (route.getEndpoint() instanceof QuartzEndpoint) {
                QuartzEndpoint quartzEndpoint = (QuartzEndpoint) route.getEndpoint();
                TriggerKey checkTriggerKey = quartzEndpoint.getTriggerKey();
                if (triggerKey.equals(checkTriggerKey)) {
                    throw new IllegalArgumentException("Trigger key " + triggerKey + " is already in used by " + quartzEndpoint);
                }
            }
        }
View Full Code Here

Examples of org.quartz.TriggerKey

    private void ensureNoDupTriggerKey() {
        for (Route route : getCamelContext().getRoutes()) {
            if (route.getEndpoint() instanceof QuartzEndpoint) {
                QuartzEndpoint quartzEndpoint = (QuartzEndpoint) route.getEndpoint();
                TriggerKey checkTriggerKey = quartzEndpoint.getTriggerKey();
                if (triggerKey.equals(checkTriggerKey)) {
                    throw new IllegalArgumentException("Trigger key " + triggerKey + " is already in used by " + quartzEndpoint);
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.