Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8137979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:21:08+00:00 2026-06-06T11:21:08+00:00

I have been working on a scheduler engine which reads schedule Jobs from a

  • 0

I have been working on a scheduler engine which reads schedule Jobs from a database and schedules them which works fine however the rows in the database are just “Configuration” of certain types of job for example:

A Certain Configuration to get FTP has

host: imagineryHost1.com 
post: 22

and another of the same class has

host: imagineryHost2.com
post: 21

We create two FPTjob’s with their own triggers and their own separate data.

/**
BaseJob is an Abstract class extending QuartzJobBean used to handle our logging and 
other requirements that need across all our jobs.
*/
public class FTPJob extends BaseJob {

    /**
        Called from executeInternal of QuartzJobBean 
    */
    @Override
    public boolean execute1V(JobExecutionContext context) {
        //Code to get Files from FTP.
    }
}

These are scheduled using the TriggerBuilder with a cron.

If i add @DisallowConcurrentExecution is will only allow 1 instance of our FTPJob to run at any one time, However I need to to be able to run Multiple instance of FTPJob but limit it to only one instance of that particular configuration of that class.

Any leads on how to progress will be highly appreciated 🙂

UPDATE

Based on ftom2’s answer I went digging and found TriggerListener since every job configuration has it own uniqueID it possible i could “Veto” the job from running ie.

public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) {
    try {
        Iterator<JobExecutionContext> it =     
        context.getScheduler().getCurrentlyExecutingJobs().iterator();

        boolean found = false;
        while(it.hasNext()) {
            JobExecutionContext job = it.next();

            if(trigger.getJobKey().equals(job.getJobDetail().getKey())) {
                return false;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Is there any other way that is a little more built in to handle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:21:09+00:00Added an answer on June 6, 2026 at 11:21 am

    I’m not sure if it is possible but this might be a direction.

    You can implement a JobListener and then do the following:

    1. using jobWasExecuted you will set a flag in the jobDetails that this job finished.
    2. using jobToBeExecuted, you will check job status before it starts and see if it is in running state, if yes – stop it (see here), if no – let it run and set its state to running.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working to upgrade a Postgresql database from 8.4 to 9.1. I
I have been working on an app all day which has been working fine
i have been working on query which uses compute by clause for avg and
I have been working on a BlackBerry application that consumes web services from ColdFusion
I have been working on many applications which run as windows service or scheduled
I have been working on a system which I'm using protobuf-net (version 2.0.0.480) for
I have been working with some sort of validation in which i need to
I have a website which I have been working on creating very rapidly, and
I have been working on a project in which I take a file with
I have been working on asp.net 3.5.I want to Convert a DateTime Data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.