View Javadoc

    1   package org.apache.stratum.scheduler;
    2
    3   /*
    4    * Copyright 2001-2005 The Apache Software Foundation or its licensors,
    5    * as applicable.
    6    *
    7    * Licensed under the Apache License, Version 2.0 (the "License");
    8    * you may not use this file except in compliance with the License.
    9    * You may obtain a copy of the License at
    10   *
    11   *     http://www.apache.org/licenses/LICENSE-2.0
    12   *
    13   * Unless required by applicable law or agreed to in writing, software
    14   * distributed under the License is distributed on an "AS IS" BASIS,
    15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16   * See the License for the specific language governing permissions and
    17   * limitations under the License.
    18   */
    19
    20  import java.util.ArrayList;
    21  import java.util.List;
    22
    23  /***
    24   * This bean represents all of the configuration information needed to load the Quartz scheduler.
    25   *
    26   * @author <a href="mailto:john@thorhauer.com">John Thorhauer</a>
    27   * @version $Id: SchedulerConfig.java 264723 2005-08-30 07:44:51Z henning $
    28   */
    29  public class SchedulerConfig
    30  {
    31      /*** Scheduler reference name */
    32      private String instanceName;
    33
    34      /*** List of job configurations */
    35      private List jobConfigs;
    36
    37      /*** List of triggers */
    38      private List triggerConfigs;
    39
    40      /*** The jobstore for the Scheduler */
    41      private JobStoreConfig jobStoreConfig;
    42
    43      /*** The threadpool for the Scheduler */
    44      private ThreadPoolConfig threadPoolConfig;
    45
    46      /***
    47       * Default contructor
    48       */
    49      public SchedulerConfig()
    50      {
    51          jobConfigs = new ArrayList();
    52          triggerConfigs = new ArrayList();
    53      }
    54
    55      /***
    56       * Set the reference name given to the scheduler that is loaded into Quartz
    57       *
    58       * @param s instanceName
    59       */
    60      public void setInstanceName(String s)
    61      {
    62          this.instanceName = s;
    63      }
    64
    65      /***
    66       * Return the reference name of the scheduler
    67       *
    68       * @return instance name
    69       */
    70      public String getInstanceName()
    71      {
    72          return this.instanceName;
    73      }
    74
    75      /***
    76       * Add a Job Configuraton to Scheduler Config
    77       *
    78       * @param jconf Job configuration
    79       */
    80      public void addJobConfig(JobConfig jconf)
    81      {
    82          jobConfigs.add(jconf);
    83      }
    84
    85      /***
    86       * Return a list of Job Configurations
    87       *
    88       * @return List of job configs
    89       */
    90      public List getJobConfigs()
    91      {
    92          return this.jobConfigs;
    93      }
    94
    95      /***
    96       * Add a trigger to Scheduler Config
    97       *
    98       * @param trigger
    99       */
    100     public void addTriggerConfig(TriggerConfig trigger)
    101     {
    102         triggerConfigs.add(trigger);
    103     }
    104
    105     /***
    106      * Return a list of triggers
    107      *
    108      * @return List of triggers
    109      */
    110     public List getTriggerConfigs()
    111     {
    112         return this.triggerConfigs;
    113     }
    114
    115     /***
    116      * Set the threadPool for the scheduler to use
    117      *
    118      * @param thdPool threadPool
    119      */
    120     public void setThreadPoolConfig(ThreadPoolConfig thdPool)
    121     {
    122         this.threadPoolConfig = thdPool;
    123     }
    124
    125     /***
    126      * Return the the ThreadPool object
    127      *
    128      * @return threadPool
    129      */
    130     public ThreadPoolConfig getThreadPoolConfig()
    131     {
    132         return this.threadPoolConfig;
    133     }
    134
    135     /***
    136      * Set the jobstore for the scheduler to use
    137      *
    138      * @param jobStr jobstore
    139      */
    140     public void setJobStoreConfig(JobStoreConfig jobStr)
    141     {
    142         this.jobStoreConfig = jobStr;
    143     }
    144
    145     /***
    146      * Return the the JobStore object
    147      *
    148      * @return jobStore
    149      */
    150     public JobStoreConfig getJobStoreConfig()
    151     {
    152         return this.jobStoreConfig;
    153     }
    154 }