title: how to control quartz scheduler from running using spring & weblogic deployment plan
body: <blockquote>
    <p>i have a quartz scheduler configured with spring, it has five triggers
    that trigger appropriate jobs. what i am looking for is to have flag
    that i can use to disable the jobs in dev and test environments and
    enable in production. below is configuration  in my
    applicationContext.xml for quartz Scheduler.</p>
  </blockquote>
  
  <pre><code> &lt;!-- ====================================================================== --&gt;
              &lt;!-- ========================== QUARTZ SCHEDULER ========================== --&gt;
              &lt;!-- ====================================================================== --&gt; 
              &lt;bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false"&gt;
               &lt;property name="applicationContextSchedulerContextKey" value="applicationContext" /&gt;
                  &lt;property name="autoStartup" value="false" /&gt;
                  &lt;property name="dataSource" ref="dataSource"/&gt;
                  &lt;property name="transactionManager" ref="transactionManager"/&gt;
                  &lt;property name="overwriteExistingJobs" value="true"/&gt;
                  &lt;property name="waitForJobsToCompleteOnShutdown" value="true"/&gt;
                  &lt;property name="triggers"&gt;
                      &lt;list&gt;
                          &lt;!-- if you remove a trigger, make sure you
                              also remove the trigger 
                              from the QRTZ_TRIGGERS table. 
                          --&gt;
                          &lt;ref bean="Trigger1" /&gt;
                          &lt;ref bean="Trigger2" /&gt;
                          &lt;ref bean="Trigger3" /&gt;
                          &lt;ref bean="Trigger4"/&gt;
                          &lt;ref bean="Trigger5"/&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
                  &lt;property name="quartzProperties"&gt;
                      &lt;props&gt;
                          &lt;prop key="org.quartz.scheduler.instanceName"&gt;ClusteredScheduler&lt;/prop&gt;
                          &lt;prop key="org.quartz.scheduler.instanceId"&gt;AUTO&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.misfireThreshold"&gt;60000&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.class"&gt;org.quartz.impl.jdbcjobstore.JobStoreTX&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.driverDelegateClass"&gt;org.quartz.impl.jdbcjobstore.oracle.weblogic.WebLogicOracleDelegate&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.tablePrefix"&gt;qrtz_&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.isClustered"&gt;true&lt;/prop&gt;
                          &lt;prop key="org.quartz.jobStore.clusterCheckinInterval"&gt;20000&lt;/prop&gt;
                          &lt;prop key="org.quartz.threadPool.class"&gt;org.quartz.simpl.SimpleThreadPool&lt;/prop&gt;
                          &lt;!-- Set to 7 to correspond to the 7 nightly jobs that run in the morning --&gt;
                          &lt;prop key="org.quartz.threadPool.threadCount"&gt;7&lt;/prop&gt;
                          &lt;prop key="org.quartz.threadPool.threadPriority"&gt;5&lt;/prop&gt;
                      &lt;/props&gt;
                &lt;/property&gt;
              &lt;/bean&gt;
  </code></pre>
  
  <blockquote>
    <p>Cron Trigger :</p>
  </blockquote>
  
  <pre><code>&lt;bean id="Trigger1" class="org.springframework.scheduling.quartz.CronTriggerBean" scope="prototype"&gt;
          &lt;property name="jobDetail"&gt;
              &lt;bean name="nightlyJob" class="org.springframework.scheduling.quartz.JobDetailBean"&gt;
                  &lt;property name="jobClass" value="My custom class that extends QuartzJobBean"/&gt;
                  &lt;property name="group" value="nightly"/&gt;
                  &lt;property name="requestsRecovery" value="true" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
          &lt;!-- Cron expression to run job every 10 minutes for testing --&gt;
          &lt;!-- &lt;property name="cronExpression" value="0 0/10 * * * ?"/&gt; --&gt;
          &lt;!-- Cron expression that runs at 2:10AM --&gt;
          &lt;property name="cronExpression" value="0 10 2 * * ?"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <blockquote>
    <p>What i tried : I tried setting the cron expression to feb31, so that
    it will never run, but that requires a code change or a script to be
    run in the database.
        What i need : need a  flag in my weblogic deployment plan that will turn on or off quartz scheduler</p>
  </blockquote>