I am using a Quartz Job for executing specific tasks.
I am also scheduling its execution in my Main application class and what i am trying to accomplish is not to a
@DisallowConcurrentExecution
can do your job but please consider that it would only prevent your class from being run twice on the same node.
Please see @ReneM comment in Quartz 2.2 multi scheduler and @DisallowConcurrentExecution
You can implement StatefulJob or annotate DisallowConcurrentExecution
Just use the @DisallowConcurrentExecution
Annotation on top of the Job class.
See this official example or this tutorial about concurrent job execution.