| %line | %branch | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| org.apache.stratum.scheduler.SchedulerConfig |
|
|
| 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 | 27 | { |
| 51 | 27 | jobConfigs = new ArrayList(); |
| 52 | 27 | triggerConfigs = new ArrayList(); |
| 53 | 27 | } |
| 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 | 18 | this.instanceName = s; |
| 63 | 18 | } |
| 64 | ||
| 65 | /** |
|
| 66 | * Return the reference name of the scheduler |
|
| 67 | * |
|
| 68 | * @return instance name |
|
| 69 | */ |
|
| 70 | public String getInstanceName() |
|
| 71 | 6 | { |
| 72 | 24 | return this.instanceName; |
| 73 | 6 | } |
| 74 | 6 | |
| 75 | 6 | /** |
| 76 | * Add a Job Configuraton to Scheduler Config |
|
| 77 | * |
|
| 78 | * @param jconf Job configuration |
|
| 79 | */ |
|
| 80 | public void addJobConfig(JobConfig jconf) |
|
| 81 | { |
|
| 82 | 36 | jobConfigs.add(jconf); |
| 83 | 36 | } |
| 84 | ||
| 85 | 4 | /** |
| 86 | 4 | * Return a list of Job Configurations |
| 87 | * |
|
| 88 | * @return List of job configs |
|
| 89 | 0 | */ |
| 90 | 0 | public List getJobConfigs() |
| 91 | { |
|
| 92 | 27 | return this.jobConfigs; |
| 93 | } |
|
| 94 | ||
| 95 | 4 | /** |
| 96 | * Add a trigger to Scheduler Config |
|
| 97 | * |
|
| 98 | * @param trigger |
|
| 99 | 0 | */ |
| 100 | public void addTriggerConfig(TriggerConfig trigger) |
|
| 101 | { |
|
| 102 | 36 | triggerConfigs.add(trigger); |
| 103 | 36 | } |
| 104 | ||
| 105 | 4 | /** |
| 106 | 4 | * Return a list of triggers |
| 107 | * |
|
| 108 | * @return List of triggers |
|
| 109 | */ |
|
| 110 | public List getTriggerConfigs() |
|
| 111 | { |
|
| 112 | 27 | return this.triggerConfigs; |
| 113 | } |
|
| 114 | ||
| 115 | 2 | /** |
| 116 | * Set the threadPool for the scheduler to use |
|
| 117 | * |
|
| 118 | * @param thdPool threadPool |
|
| 119 | */ |
|
| 120 | public void setThreadPoolConfig(ThreadPoolConfig thdPool) |
|
| 121 | { |
|
| 122 | 18 | this.threadPoolConfig = thdPool; |
| 123 | 18 | } |
| 124 | ||
| 125 | 8 | /** |
| 126 | 8 | * Return the the ThreadPool object |
| 127 | * |
|
| 128 | * @return threadPool |
|
| 129 | 0 | */ |
| 130 | 0 | public ThreadPoolConfig getThreadPoolConfig() |
| 131 | { |
|
| 132 | 9 | return this.threadPoolConfig; |
| 133 | } |
|
| 134 | ||
| 135 | 6 | /** |
| 136 | * Set the jobstore for the scheduler to use |
|
| 137 | * |
|
| 138 | * @param jobStr jobstore |
|
| 139 | 0 | */ |
| 140 | public void setJobStoreConfig(JobStoreConfig jobStr) |
|
| 141 | { |
|
| 142 | 18 | this.jobStoreConfig = jobStr; |
| 143 | 18 | } |
| 144 | ||
| 145 | 4 | /** |
| 146 | 4 | * Return the the JobStore object |
| 147 | * |
|
| 148 | * @return jobStore |
|
| 149 | */ |
|
| 150 | public JobStoreConfig getJobStoreConfig() |
|
| 151 | { |
|
| 152 | 9 | return this.jobStoreConfig; |
| 153 | } |
|
| 154 | } |
| This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |