You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by mp...@apache.org on 2002/08/22 16:07:56 UTC
cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler JobConfig.java LoggerConfig.java JobStoreConfig.java Scheduler.java SchedulerConfig.java ThreadPoolConfig.java TriggerConfig.java
mpoeschl 2002/08/22 07:07:56
Modified: src/java/org/apache/stratum/lifecycle Configurable.java
Reconfigurable.java
src/java/org/apache/stratum/messenger
MessengerComponent.java
src/java/org/apache/stratum/scheduler JobConfig.java
LoggerConfig.java JobStoreConfig.java
Scheduler.java SchedulerConfig.java
ThreadPoolConfig.java TriggerConfig.java
Log:
cleanup (no functional changes)
Revision Changes Path
1.6 +2 -2 jakarta-turbine-stratum/src/java/org/apache/stratum/lifecycle/Configurable.java
Index: Configurable.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/lifecycle/Configurable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Configurable.java 16 Apr 2002 20:58:16 -0000 1.5
+++ Configurable.java 22 Aug 2002 14:07:55 -0000 1.6
@@ -70,6 +70,6 @@
*
* @param configuration
*/
- void configure( Configuration configuration )
+ void configure(Configuration configuration)
throws NestableException;
}
1.5 +62 -1 jakarta-turbine-stratum/src/java/org/apache/stratum/lifecycle/Reconfigurable.java
Index: Reconfigurable.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/lifecycle/Reconfigurable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Reconfigurable.java 16 Apr 2002 20:58:16 -0000 1.4
+++ Reconfigurable.java 22 Aug 2002 14:07:55 -0000 1.5
@@ -1,10 +1,71 @@
package org.apache.stratum.lifecycle;
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * "Apache Turbine", nor may "Apache" appear in their name, without
+ * prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
import org.apache.commons.lang.exception.NestableException;
import org.apache.commons.configuration.Configuration;
+/**
+ * The Reconfigurable interface is used by components that need to be
+ * reconfigured.
+ *
+ * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
+ * @version $Id$
+ */
public interface Reconfigurable
{
- void reconfigure( Configuration configuration )
+ void reconfigure(Configuration configuration)
throws NestableException;
}
1.2 +4 -5 jakarta-turbine-stratum/src/java/org/apache/stratum/messenger/MessengerComponent.java
Index: MessengerComponent.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/messenger/MessengerComponent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MessengerComponent.java 22 Jun 2002 04:27:33 -0000 1.1
+++ MessengerComponent.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,7 +55,6 @@
*/
import org.apache.commons.configuration.Configuration;
-import org.apache.commons.lang.exception.NestableException;
import org.apache.stratum.lifecycle.Configurable;
import org.apache.stratum.lifecycle.Initializable;
@@ -79,8 +78,8 @@
{
/** The key for property 'messenger.xml.url' */
private static final String MESSENGER_XML_URL = "messenger.xml.url";
-
- /** The location of the Messenger.xml file */
+
+ /** The location of the Messenger.xml file */
private String messengerXmlUrl;
/**
@@ -91,7 +90,7 @@
* @param configuration Configuration object containing the
* 'messenger.xml.url' property
*/
- public void configure(Configuration configuration)
+ public void configure(Configuration configuration)
{
messengerXmlUrl = configuration.getString(MESSENGER_XML_URL);
}
1.2 +24 -27 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/JobConfig.java
Index: JobConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/JobConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JobConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ JobConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,45 +55,44 @@
*/
-/**
+/**
* This bean represents the settings used to create a JobDetail
* object for use in the Quartz scheduler.
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
* @version $Id$
*/
-public class JobConfig
+public class JobConfig
{
/**
* The name that the Job will use.
*/
private String name;
-
+
/**
* The group the job will be associated with
*/
private String group;
-
+
/**
* The full package/class name for the Job that will run
*/
private String className;
-
+
/**
* Default contructor
*/
- public JobConfig()
+ public JobConfig()
{
}
/**
- * This is the name by which the job will
- * be identified in Quartz
+ * This is the name by which the job will be identified in Quartz
*
- * @param name of the Job
+ * @param s name of the Job
*/
- public void setname(String s)
+ public void setname(String s)
{
this.name = s;
}
@@ -103,47 +102,45 @@
*
* @return name of the Job
*/
- public String getName()
+ public String getName()
{
return this.name;
}
-
/**
- * This is the group with which the job will
- * be associated in Quartz.
+ * This is the group with which the job will be associated in Quartz.
*
- * @param name of the Group
+ * @param s name of the Group
*/
- public void setGroup(String s)
+ public void setGroup(String s)
{
this.group = s;
}
/**
- * The group name that this job will be
- * associated with
+ * The group name that this job will be associated with
*
* @return the group name
*/
- public String getGroup()
+ public String getGroup()
{
return this.group;
}
-
+
/**
- * This is the full package/class name of the
- * Job that Quartz will run
- */
- public void setClassName(String s)
+ * This is the full package/class name of the job that Quartz will run
+ *
+ * @param s class name
+ */
+ public void setClassName(String s)
{
this.className = s;
}
/**
- *@return the full package/class name
+ * @return the full package/class name
*/
- public String getClassName()
+ public String getClassName()
{
return this.className;
}
1.2 +29 -30 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/LoggerConfig.java
Index: LoggerConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/LoggerConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LoggerConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ LoggerConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,31 +55,31 @@
*/
-/**
+/**
* This bean represents the settings used to assign logger
* properties for use in the Quartz scheduler.
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
* @version $Id$
*/
-public class LoggerConfig
+public class LoggerConfig
{
/**
* The name of the logger.
*/
private String name;
-
+
/**
* The classname the is the Quartz logger.
*/
private String className;
-
+
/**
* The priority for the logger.
*/
private String priority;
-
+
/**
* The output file for the Quartz logger.
*/
@@ -92,37 +92,36 @@
/**
* Default contructor
- */
- public LoggerConfig()
+ */
+ public LoggerConfig()
{
}
/**
- * This is the name of the logger
- * that has will registered with Quartz.
+ * This is the name of the logger that has will registered with Quartz.
*
- * @param logger name
+ * @param s logger name
*/
- public void setName(String s)
+ public void setName(String s)
{
this.name = s;
}
/**
- * @return the name of the logger
+ * @return the name of the logger
*/
- public String getName()
+ public String getName()
{
return this.name;
}
/**
- * This is the full package/class name of the
+ * This is the full package/class name of the
* class used for the Quartz logger.
*
- * @param the full package/class name used for the logger
+ * @param s the full package/class name used for the logger
*/
- public void setClassName(String s)
+ public void setClassName(String s)
{
this.className = s;
}
@@ -130,7 +129,7 @@
/**
* @return the full package/class name used for the logger
*/
- public String getClassName()
+ public String getClassName()
{
return this.className;
}
@@ -138,17 +137,17 @@
/**
* The priority of the logger
*
- * @param priority
+ * @param s priority
*/
- public void setPriority(String s)
+ public void setPriority(String s)
{
this.priority = s;
}
/**
- * @return the priority of the logger
+ * @return the priority of the logger
*/
- public String getPriority()
+ public String getPriority()
{
return this.priority;
}
@@ -156,17 +155,17 @@
/**
* The outputFile of the logger
*
- * @param outputFile
+ * @param s outputFile
*/
- public void setOutputFile(String s)
+ public void setOutputFile(String s)
{
this.outputFile = s;
}
/**
- * @return the outputFile of the logger
+ * @return the outputFile of the logger
*/
- public String getOutputFile()
+ public String getOutputFile()
{
return this.outputFile;
}
@@ -174,17 +173,17 @@
/**
* The category of the logger
*
- * @param category
+ * @param s category
*/
- public void setCategory(String s)
+ public void setCategory(String s)
{
this.category = s;
}
/**
- * @return the category of the logger
+ * @return the category of the logger
*/
- public String getCategory()
+ public String getCategory()
{
return this.category;
}
1.2 +16 -17 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/JobStoreConfig.java
Index: JobStoreConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/JobStoreConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JobStoreConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ JobStoreConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,61 +55,60 @@
*/
-/**
+/**
* This bean represents the settings used to assign jobstore
* properties for use in the Quartz scheduler.
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
* @version $Id$
*/
-public class JobStoreConfig
+public class JobStoreConfig
{
/**
* The loggername used by the Quartz jobstore
*/
private String loggerName;
-
+
/**
* The classname used by the Quartz jobstore
*/
private String className;
-
+
/**
* Default contructor
- */
- public JobStoreConfig()
+ */
+ public JobStoreConfig()
{
}
/**
* This is the reference name of the logger
- * that has been registered with Quartz that
+ * that has been registered with Quartz that
* will be used by the Quartz jobstore.
*
- * @param logger name
+ * @param s logger name
*/
- public void setLoggerName(String s)
+ public void setLoggerName(String s)
{
this.loggerName = s;
}
/**
- * @return the name of the logger
- * for the jobstore
+ * @return the name of the logger for the jobstore
*/
- public String getLoggerName()
+ public String getLoggerName()
{
return this.loggerName;
}
/**
- * This is the full package/class name of the
+ * This is the full package/class name of the
* class used for the Quartz jobstore.
*
- * @param the full package/class name used for the jobstore
+ * @param s the full package/class name used for the jobstore
*/
- public void setClassName(String s)
+ public void setClassName(String s)
{
this.className = s;
}
@@ -117,7 +116,7 @@
/**
* @return the full package/class name used for the jobstore
*/
- public String getClassName()
+ public String getClassName()
{
return this.className;
}
1.4 +117 -123 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/Scheduler.java
Index: Scheduler.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/Scheduler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Scheduler.java 12 Jun 2002 14:05:50 -0000 1.3
+++ Scheduler.java 22 Aug 2002 14:07:56 -0000 1.4
@@ -55,16 +55,11 @@
*/
import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
-import java.util.Vector;
-import java.util.Date;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.configuration.ConfigurationConverter;
import org.apache.log4j.Category;
@@ -85,7 +80,7 @@
import org.quartz.impl.StdScheduler;
/**
- * This class is the Scheduler component that implements a
+ * This class is the Scheduler component that implements a
* Quartz scheduler.
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
@@ -99,119 +94,124 @@
* Log4j category used for logging.
*/
private static Category log = Category.getInstance(Scheduler.class);
-
- private static String confLocation = "/projects/jakarta-turbine-stratum/src/test-conf/Scheduler.properties";
+
+ private static String confLocation
+ = "/projects/jakarta-turbine-stratum/src/test-conf/Scheduler.properties";
private StdSchedulerFactory schedulerFactory ;
protected StdScheduler scheduler;
/**
* Just a command line test tool to start the scheduler from
- * the command line. If looks for the properties file in the
+ * the command line. If looks for the properties file in the
* following location:<p/>
- * /projects/jakarta-turbine-stratum/src/test-conf/Scheduler.properties
- *
+ * /projects/jakarta-turbine-stratum/src/test-conf/Scheduler.properties
+ *
+ * @param args command line arguments
+ * @throws Exception
*/
- public static void main (String args[])
- throws Exception
- {
- Scheduler sched = new Scheduler();
- PropertiesConfiguration conf = new PropertiesConfiguration(confLocation);
- sched.configure(conf);
- sched.start();
- }
+ public static void main (String args[]) throws Exception
+ {
+ Scheduler sched = new Scheduler();
+ PropertiesConfiguration conf
+ = new PropertiesConfiguration(confLocation);
+ sched.configure(conf);
+ sched.start();
+ }
/**
* start the scheduler.
+ *
+ * @throws Exception
*/
- public void start()
- throws Exception
+ public void start() throws Exception
{
scheduler.start();
}
/**
- * start the scheduler.
+ * stop the scheduler.
+ *
+ * @throws Exception
*/
- public void stop()
- throws Exception
+ public void stop() throws Exception
{
scheduler.shutdown();
}
/**
* Configure the Scheduler
+ *
+ * @param configuration the configuration
+ * @throws NestableException
*/
- public void configure(Configuration configuration)
- throws NestableException
+ public void configure(Configuration configuration) throws NestableException
{
String xmlLocation = configuration.getString("scheduler.config.location");
-
+
try
{
- // get scheduler factory and initialize it with
+ // get scheduler factory and initialize it with
// settings from the .xml file
SchedulerConfig schedConfig = getSchedulerConfig(xmlLocation);
Properties factoryProps;
- try
- {
+ try
+ {
factoryProps = getFactoryProps(schedConfig);
- }
- catch (NullPointerException ex)
- {
+ }
+ catch (NullPointerException ex)
+ {
log.error("Error loading properties to initialize" +
- " Scheduler Factory. Please make sure the following" +
- " elements are properly filled out in the" +
- " Scheduler .xml config file:\n" +
- " <instanceName></instanceName>\n" +
- " <loggerName></loggerName>\n" +
- " <threadPoolConfig>\n" +
- " <className></className>\n" +
- " <threadCount></threadCount>\n" +
- " <threadPriority></threadPriority>\n" +
- " <loggerName></loggerName>\n" +
- " </threadPoolConfig>\n" +
- " <jobStoreConfig>\n" +
- " <className></className>\n" +
- " <loggerName></loggerName>\n" +
- " </jobStoreConfig>");
- return;
- }
-
+ " Scheduler Factory. Please make sure the following" +
+ " elements are properly filled out in the" +
+ " Scheduler .xml config file:\n" +
+ " <instanceName></instanceName>\n" +
+ " <loggerName></loggerName>\n" +
+ " <threadPoolConfig>\n" +
+ " <className></className>\n" +
+ " <threadCount></threadCount>\n" +
+ " <threadPriority></threadPriority>\n" +
+ " <loggerName></loggerName>\n" +
+ " </threadPoolConfig>\n" +
+ " <jobStoreConfig>\n" +
+ " <className></className>\n" +
+ " <loggerName></loggerName>\n" +
+ " </jobStoreConfig>");
+ return;
+ }
schedulerFactory = new StdSchedulerFactory();
schedulerFactory.initialize(factoryProps);
- scheduler = (StdScheduler)schedulerFactory.getScheduler();
+ scheduler = (StdScheduler) schedulerFactory.getScheduler();
List jobConfigs = schedConfig.getJobConfigs();
if (!jobConfigs.isEmpty())
{
- for (int i=0;i<jobConfigs.size();i++)
+ for (int i = 0; i < jobConfigs.size(); i++)
{
- JobConfig jobConf = (JobConfig)jobConfigs.get(i);
- String jobName = (String)jobConf.getName();
+ JobConfig jobConf = (JobConfig) jobConfigs.get(i);
+ String jobName = (String) jobConf.getName();
- String jobPrefix = "scheduler.job." + jobName ;
+ String jobPrefix = "scheduler.job." + jobName;
String jobGroup = jobConf.getGroup();
String jobClassName = jobConf.getClassName();
- JobDetail job = new JobDetail(jobName, jobGroup,
+ JobDetail job = new JobDetail(jobName, jobGroup,
Class.forName(jobClassName));
//get the trigger for this job if it exists
- TriggerConfig triggerConf =
- getTriggerConfig(schedConfig, job.getName());
+ TriggerConfig triggerConf
+ = getTriggerConfig(schedConfig, job.getName());
if (triggerConf != null)
{
-
job.getName();
- String triggerGroup = triggerConf.getGroup();
+ String triggerGroup = triggerConf.getGroup();
String triggerName = triggerConf.getName();
- String cronExpression =
+ String cronExpression =
triggerConf.getSeconds() + " " +
triggerConf.getMinutes() + " " +
triggerConf.getHours() + " " +
@@ -220,153 +220,147 @@
triggerConf.getDayOfWeek();
CronTrigger cronTrigger = new CronTrigger(triggerName,
- triggerGroup,
+ triggerGroup,
jobName,
jobGroup,
cronExpression);
-
+
scheduler.scheduleJob(job, cronTrigger);
triggerConf = null;
cronTrigger = null;
-
}
-
}
-
}
}
catch (SchedulerException ex)
{
-
- log.error("Error Initializing Scheduler: " +
- ex.toString(),ex);
+ log.error("Error Initializing Scheduler: " + ex.toString(), ex);
}
catch (ClassNotFoundException ex)
{
- log.error("Error Loading class: " +
- ex.toString(),ex);
+ log.error("Error Loading class: " + ex.toString(), ex);
}
catch (Exception ex)
{
- log.error("Error: " +
- ex.toString(),ex);
- }
+ log.error("Error: " + ex.toString(), ex);
+ }
}
/**
- *@param Scheduler Config
+ * @param schdConf Scheduler Config
*/
private Properties getFactoryProps(SchedulerConfig schdConf)
{
- Properties props = new Properties();
+ Properties props = new Properties();
- props.put("org.quartz.scheduler.instanceName",schdConf.getInstanceName());
- props.put("org.quartz.scheduler.logger", schdConf.getLoggerName());
-
- // configure loggers
- List loggers = schdConf.getLoggerConfigs();
- for (int i = 0; i < loggers.size(); i++)
- {
- LoggerConfig logger = (LoggerConfig)loggers.get(i);
+ props.put("org.quartz.scheduler.instanceName",
+ schdConf.getInstanceName());
+ props.put("org.quartz.scheduler.logger", schdConf.getLoggerName());
+
+ // configure loggers
+ List loggers = schdConf.getLoggerConfigs();
+ for (int i = 0; i < loggers.size(); i++)
+ {
+ LoggerConfig logger = (LoggerConfig) loggers.get(i);
String loggerName = "org.quartz.logger." + logger.getName();
- props.put( loggerName + ".class", logger.getClassName());
- props.put( loggerName + ".loggingPriority", logger.getPriority());
- props.put( loggerName + ".outputFile", logger.getOutputFile());
+ props.put(loggerName + ".class", logger.getClassName());
+ props.put(loggerName + ".loggingPriority", logger.getPriority());
+ props.put(loggerName + ".outputFile", logger.getOutputFile());
if (logger.getCategory() != null)
{
- props.put( loggerName + ".categoryName", logger.getCategory());
+ props.put(loggerName + ".categoryName", logger.getCategory());
}
- }
+ }
- ThreadPoolConfig threadPool = schdConf.getThreadPoolConfig();
- props.put("org.quartz.threadPool.class",
+ ThreadPoolConfig threadPool = schdConf.getThreadPoolConfig();
+ props.put("org.quartz.threadPool.class",
threadPool.getClassName());
- props.put("org.quartz.threadPool.threadCount",
+ props.put("org.quartz.threadPool.threadCount",
threadPool.getThreadCount());
- props.put("org.quartz.threadPool.threadPriority",
+ props.put("org.quartz.threadPool.threadPriority",
threadPool.getThreadPriority());
- props.put("org.quartz.threadPool.logger",
+ props.put("org.quartz.threadPool.logger",
threadPool.getLoggerName());
- JobStoreConfig jobStore = schdConf.getJobStoreConfig();
- props.put("org.quartz.jobStore.class",
+ JobStoreConfig jobStore = schdConf.getJobStoreConfig();
+ props.put("org.quartz.jobStore.class",
jobStore.getClassName());
- props.put("org.quartz.jobStore.logger",
+ props.put("org.quartz.jobStore.logger",
jobStore.getLoggerName());
-
- return props;
+ return props;
}
-
+
/**
- * Loads the SchedulerConfig object from the xml file
- *@param location of the xml file
+ * Loads the SchedulerConfig object from the xml file
+ *
+ * @param xmlLocation of the xml file
+ * @throws Exception
*/
private SchedulerConfig getSchedulerConfig(String xmlLocation)
- throws Exception
+ throws Exception
{
FileInputStream in = new FileInputStream(xmlLocation);
// create a new BeanReader
BeanReader reader = createBeanReader();
- SchedulerConfig schedConf = (SchedulerConfig) reader.parse(in);
+ SchedulerConfig schedConf = (SchedulerConfig) reader.parse(in);
return schedConf;
}
-
+
/**
* Creates a beanreader
*
* @return beanreader
- *
+ * @throws Exception
*/
- private BeanReader createBeanReader() throws Exception {
+ private BeanReader createBeanReader() throws Exception
+ {
BeanReader reader = new BeanReader();
- reader.setXMLIntrospector( createXMLIntrospector() );
- reader.registerBeanClass( SchedulerConfig.class );
+ reader.setXMLIntrospector(createXMLIntrospector());
+ reader.registerBeanClass(SchedulerConfig.class);
return reader;
}
- /**
+ /**
* Loads Xml Introspector with needed values
*
* @return introspector
*/
- private XMLIntrospector createXMLIntrospector() {
+ private XMLIntrospector createXMLIntrospector()
+ {
XMLIntrospector introspector = new XMLIntrospector();
-
+
// set elements for attributes to true
introspector.setAttributesForPrimitives(false);
-
+
// wrap collections in an XML element
//introspector.setWrapCollectionsInElement(true);
-
+
// turn bean elements first letter into lower case
- introspector.setNameMapper( new DecapitalizeNameMapper() );
+ introspector.setNameMapper(new DecapitalizeNameMapper());
- introspector.setPluralStemmer( new DefaultPluralStemmer() );
+ introspector.setPluralStemmer(new DefaultPluralStemmer());
return introspector;
}
- private TriggerConfig getTriggerConfig(SchedulerConfig schedConf,
+ private TriggerConfig getTriggerConfig(SchedulerConfig schedConf,
String jobName)
{
TriggerConfig trig = null;
List triggers = schedConf.getTriggerConfigs();
for (int i = 0; i < triggers.size(); i++)
{
- TriggerConfig tmpTrig = (TriggerConfig)triggers.get(i);
+ TriggerConfig tmpTrig = (TriggerConfig) triggers.get(i);
if (tmpTrig.getJobName().equals(jobName))
{
trig = tmpTrig;
return trig;
}
}
-
return trig;
}
-
-
}
1.2 +29 -26 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/SchedulerConfig.java
Index: SchedulerConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/SchedulerConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SchedulerConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ SchedulerConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -57,9 +57,8 @@
//java classes
import java.util.List;
import java.util.ArrayList;
-import org.apache.commons.betwixt.io.BeanReader;
-/**
+/**
* This bean represents all of the configuration information
* needed to load the Quartz scheduler.
*
@@ -72,7 +71,7 @@
* Scheduler reference name
*/
private String instanceName;
-
+
/**
* Scheduler logger name
*/
@@ -87,26 +86,26 @@
* List of loggers
*/
private List loggerConfigs;
-
+
/**
* List of triggers
*/
private List triggerConfigs;
-
+
/**
* The jobstore for the Scheduler
*/
private JobStoreConfig jobStoreConfig;
-
+
/**
* The threadpool for the Scheduler
*/
private ThreadPoolConfig threadPoolConfig;
-
+
/**
* Default contructor
*/
- public SchedulerConfig()
+ public SchedulerConfig()
{
jobConfigs = new ArrayList();
loggerConfigs = new ArrayList();
@@ -117,9 +116,9 @@
* Set the reference name given to the scheduler
* that is loaded into Quartz
*
- * @param instanceName
+ * @param s instanceName
*/
- public void setInstanceName(String s)
+ public void setInstanceName(String s)
{
this.instanceName = s;
}
@@ -129,17 +128,17 @@
*
* @return instance name
*/
- public String getInstanceName()
+ public String getInstanceName()
{
return this.instanceName;
- }
+ }
/**
* Set the logger name for the scheduler
*
- * @param loggerName
+ * @param s loggerName
*/
- public void setLoggerName(String s)
+ public void setLoggerName(String s)
{
this.loggerName = s;
}
@@ -149,15 +148,15 @@
*
* @return logger name
*/
- public String getLoggerName()
+ public String getLoggerName()
{
return this.loggerName;
- }
+ }
/**
* Add a Job Configuraton to Scheduler Config
*
- * @param jobConfig Job configuration
+ * @param jconf Job configuration
*/
public void addJobConfig(JobConfig jconf)
{
@@ -217,9 +216,10 @@
/**
* Set the threadPool for the scheduler to use
*
- * @param threadPool
+ * @param thdPool threadPool
*/
- public void setThreadPoolConfig(ThreadPoolConfig thdPool) {
+ public void setThreadPoolConfig(ThreadPoolConfig thdPool)
+ {
this.threadPoolConfig = thdPool;
}
@@ -228,17 +228,19 @@
*
* @return threadPool
*/
- public ThreadPoolConfig getThreadPoolConfig() {
+ public ThreadPoolConfig getThreadPoolConfig()
+ {
return this.threadPoolConfig;
}
-
+
/**
* Set the jobstore for the scheduler to use
*
- * @param jobstore
+ * @param jobStr jobstore
*/
- public void setJobStoreConfig(JobStoreConfig jobStr) {
+ public void setJobStoreConfig(JobStoreConfig jobStr)
+ {
this.jobStoreConfig = jobStr;
}
@@ -247,7 +249,8 @@
*
* @return jobStore
*/
- public JobStoreConfig getJobStoreConfig() {
+ public JobStoreConfig getJobStoreConfig()
+ {
return this.jobStoreConfig;
- }
+ }
}
1.2 +21 -21 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/ThreadPoolConfig.java
Index: ThreadPoolConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/ThreadPoolConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ThreadPoolConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ ThreadPoolConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,26 +55,26 @@
*/
-/**
+/**
* This bean represents the settings used to assign thread pool
* properties for use in the Quartz scheduler.
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
* @version $Id$
*/
-public class ThreadPoolConfig
+public class ThreadPoolConfig
{
/**
* The loggername used by the Quartz threadpool
*/
private String loggerName;
-
+
/**
* The classname used by the Quartz threadpool
*/
private String className;
-
+
/**
* The threadcount used by the Quartz threadpool
*/
@@ -87,19 +87,19 @@
/**
* Default contructor
- */
- public ThreadPoolConfig()
+ */
+ public ThreadPoolConfig()
{
}
/**
* This is the reference name of the logger
- * that has been registered with Quartz that
+ * that has been registered with Quartz that
* will be used by the Quartz threadpool.
*
- * @param logger name
+ * @param s logger name
*/
- public void setLoggerName(String s)
+ public void setLoggerName(String s)
{
this.loggerName = s;
}
@@ -107,18 +107,18 @@
/**
* @return the name of the logger for the threadpool
*/
- public String getLoggerName()
+ public String getLoggerName()
{
return this.loggerName;
}
/**
- * This is the full package/class name of the
+ * This is the full package/class name of the
* class used for the Quartz threadpool.
*
- * @param the full package/class name used for the threadpool
+ * @param s the full package/class name used for the threadpool
*/
- public void setClassName(String s)
+ public void setClassName(String s)
{
this.className = s;
}
@@ -126,7 +126,7 @@
/**
* @return the full package/class name used for the threadpool
*/
- public String getClassName()
+ public String getClassName()
{
return this.className;
}
@@ -134,9 +134,9 @@
/**
* This is the thread count used for the Quartz threadpool.
*
- * @param the thread count used for the Quartz threadpool.
+ * @param s the thread count used for the Quartz threadpool.
*/
- public void setThreadCount(String s)
+ public void setThreadCount(String s)
{
this.threadCount = s;
}
@@ -144,7 +144,7 @@
/**
* @return the thread count used for the Quartz threadpool.
*/
- public String getThreadCount()
+ public String getThreadCount()
{
return this.threadCount;
}
@@ -152,9 +152,9 @@
/**
* This is the thread priority used for the Quartz threadpool.
*
- * @param the thread priority for the Quartz threadpool.
+ * @param s the thread priority for the Quartz threadpool.
*/
- public void setThreadPriority(String s)
+ public void setThreadPriority(String s)
{
this.threadPriority = s;
}
@@ -162,7 +162,7 @@
/**
* @return the thread priority used for the Quartz threadpool.
*/
- public String getThreadPriority()
+ public String getThreadPriority()
{
return this.threadPriority;
}
1.2 +97 -101 jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/TriggerConfig.java
Index: TriggerConfig.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/scheduler/TriggerConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TriggerConfig.java 7 Jun 2002 11:41:34 -0000 1.1
+++ TriggerConfig.java 22 Aug 2002 14:07:56 -0000 1.2
@@ -55,16 +55,16 @@
*/
-/**
+/**
* This bean represents the settings used to create a Trigger
* object for use in the Quartz scheduler
*
*
- * <pre>
+ * <pre>
* This trigger is a Quartz trigger that uses a "Cron-Expression" which
- * is a string comprised of 6 fields separated by white space. The 6
+ * is a string comprised of 6 fields separated by white space. The 6
* fields are as follows:
- *
+ *
* Field Name Allowed Values Allowed Special Characters
* seconds 0-59 , - * /
* minutes 0-59 , - * /
@@ -73,79 +73,77 @@
* month 1-12 or JAN-DEC , - * /
* dayOfWeek 1-7 or SUN-SAT , - * ? / L C
*
- * -The '*' character is used to specify all values. For example, "*" in
+ * -The '*' character is used to specify all values. For example, "*" in
* the minute field means "every minute".
*
- * -The '?' character is allowed for the day-of-month and day-of-week
- * fields. It is used to specify 'no specific value'. This is useful when
- * you need to specify something in one of the two fileds, but not the
+ * -The '?' character is allowed for the day-of-month and day-of-week
+ * fields. It is used to specify 'no specific value'. This is useful when
+ * you need to specify something in one of the two fileds, but not the
* other. See the examples below for clarification.
*
- * -The '-' character is used to specify ranges For example "10-12" in
+ * -The '-' character is used to specify ranges For example "10-12" in
* the hour field means "the hours 10, 11 and 12".
*
- * -The ',' character is used to specify additional values. For example
- * "MON,WED,FRI" in the day-of-week field means "the days Monday,
+ * -The ',' character is used to specify additional values. For example
+ * "MON,WED,FRI" in the day-of-week field means "the days Monday,
* Wednesday, and Friday".
- *
- * -The '/' character is used to specify increments. For example "0/15"
- * in the seconds field means "the seconds 0, 15, 30, and 45". And "5/15"
+ *
+ * -The '/' character is used to specify increments. For example "0/15"
+ * in the seconds field means "the seconds 0, 15, 30, and 45". And "5/15"
* in the seconds field means "the seconds 5, 20, 35, and 50". You can \
- * also specify '/' after the '*' character - in this case '*' is
+ * also specify '/' after the '*' character - in this case '*' is
* equivalent to having '0' before the '/'.
*
- * -The 'L' character is allowed for the day-of-month and day-of-week
- * fields. This character is short-hand for "last", but it has different
- * meaning in each of the two fields. For example, the value "L" in the
- * day-of-month field means "the last day of the month" - day 31 for
- * January, day 28 for February on non-leap years. If used in the
- * day-of-week field by itself, it simply means "7" or "SAT". But if
- * used in the day-of-week field after another value, it means "the
- * last xxx day of the month" - for example "6L" or "FRIL" both mean
- * "the last friday of the month". When using the 'L' option, it is
- * important not to specify lists, or ranges of values, as you'll get
+ * -The 'L' character is allowed for the day-of-month and day-of-week
+ * fields. This character is short-hand for "last", but it has different
+ * meaning in each of the two fields. For example, the value "L" in the
+ * day-of-month field means "the last day of the month" - day 31 for
+ * January, day 28 for February on non-leap years. If used in the
+ * day-of-week field by itself, it simply means "7" or "SAT". But if
+ * used in the day-of-week field after another value, it means "the
+ * last xxx day of the month" - for example "6L" or "FRIL" both mean
+ * "the last friday of the month". When using the 'L' option, it is
+ * important not to specify lists, or ranges of values, as you'll get
* confusing results.
*
- * -The 'C' character is allowed for the day-of-month and day-of-week
- * fields. This character is short-hand for "calendar". This means values
- * are calculated against the associated calendar, if any. If no calendar
- * is associated, then it is equivalent to having an all-inclusive
- * calendar. A value of "5C" in the day-of-month field means "the first
- * day included by the calendar on or after the 5th". A value of "1C" in
- * the day-of-week field means "the first day included by the calendar on
- * or after sunday".
+ * -The 'C' character is allowed for the day-of-month and day-of-week
+ * fields. This character is short-hand for "calendar". This means values
+ * are calculated against the associated calendar, if any. If no calendar
+ * is associated, then it is equivalent to having an all-inclusive
+ * calendar. A value of "5C" in the day-of-month field means "the first
+ * day included by the calendar on or after the 5th". A value of "1C" in
+ * the day-of-week field means "the first day included by the calendar on
+ * or after sunday".
* </pre>
*
* @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
* @version $Id$
*/
-public class TriggerConfig
+public class TriggerConfig
{
/**
- * The type of trigger. Currently the only type supported
- * is the cron.
+ * The type of trigger. Currently the only type supported is the cron.
*/
private String type;
-
+
/**
* The name of the trigger
*/
private String name;
-
+
/**
- * The name of the job to associate with this
- * this trigger.
+ * The name of the job to associate with this this trigger.
*/
private String jobName;
-
+
/**
* The name of the group to associate this trigger with
*/
private String group;
-
+
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* seconds 0-59 , - * /
* </pre>
@@ -153,77 +151,76 @@
private String seconds = "*";
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* minutes 0-59 , - * /
* </pre>
- */
+ */
private String minutes = "*";
-
+
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* hours 0-23 , - * /
* </pre>
- */
+ */
private String hours = "*";
-
+
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* dayOfMonth 0-31 , - * ? / L C
* </pre>
- */
+ */
private String dayOfMonth = "*";
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* month 1-12 or JAN-DEC , - * /
* </pre>
- */
+ */
private String month = "*";
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* dayOfWeek 1-7 or SUN-SAT , - * ? / L C
* </pre>
- */
+ */
private String dayOfWeek = "*";
-
+
/**
* Default contructor
- */
- public TriggerConfig()
+ */
+ public TriggerConfig()
{
}
/**
* This is the name of the trigger
*
- * @param trigger name
+ * @param s trigger name
*/
- public void setName(String s)
+ public void setName(String s)
{
this.name = s;
}
/**
- * @return the name of the trigger
+ * @return the name of the trigger
*/
- public String getName()
+ public String getName()
{
return this.name;
}
/**
- * This is the name of group that the trigger
- * is associated with
+ * This is the name of group that the trigger is associated with
*
- * @param group name
+ * @param s group name
*/
- public void setGroup(String s)
+ public void setGroup(String s)
{
this.group = s;
}
@@ -231,18 +228,17 @@
/**
* @return the group name
*/
- public String getGroup()
+ public String getGroup()
{
return this.group;
}
/**
- * This is the name of job that the trigger
- * is associated with
+ * This is the name of job that the trigger is associated with
*
- * @param job name
+ * @param s job name
*/
- public void setJobName(String s)
+ public void setJobName(String s)
{
this.jobName = s;
}
@@ -250,20 +246,20 @@
/**
* @return the job name
*/
- public String getJobName()
+ public String getJobName()
{
return this.jobName;
}
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* seconds 0-59 , - * /
* </pre>
*
- * @param seconds
+ * @param s seconds
*/
- public void setSeconds(String s)
+ public void setSeconds(String s)
{
this.seconds = s;
}
@@ -271,41 +267,41 @@
/**
* @return seconds
*/
- public String getSeconds()
+ public String getSeconds()
{
return this.seconds;
}
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* minutes 0-59 , - * /
* </pre>
*
- * @param minutes
+ * @param s minutes
*/
- public void setMinutes(String s)
+ public void setMinutes(String s)
{
this.minutes = s;
}
/**
- *@return mintutes
+ * @return mintutes
*/
- public String getMinutes()
+ public String getMinutes()
{
return this.minutes;
}
-
+
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* hours 0-23 , - * /
* </pre>
*
- * @param hours
+ * @param s hours
*/
- public void setHours(String s)
+ public void setHours(String s)
{
this.hours = s;
}
@@ -313,62 +309,62 @@
/**
* @return hours
*/
- public String getHours()
+ public String getHours()
{
return this.hours;
}
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* dayOfMonth 0-31 , - * ? / L C
* </pre>
*
- * @param day of month
+ * @param s day of month
*/
- public void setDayOfMonth(String s)
+ public void setDayOfMonth(String s)
{
this.dayOfMonth = s;
}
/**
- *@return day of month
+ * @return day of month
*/
- public String getDayOfMonth()
+ public String getDayOfMonth()
{
return this.dayOfMonth;
}
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* month 1-12 or JAN-DEC , - * /
* </pre>
*
- *@param month
+ *@param s month
*/
- public void setMonth(String s)
+ public void setMonth(String s)
{
this.month = s;
}
/**
- *@return month
+ * @return month
*/
- public String getMonth()
+ public String getMonth()
{
return this.month;
}
/**
- * <pre>
+ * <pre>
* Field Name Allowed Values Allowed Special Characters
* dayOfWeek 1-7 or SUN-SAT , - * ? / L C
* </pre>
*
- * @param day of the week
+ * @param s day of the week
*/
- public void setDayOfWeek(String s)
+ public void setDayOfWeek(String s)
{
this.dayOfWeek = s;
}
@@ -376,7 +372,7 @@
/**
*@return day of the week
*/
- public String getDayOfWeek()
+ public String getDayOfWeek()
{
return this.dayOfWeek;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>