title: How to conditionally run or start Spring scheduled jobs in runtime?
body: <p>I'm using java scheduled in my project. After calling a rest api in my project, I start scheduled in my program. Likewise, I stop this scheduled with another rest api. In other words, I create, stop, run, etc. scheduled in runtime. </p>
  
  <p><strong>I want to convert this code from java scheduled to spring schedule.</strong></p>
  
  <p>When I look at the code samples, I can start scheduled by time. Or I can start it according to the parameter I gave in application.properties. However, none of them meet my will.My request is simply as follows.</p>
  
  <pre><code>if(condition) {
      startScheduled();
  } 
  else {
      stopScheduled();
  }
  </code></pre>
  
  <p>but I could not find such an example.Can you help me?</p>