Quartz scheduler shutdown(true) wait for all threads started from running Jobs to stop?

API docs : Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler Parameters: waitForJobsToComplete if true the scheduler will not allow this method to return until all currently executing jobs have completed Quarts neither know nor cares about any threads spawned by your job, it will simply wait for the job to complete. If your job spawns new threads then exits, then as far as Quartz is concerned, it's finished If your job needs to wait for its spawned threads to complete, then you need to use something like an ExecutorService (see javadoc for java.util. Concurrent ), which will allow the job thread to wait for its spawned threads to complete.

If you're using raw java threads, then use Thread.join().

API docs: Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler. Parameters: waitForJobsToComplete - if true the scheduler will not allow this method to return until all currently executing jobs have completed. Quarts neither know nor cares about any threads spawned by your job, it will simply wait for the job to complete.

If your job spawns new threads then exits, then as far as Quartz is concerned, it's finished. If your job needs to wait for its spawned threads to complete, then you need to use something like an ExecutorService (see javadoc for java.util. Concurrent), which will allow the job thread to wait for its spawned threads to complete.

If you're using raw java threads, then use Thread.join().

Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler. WaitForJobsToComplete - if true the scheduler will not allow this method to return until all currently executing jobs have completed. Quarts neither know nor cares about any threads spawned by your job, it will simply wait for the job to complete.

If your job spawns new threads then exits, then as far as Quartz is concerned, it's finished. If your job needs to wait for its spawned threads to complete, then you need to use something like an ExecutorService (see javadoc for java.util. Concurrent), which will allow the job thread to wait for its spawned threads to complete.

If you're using raw java threads, then use Thread.join().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions