View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.quartz.jobs;
8   
9   import org.mule.transport.quartz.config.AbstractJobConfig;
10  
11  import org.quartz.Job;
12  import org.quartz.StatefulJob;
13  
14  /**
15   * This configuration simply holds a reference to a user defined job to execute.
16   */
17  public class CustomJobConfig extends AbstractJobConfig
18  {
19      private Job job;
20  
21      public Job getJob()
22      {
23          return job;
24      }
25  
26      public void setJob(Job job)
27      {
28          this.job = job;
29          setStateful(job instanceof StatefulJob);
30      }
31  
32      @Override
33      protected Class<? extends StatefulJob> getStatefulJobClass()
34      {
35          return StatefulCustomJob.class;
36      }
37  
38      @Override
39      protected Class<? extends Job> getStatelessJobClass()
40      {
41          return CustomJob.class;
42      }
43  }