Package org.quartz

Examples of org.quartz.JobKey


    public boolean unschedule(final Long bundleId, final String jobName) {
        final org.quartz.Scheduler s = this.scheduler;
        if ( jobName != null && s != null ) {
            synchronized ( this ) {
                try {
                    final JobKey key = JobKey.jobKey(jobName);
                    final JobDetail jobdetail = s.getJobDetail(key);
                    if (jobdetail != null) {
                        s.deleteJob(key);
                        this.logger.debug("Unscheduling job with name {}", jobName);
                        return true;
View Full Code Here


        synchronized ( this ) {
            final String name;
            if ( opts.name != null ) {
                // if there is already a job with the name, remove it first
                try {
                    final JobKey key = JobKey.jobKey(opts.name);
                    final JobDetail jobdetail = s.getJobDetail(key);
                    if (jobdetail != null) {
                        s.deleteJob(key);
                        this.logger.debug("Unscheduling job with name {}", opts.name);
                    }
View Full Code Here

    @Test
    public void testDisabledJobCreation() throws Exception {
        quartzManagementService.enableScheduler();

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

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

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

    @Test
    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);
View Full Code Here

    @Test
    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

    @Test
    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);
View Full Code Here

    }

    @Override
    public void registerNewJob(Class<? extends Job> jobClass)
    {
        JobKey jobKey = createJobKey(jobClass);

        try
        {
            Scheduled scheduled = jobClass.getAnnotation(Scheduled.class);
View Full Code Here

    @Override
    public boolean isExecutingJob(Class<? extends Job> jobClass)
    {
        try
        {
            JobKey jobKey = createJobKey(jobClass);
            JobDetail jobDetail = this.scheduler.getJobDetail(jobKey);

            if (jobDetail == null)
            {
                return false;
            }

            for (JobExecutionContext jobExecutionContext : this.scheduler.getCurrentlyExecutingJobs())
            {
                if (jobKey.equals(jobExecutionContext.getJobDetail().getKey()))
                {
                    return true;
                }
            }
View Full Code Here

        String groupName = scheduled.group().getSimpleName();
        String jobName = jobClass.getSimpleName();

        if (!Scheduled.class.getSimpleName().equals(groupName))
        {
            return new JobKey(jobName, groupName);
        }
        return new JobKey(jobName);
    }
View Full Code Here

    boolean markCompleted = false;

    if (firstBatchRequest != null) {
      String jobName = getJobName(executionId, firstBatchRequest.getOrderId());
      JobKey jobKey = JobKey.jobKey(jobName, ExecutionJob.LINEAR_EXECUTION_JOB_GROUP);
      JobDetail jobDetail;
      try {
        jobDetail = executionScheduler.getJobDetail(jobKey);
      } catch (SchedulerException e) {
        LOG.warn("Unable to retrieve job details from scheduler. job: " + jobKey);
View Full Code Here

TOP

Related Classes of org.quartz.JobKey

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.