batchserver-cvs Mailing List for Enterprise Batch Server (Page 8)
Brought to you by:
suresh_pragada
You can subscribe to this list here.
2006 |
Jan
|
Feb
(10) |
Mar
(159) |
Apr
(5) |
May
(52) |
Jun
(70) |
Jul
|
Aug
(28) |
Sep
(256) |
Oct
(38) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Suresh <sur...@us...> - 2006-09-15 06:21:56
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17089 Added Files: ClientServerDb4oRepository.java Log Message: no message --- NEW FILE: ClientServerDb4oRepository.java --- /* * ClientServerDb4oRepository.java * * Created on September 14, 2006, 11:13 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.repository.db4o; import com.db4o.Db4o; import com.db4o.ObjectContainer; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; /** * <p> * ClientServerDb4oRepository access the Db4o Server and use it as a repository. * This requires the db4o server configuration in the repository configuration. * Framework provides a utility shell script to start the server. Following is an * example repository configuration to use Db4o in client and server mode. * <br><br> * <pre> * <repository-config repository-class-name="org.jmonks.batchserver.framework.repository.db4o.ClientServerDb4oRepository"> * <property key="db4o-server-name">server name or IP Address</property> * <property key="db4o-server-port">4545</property> * <property key="db4o-server-username">scott</property> * <property key="db4o-server-password">tiger</property> * </repository-config> * </pre> * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class ClientServerDb4oRepository extends Db4oRepository { private static Logger logger=Logger.getLogger(ClientServerDb4oRepository.class); /** * Property identifies the Db4o Server name which is <code>db4o-server-name</code>. */ public static final String PROPERTY_DB4O_SERVER_NAME = "db4o-server-name"; /** * Property identifies the Db4o Server port which is <code>db4o-server-port</code>. */ public static final String PROPERTY_DB4O_SERVER_PORT = "db4o-server-port"; /** * Property identifies the Db4o Server user name which is <code>db4o-server-username</code>. */ public static final String PROPERTY_DB4O_SERVER_USERNAME = "db4o-server-username"; /** * Property identifies the Db4o Server password which is <code>db4o-server-password</code>. */ public static final String PROPERTY_DB4O_SERVER_PASSWORD = "db4o-server-password"; /** * Enables the creation of the ClientServerDb4oRepository instance from the factory method. */ public ClientServerDb4oRepository() { } /** * <p> * Initializes the ClientServerDb4oRepository by accepting the map consist of properties * needed to access Db4o server. This make sure required properties like * <code>db4o-server-name</code>, <code>db4o-server-port</code>, * <code>db4o-server-username</code> and <code>db4o-server-password</code> have been defined * and the value defined for this property is valid. * </p> * * @param configProps Map contains the configuration properties. * * @throws ConfigurationException If any one of the required properties are not defined and * the value specified is invalid. * @throws IllegalArgumentException If given configProps is null. */ protected void init(Map configProps) { logger.trace("Entering init"); if(configProps==null) throw new IllegalArgumentException("Map to call the init cannot be null."); super.repositoryConfigProperties=new HashMap(configProps); String db4oServerName=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_NAME); String db4oServerPort=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_PORT); String db4oServerUserName=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_USERNAME); String db4oServerPassword=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_PASSWORD); if(db4oServerName==null || "".equals(db4oServerName) || db4oServerPort==null || "".equals(db4oServerPort) || db4oServerUserName==null || "".equals(db4oServerUserName) || db4oServerPassword==null || "".equals(db4oServerPassword)) throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Required properties to access Db4o server are missing."); else { /** * Just to make sure, would be able to setup the repository. */ ObjectContainer container=createContainer(super.repositoryConfigProperties); if(container==null) throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Unable to access the db4o server using given properites = " + super.repositoryConfigProperties); container.close(); } logger.trace("Exiting init"); } /** * @see org.jmonks.batchserver.framework.repository.db4o.Db4oRepository#createContainer(Map) */ protected ObjectContainer createContainer(Map configProps) { ObjectContainer container=null; try { String db4oServerName=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_NAME); int db4oServerPort=Integer.parseInt((String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_PORT)); String db4oServerUserName=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_USERNAME); String db4oServerPassword=(String)this.repositoryConfigProperties.get(ClientServerDb4oRepository.PROPERTY_DB4O_SERVER_PASSWORD); container=Db4o.openClient(db4oServerName, db4oServerPort, db4oServerUserName, db4oServerPassword); } catch(IOException exception) { exception.printStackTrace(); logger.fatal("IOException while opening the client with the configuration = " + configProps.toString(), exception); } return container; } } |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/controller/pool Modified Files: AbstractPoolJobLoader.java AbstractPoolJobProcessor.java PoolJobController.java PoolJobLoader.java PoolJobProcessor.java Log Message: no message Index: PoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobProcessor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PoolJobProcessor.java 14 Sep 2006 23:05:13 -0000 1.9 --- PoolJobProcessor.java 15 Sep 2006 06:21:12 -0000 1.10 *************** *** 7,11 **** * <p> * PoolJobProcessor gets the job data to be processed from the job pool and ! * processes it. Along with the processing methods, it exposes some method used * by management and monitoring clients. * </p> --- 7,11 ---- * <p> * PoolJobProcessor gets the job data to be processed from the job pool and ! * processes it. Along with the processing methods, it exposes some methods used * by management and monitoring clients. * </p> *************** *** 19,24 **** /** * <p> ! * Process the job data getting from the job pool and quits when job pool ! * out of the job data(returns null). * </p> * --- 19,42 ---- /** * <p> ! * Process the job data available in the job pool until the job loader done loading ! * of all the job data. JobContext reference provides the access to ! * many different resources in the framework. Following is an examples shows ! * the sample implementation of processPool method. ! * <br><br> ! * <pre> ! * public class MyPoolJobProcessor implements PoolJobProcessor ! * { ! * public ErrorCode processPool(JobContext jobContext, JobPool pool) ! * { ! * Object jobData=null; ! * while((jobData=pool.getNextJobData())!=null) ! * { ! * // Perform the business logic on jobData ! * } ! * ! * return ErrorCode.JOB_COMPLETED_SUCCESSFULLY; ! * } ! * } ! * </pre> * </p> * Index: AbstractPoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobLoader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AbstractPoolJobLoader.java 14 Sep 2006 23:04:59 -0000 1.11 --- AbstractPoolJobLoader.java 15 Sep 2006 06:21:12 -0000 1.12 *************** *** 210,214 **** * <br> * <pre> ! * public class MyLoader extends AbstractPoolJobLoader * { * public ErrorCode loadPool(JobContext jobContext) --- 210,214 ---- * <br> * <pre> ! * public class MyPoolJobLoader extends AbstractPoolJobLoader * { * public ErrorCode loadPool(JobContext jobContext) Index: PoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PoolJobLoader.java 14 Sep 2006 23:05:13 -0000 1.10 --- PoolJobLoader.java 15 Sep 2006 06:21:12 -0000 1.11 *************** *** 28,36 **** * Example loading the 100 integer objects into the pool. * <pre> ! * public class MyLoader implements PoolJobLoader * { * public ErrorCode loadPool(JobContext jobContext, JobPool pool) * { ! * for(int i=0;i<100;i++ * pool.loadJobData(new Integer(i)); * pool.loadJobData(null); --- 28,36 ---- * Example loading the 100 integer objects into the pool. * <pre> ! * public class MyPoolJobLoader implements PoolJobLoader * { * public ErrorCode loadPool(JobContext jobContext, JobPool pool) * { ! * for(int i=0;i<100;i++) * pool.loadJobData(new Integer(i)); * pool.loadJobData(null); Index: AbstractPoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobProcessor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractPoolJobProcessor.java 14 Sep 2006 23:04:59 -0000 1.8 --- AbstractPoolJobProcessor.java 15 Sep 2006 06:21:12 -0000 1.9 *************** *** 12,16 **** * Abstract pool job processor implements some of the responsiblites defined by the * pool job processor and leaves the application specific functionality implementation ! * to the final processor. * </p> * --- 12,46 ---- * Abstract pool job processor implements some of the responsiblites defined by the * pool job processor and leaves the application specific functionality implementation ! * to the final processor. Following is an example class shows how to make use of the ! * AbstractPoolJobProcessor. ! * <br><br> ! * <pre> ! * public class MyPoolJobProcessor extends AbstractPoolJobProcessor ! * { ! * private Connection connection=null; ! * ! * public void initialize(JobContext jobContext) ! * { ! * // Perform the initialization for this instance of job processor. ! * // Good place to get any references to any resources to be used to ! * // to processing of all the job data. ! * connection=ConnectionManager.getDBConnection(); ! * } ! * ! * public ErrorCode process(Object jobData) ! * { ! * // Perform the business logic on the incoming jobData. ! * connection.performBusinessLogic(jobData); ! * ! * return ErrorCode.JOB_COMPLETED_SUCCESSFULLY; ! * } ! * ! * public void cleanup() ! * { ! * // Do some cleanup after all the jobData has been processed. ! * connection.close(); ! * } ! * } ! * </pre> * </p> * *************** *** 51,58 **** * <p> * Initializes the processor implementation by calling the <i>initialize</i> ! * method by passing map contains the properties defined for the processor in ! * job configuration, gets the job data from the pool and passes that information ! * to the processor implementation for processing and cleansup the processor ! * implementation by calling the <i>cleanup</i>. * </p> * --- 81,88 ---- * <p> * Initializes the processor implementation by calling the <i>initialize</i> ! * method by passing job context reference, gets the job data from the pool ! * and passes that information to the processor implementation for ! * processing and cleans up the processor implementation by calling the <i>cleanup</i> ! * method. * </p> * *************** *** 219,226 **** /** * Execute the business logic on the given jobData and return the ! * appropriate error code. The format and type of jobData is depend ! * on the job loader. * * @param jobData Data to be processed. */ public abstract ErrorCode process(Object jobData); --- 249,260 ---- /** * Execute the business logic on the given jobData and return the ! * appropriate error code. The format and type of jobData is depends ! * on the job loader configured for the same job. Usually, there will be ! * an understanding between the loader and processor on the type of jobData ! * being loaded into the pool. * * @param jobData Data to be processed. + * + * @return Returns the status of the processingn of this jobData. */ public abstract ErrorCode process(Object jobData); Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PoolJobController.java 14 Sep 2006 23:05:12 -0000 1.16 --- PoolJobController.java 15 Sep 2006 06:21:12 -0000 1.17 *************** *** 36,52 **** * <pre> * <job-config job-name="process_file_abc"> ! * <job-controller controller-class-name="org.jmonks.batchserver.framework.controller.pool.PoolJobController" ! * controller-config-class-name="org.jmonks.batchserver.framework.config.PoolControllerConfig"> ! * <job-loader pool-job-loader-class-name="com.mycompany.batch.processfileabc.AbcJobLoader"> ! * <property key="loader-info1">loader-value1</property> ! * </job-loader> ! * <job-processor pool-job-processor-class-name="com.mycompany.batch.processfileabc.AbcJobLoader"> ! * <thread-count>1</thread-count> ! * <property key="processor-info1">processor-value1</property> ! * </job-processor> * <job-pool job-pool-class-name="org.jmonks.batchserver.framework.controller.pool.DefaultJobPool"> * <property key="pool-size">50000</property> * </job-pool> ! * <property key="controller-info1">controller-value1</property> * </job-controller> * <job-logging-config> --- 36,50 ---- * <pre> * <job-config job-name="process_file_abc"> ! * <job-controller controller-class-name="org.jmonks.batchserver.framework.controller.pool.PoolJobController"> ! * <pool-job-loader pool-job-loader-class-name="com.mycompany.batch.processfileabc.AbcJobLoader"> ! * <property key="pool-job-loader-config1">pool-job-loader-value1</property> ! * </pool-job-loader> ! * <pool-job-processor pool-job-processor-class-name="com.mycompany.batch.processfileabc.AbcJobProcessor" thread-count="5"> ! * <property key="pool-job-processor-config1">pool-job-processor-value1</property> ! * </pool-job-processor> * <job-pool job-pool-class-name="org.jmonks.batchserver.framework.controller.pool.DefaultJobPool"> * <property key="pool-size">50000</property> * </job-pool> ! * <property key="pool-controller-config1">pool-controller-value1</property> * </job-controller> * <job-logging-config> *************** *** 57,61 **** * <br><br> * <i>DB Configuration is as follows</i> ! * <table> * <tr><td><b>TableName.ColumnName</b></td><td><b>Value</b></td></tr> * <tr><td>job_config.job_name</td><td>process_file_abc</td></tr> --- 55,59 ---- * <br><br> * <i>DB Configuration is as follows</i> ! * <table border="1"> * <tr><td><b>TableName.ColumnName</b></td><td><b>Value</b></td></tr> * <tr><td>job_config.job_name</td><td>process_file_abc</td></tr> *************** *** 401,404 **** --- 399,403 ---- this.jobStatistics.setEndTime(Calendar.getInstance().getTime()); + this.jobStatistics.setMaxMemeoryUsage(Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory()); this.jobStatistics.setRecordsProcessed(this.getProcessedRecordsCount()); |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/config/db Modified Files: DBBasicJobControllerConfig.java DBJobConfig.java DBJobConfigFactory.java DBJobLoggingConfig.java DBPoolJobControllerConfig.java Log Message: no message Index: DBJobLoggingConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobLoggingConfig.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DBJobLoggingConfig.java 14 Sep 2006 23:04:23 -0000 1.2 --- DBJobLoggingConfig.java 15 Sep 2006 06:21:12 -0000 1.3 *************** *** 25,29 **** * <br><br> * <pre> ! * <table> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> --- 25,29 ---- * <br><br> * <pre> ! * <table border="1"> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> Index: DBJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfigFactory.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DBJobConfigFactory.java 14 Sep 2006 23:04:23 -0000 1.11 --- DBJobConfigFactory.java 15 Sep 2006 06:21:12 -0000 1.12 *************** *** 49,53 **** * </pre> * <br>The user specified in the configuration should have read privileges to the following database table objects. ! * <table> * <tr><td>JOB_CONFIG</td></tr> * <tr><td>JOB_LOGGING_CONFIG</td></tr> --- 49,53 ---- * </pre> * <br>The user specified in the configuration should have read privileges to the following database table objects. ! * <table border="1"> * <tr><td>JOB_CONFIG</td></tr> * <tr><td>JOB_LOGGING_CONFIG</td></tr> Index: DBBasicJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBBasicJobControllerConfig.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DBBasicJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.10 --- DBBasicJobControllerConfig.java 15 Sep 2006 06:21:12 -0000 1.11 *************** *** 27,31 **** * <br><br> * <pre> ! * <table> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> --- 27,31 ---- * <br><br> * <pre> ! * <table border="1"> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> Index: DBPoolJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBPoolJobControllerConfig.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DBPoolJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.10 --- DBPoolJobControllerConfig.java 15 Sep 2006 06:21:12 -0000 1.11 *************** *** 27,31 **** * <br><br> * <pre> ! * <table> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> --- 27,31 ---- * <br><br> * <pre> ! * <table border="1"> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> Index: DBJobConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfig.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DBJobConfig.java 14 Sep 2006 23:04:23 -0000 1.6 --- DBJobConfig.java 15 Sep 2006 06:21:12 -0000 1.7 *************** *** 26,30 **** * <br><br> * <pre> ! * <table> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> --- 26,30 ---- * <br><br> * <pre> ! * <table border="1"> * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework Modified Files: JobContext.java Log Message: no message Index: JobContext.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobContext.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobContext.java 14 Sep 2006 23:06:22 -0000 1.7 --- JobContext.java 15 Sep 2006 06:21:12 -0000 1.8 *************** *** 20,25 **** /** * <p> ! * JobContext provides the references to the framework resources the job is being ! * executed. All the jobs will receives the JobContext reference either in their * initialize methods or process methods based on the controllers they choose to * implement the job. It exposes the resources like reference to repository (by --- 20,25 ---- /** * <p> ! * JobContext provides the references to the framework resources. ! * All the jobs will receives the JobContext reference either in their * initialize methods or process methods based on the controllers they choose to * implement the job. It exposes the resources like reference to repository (by |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/repository/db4o Modified Files: Db4oRepository.java Log Message: no message Index: Db4oRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oRepository.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Db4oRepository.java 13 Sep 2006 23:29:45 -0000 1.11 --- Db4oRepository.java 15 Sep 2006 06:21:12 -0000 1.12 *************** *** 6,14 **** import com.db4o.query.Predicate; import java.io.File; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; - import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.Repository; import org.jmonks.batchserver.framework.JobStatistics; --- 6,14 ---- import com.db4o.query.Predicate; import java.io.File; + import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.Repository; import org.jmonks.batchserver.framework.JobStatistics; *************** *** 40,65 **** private static Logger logger=Logger.getLogger(Db4oRepository.class); /** ! * Property identifies the repository location. ! */ ! public static final String PROPERTY_REPOSIOTRY_LOCATION = "repository-location"; ! /** ! * Name of the db40 datbase file used as the repository. */ ! public static final String REPOSITORY_FILENAME = "batchserver_repository.db"; /** * Map holds the configuration properties of repository. */ protected Map repositoryConfigProperties=null; - /** - * Db4o container object. - */ - protected ObjectContainer container=null; /** *<p> * <i> ! * Do not use this constructor to instantiate Db4oRepository directly. Use ! * the factory method getRepository in Repository class to get the repository ! * instance. This constructor has been provided to make sure this should be * instantiable and accessible to the Repository class. * </i> --- 40,57 ---- private static Logger logger=Logger.getLogger(Db4oRepository.class); /** ! * Property identifies the db4o file name which <code>db4o-filename</code>. */ ! public static final String PROPERTY_DB4O_FILENAME = "db4o-filename"; /** * Map holds the configuration properties of repository. */ protected Map repositoryConfigProperties=null; /** *<p> * <i> ! * Do not use this constructor to instantiate Db4oRepository directly. ! * Access the repository only through the JobContext reference. ! * This constructor has been provided to make sure this should be * instantiable and accessible to the Repository class. * </i> *************** *** 80,105 **** * @throws ConfigurationException If repository-location property is not defined and * the value specified is invalid. */ protected void init(Map configProps) { logger.trace("Entering init"); this.repositoryConfigProperties=new HashMap(configProps); ! String repositoryLocation=(String)this.repositoryConfigProperties.get(Db4oRepository.PROPERTY_REPOSIOTRY_LOCATION); ! if(repositoryLocation==null || "".equals(repositoryLocation)) throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, ! "repository-location is required for DefaultReposiotry implementation."); else { ! File repositoryDirectory=new File(repositoryLocation); ! if(!repositoryDirectory.exists()) { ! boolean created=repositoryDirectory.mkdirs(); ! if(!created) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Attempt to create directory " + repositoryLocation + " is failed."); } ! else if(repositoryDirectory.isFile()) { ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Location " ! + repositoryLocation + " defined is a file. Directory name is expected."); } --- 72,112 ---- * @throws ConfigurationException If repository-location property is not defined and * the value specified is invalid. + * @throws IllegalArgumentException If given configProps is null. */ protected void init(Map configProps) { logger.trace("Entering init"); + + if(configProps==null) + throw new IllegalArgumentException("Map to call the init cannot be null."); + this.repositoryConfigProperties=new HashMap(configProps); ! String db4oFileName=(String)this.repositoryConfigProperties.get(Db4oRepository.PROPERTY_DB4O_FILENAME); ! if(db4oFileName==null || "".equals(db4oFileName)) throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, ! "db4o-filename is required for Db4oReposiotry implementation."); else { ! File repositoryFile=new File(db4oFileName); ! if(!repositoryFile.exists()) { ! try ! { ! boolean created=repositoryFile.createNewFile(); ! if(!created) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Attempt to create Db4o filename " + db4oFileName + " is failed."); ! } ! catch(IOException exception) ! { ! exception.printStackTrace(); ! logger.fatal("Exception while trying to create not nonexistent file = " + db4oFileName, exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, ! "Exception while trying to create non existing Db4o filename " + db4oFileName + ". Message = " + exception.getMessage()); ! } } ! else if(repositoryFile.isDirectory()) { ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Db4o file name " ! + db4oFileName + " defined is a directory. File name is expected."); } *************** *** 107,114 **** * Just to make sure, would be able to setup the repository. */ ! String completeRepositoryFileName=repositoryDirectory.getAbsolutePath()+File.separator+Db4oRepository.REPOSITORY_FILENAME; ! this.container=Db4o.openFile(completeRepositoryFileName); ! if(this.container==null) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Unable to create the file " + completeRepositoryFileName + " to setup repository."); } logger.trace("Exiting init"); --- 114,121 ---- * Just to make sure, would be able to setup the repository. */ ! ObjectContainer container=this.createContainer(this.repositoryConfigProperties); ! if(container==null) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "Unable to create the file " + repositoryFile.getAbsoluteFile() + " to setup repository."); ! container.close(); } logger.trace("Exiting init"); *************** *** 116,119 **** --- 123,140 ---- /** + * Creates the container by looking at the configuration from given Map. + * + * @configProps Configuration properties defined in repository configuration. + * + * @return Returns the Db4o object container reference. + */ + protected ObjectContainer createContainer(Map configProps) + { + String db4oFileName=(String)configProps.get(Db4oRepository.PROPERTY_DB4O_FILENAME); + ObjectContainer container=Db4o.openFile(db4oFileName); + return container; + } + + /** * @see org.jmonks.batchserver.framework.repository Repository#sendDataToNextJob(String,String,Object) */ *************** *** 131,135 **** boolean dataSaved=false; ! if(this.container==null) dataSaved=false; else --- 152,157 ---- boolean dataSaved=false; ! ObjectContainer container=this.createContainer(this.repositoryConfigProperties); ! if(container==null) dataSaved=false; else *************** *** 163,166 **** --- 185,189 ---- container.set(dataTransfer); container.commit(); + container.close(); logger.trace("data has been added with the identifier " + dataIdentifier + " from job name " + this.jobName); dataSaved=true; *************** *** 187,190 **** --- 210,214 ---- Object data=null; + ObjectContainer container=this.createContainer(this.repositoryConfigProperties); if(container==null) data=null; *************** *** 198,204 **** finalPreviousJobName.equals(jobDataTransfer.getSourceJobName()) && finalTargetJobName.equals(jobDataTransfer.getTargetJobName())) - { return true; - } else return false; --- 222,226 ---- *************** *** 213,216 **** --- 235,240 ---- else data=null; + + container.close(); } logger.trace("Exiting getDataFromPreviousJob"); *************** *** 227,230 **** --- 251,255 ---- final String finalJobName=this.jobName; boolean dataCleared=false; + ObjectContainer container=this.createContainer(this.repositoryConfigProperties); if(container==null) dataCleared=false; *************** *** 248,251 **** --- 273,277 ---- logger.debug(jobName + " data has been cleared from the repository."); container.commit(); + container.close(); dataCleared=true; } *************** *** 266,270 **** boolean registered=true; ! if(container==null) registered=false; --- 292,296 ---- boolean registered=true; ! ObjectContainer container=this.createContainer(this.repositoryConfigProperties); if(container==null) registered=false; *************** *** 280,283 **** --- 306,310 ---- container.set(new Db4oJobMgmtMntrInfoHolder(this.jobName, registrationInfo)); container.commit(); + container.close(); logger.trace(this.jobName + " mgmt and mntr information has been added to the repository"); registered=true; *************** *** 295,299 **** boolean unregistered=false; ! if(container==null) unregistered=false; --- 322,326 ---- boolean unregistered=false; ! ObjectContainer container=this.createContainer(this.repositoryConfigProperties); if(container==null) unregistered=false; *************** *** 310,313 **** --- 337,342 ---- else unregistered=false; + + container.close(); } logger.trace("Exiting unregisterJobMgmtMntrInfo"); *************** *** 329,332 **** --- 358,362 ---- boolean logged=false; + ObjectContainer container=this.createContainer(this.repositoryConfigProperties); if(container==null) logged=false; *************** *** 337,340 **** --- 367,372 ---- logger.debug(statistics.getJobname() + " has been logged."); logged=true; + + container.close(); } logger.trace("Exiting logStatistics"); |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/jdbc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/repository/jdbc Modified Files: JdbcRepository.java Log Message: no message Index: JdbcRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/jdbc/JdbcRepository.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JdbcRepository.java 13 Sep 2006 23:29:45 -0000 1.5 --- JdbcRepository.java 15 Sep 2006 06:21:12 -0000 1.6 *************** *** 51,55 **** * The database user specified in the configuration should have update, insert & delete * privileges on the following objects in the database. ! * <table> * <tr><td>JOB_DATA_TRANSFER</td></tr> * <tr><td>JOB_STATISTICS</td></tr> --- 51,55 ---- * The database user specified in the configuration should have update, insert & delete * privileges on the following objects in the database. ! * <table border="1"> * <tr><td>JOB_DATA_TRANSFER</td></tr> * <tr><td>JOB_STATISTICS</td></tr> |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/controller/basic Modified Files: BasicJobController.java BasicJobProcessor.java Log Message: no message Index: BasicJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobProcessor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** BasicJobProcessor.java 14 Sep 2006 23:04:23 -0000 1.13 --- BasicJobProcessor.java 15 Sep 2006 06:21:12 -0000 1.14 *************** *** 7,11 **** /** * <p> ! * BasicJobProcessor lets developers implement their business logic. * </p> * --- 7,12 ---- /** * <p> ! * BasicJobProcessor lets job developers to implement their business logic ! * in the process method and this method will be executed by the BasicJobController. * </p> * *************** *** 128,131 **** --- 129,143 ---- * Does the processing and return the appropriate error code. Properties * configured for this job processor can be retrieved from the JobContext. + * <br> + * <pre> + * public class MyBasicJobProcessor extends BasicJobProcessor + * { + * public ErrorCode process(JobContext jobContext) + * { + * //Perform the business logic. + * return ErrorCode.JOB_COMPLETED_SUCCESSFULLY; + * } + * } + * </pre> * </p> * Index: BasicJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobController.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BasicJobController.java 14 Sep 2006 23:04:59 -0000 1.16 --- BasicJobController.java 15 Sep 2006 06:21:12 -0000 1.17 *************** *** 19,25 **** /** * <p> ! * Basic Job Controller creates the configured number of basic job processor ! * instances and have them run in a seperate thread. Once all the processors have ! * finished their processing, returns the appropriate return code. * </p> * --- 19,62 ---- /** * <p> ! * BasicJobController creates and executes the Basic Job Processor ! * class defined in job configuration. It creates the configured number ! * of instances and have each instance run in a seperate thread. ! * Once all the processors have finished their processing, returns the ! * appropriate return code. ! * </p> ! * ! * <p> ! * This controller is useful to write and execute a simple business logic ! * stands on its own. Allows the flexibility to run that code in a number ! * of instances. Following is an example configuration to configure the ! * batch job written based on BasicJobController. ! * <br><br> ! * <i>XML Configuration is as follows</i> <br><br> ! * <pre> ! * <job-config job-name="process_file_abc"> ! * <job-controller controller-class-name="org.jmonks.batchserver.framework.controller.basic.BasicJobController"> ! * <basic-job-processor basic-job-processor-class-name="com.mycompany.batch.processfileabc.AbcJobProcessor" thread-count="5"> ! * <property key="basic-job-processor-config1">basic-job-processor-value1</property> ! * </basic-job-processor> ! * <property key="basic-controller-config1">basic-controller-value1</property> ! * </job-controller> ! * <job-logging-config> ! * <logging-property-file>com.mycompany.batch.processfileabc.Logging</logging-property-file> ! * </job-logging-config> ! * </job-config> ! * </pre> ! * <br><br> ! * <i>DB Configuration is as follows</i> ! * <table border="1"> ! * <tr><td><b>TableName.ColumnName</b></td><td><b>Value</b></td></tr> ! * <tr><td>job_config.job_name</td><td>process_file_abc</td></tr> ! * <tr><td>job_config.job_status</td><td>1</td></tr> ! * <tr><td>job_config.job_controller_class_name</td><td>org.jmonks.batchserver.framework.controller.basic.BasicJobController</td></tr> ! * <tr><td>job_config.job_controller_props</td><td>basic-controller-config1=basic-controller-value1:basic-controller-config1=basic-controller-value2</td></tr> ! * <tr><td>basic_job_controller_config.job_name</td><td>process_file_abc</td></tr> ! * <tr><td>basic_job_controller_config.basic_job_processor_class_name</td><td>com.mycompany.batch.processfileabc.AbcJobProcessor</td></tr> ! * <tr><td>basic_job_controller_config.basic_job_processor_props</td><td>basic-job-processor-config1=basic-job-processor-value1</td></tr> ! * <tr><td>basic_job_controller_config.basic_job_processor_thread_cnt</td><td>1</td></tr> ! * </table> * </p> * *************** *** 354,357 **** --- 391,395 ---- this.jobStatistics.setEndTime(Calendar.getInstance().getTime()); + this.jobStatistics.setMaxMemeoryUsage(Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory()); this.jobStatistics.setRecordsProcessed(this.getProcessedRecordsCount()); |
From: Suresh <sur...@us...> - 2006-09-15 06:21:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16940/framework/management Modified Files: JobManagementAgent.java Log Message: no message Index: JobManagementAgent.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagementAgent.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JobManagementAgent.java 14 Sep 2006 23:05:12 -0000 1.6 --- JobManagementAgent.java 15 Sep 2006 06:21:12 -0000 1.7 *************** *** 251,254 **** --- 251,256 ---- try { + JobNotification notification=new JobNotification(this.jobName, JobNotification.JOB_FINISHED, this, exitCode.toString()); + this.jmxConnectorServer.sendNotification(notification); this.jmxConnectorServer.stop(); this.jobConnectorHelper.unregisterConnectorServer(jobContext); |
From: Suresh <sur...@us...> - 2006-09-14 23:06:25
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11137 Modified Files: JobContext.java Log Message: no message Index: JobContext.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobContext.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JobContext.java 13 Sep 2006 23:29:25 -0000 1.6 --- JobContext.java 14 Sep 2006 23:06:22 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- import java.util.Collections; import java.util.Map; + import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.FrameworkConfig; import org.jmonks.batchserver.framework.config.JobConfig; *************** *** 18,38 **** /** * ! * @author Suresh Pragada */ public class JobContext { ! public static final String CONTEXT_PARAM_JOB_CONFIG="job.config"; ! public static final String CONTEXT_PARAM_JOB_COMMAND_LINE_CONFIG="job.command.line.config"; ! public static final String CONTEXT_PARAM_REPOSITORY="repository"; ! protected JobConfig jobConfig=null; protected Repository repository=null; ! protected Map commandLineConfig=null; public JobContext(Map contextParams, Main contextCreator) { if(!(contextCreator instanceof Main)) throw new SecurityException("Not authorized to create the job context."); --- 19,98 ---- /** + * <p> + * JobContext provides the references to the framework resources the job is being + * executed. All the jobs will receives the JobContext reference either in their + * initialize methods or process methods based on the controllers they choose to + * implement the job. It exposes the resources like reference to repository (by + * using which you can transfer the data between the jobs, saves the management & + * monitoring information and job running statistics), running job configuration + * (by using which you can refer the properties defined in the controller/processor + * configuration), configuration provided to invoke the job (could be either command + * line configuration or configuration provided to process method) and finally + * framework configuration. All the configuration maps accessed through this job + * context are unmodifiable. Framework creates the JobContext instance and passes + * it to the controllers. + * </p> * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public class JobContext { ! /** ! * Constant defines the parameter name to be used in the context parameters ! * map to pass the job configuration to create the job context. ! */ ! public static final String CONTEXT_PARAM_JOB_CONFIG="batch.framework.job.context.job.config"; ! ! /** ! * Constant defines the parameter name to be used in the context parameters ! * map to pass the job invoke configuration to create the job context. ! */ ! public static final String CONTEXT_PARAM_JOB_INVOKE_CONFIG="batch.framework.job.context.job.invoke.config"; ! /** ! * Constant defines the parameter name to be used in the context parameters ! * map to pass the repository instance to create the job context. ! */ ! public static final String CONTEXT_PARAM_REPOSITORY="batch.framework.job.context.repository"; + /** + * Holds the job configuration object reference. + */ + protected JobConfig jobConfig=null; + + /** + * Holds the framework repository reference. + */ protected Repository repository=null; ! /** ! * Holds the job invoke configuration reference. ! */ ! protected Map jobInvokeConfig=null; + private static Logger logger=Logger.getLogger(JobContext.class); + + /** + * <p> + * Creates and Initializes the JobContext object by looking up the information + * in the given context parameters map. It looks for all the required parameters + * and then initializes the complete job context. It accepts the Main class + * instance context creator reference to make sure this will not be created + * by other than Main class. + * </p> + * + * @param contextParams Map contains all the required information to initialize the job context. + * @param contextCreator Main class instance to make sure nobody can instantiate the job context. + * + * @throws SecurityException If context creator is other than Main class. + * @throws IllegalArgumentException If any of the required parameters are missing in the context params. + * + */ public JobContext(Map contextParams, Main contextCreator) { + logger.trace("Entering JobContext init. params= " + contextParams + " creator = " + contextCreator); + if(!(contextCreator instanceof Main)) throw new SecurityException("Not authorized to create the job context."); *************** *** 42,57 **** /** ! * Retrieve and add the command line config map to the context. */ ! if(contextParams.containsKey(JobContext.CONTEXT_PARAM_JOB_COMMAND_LINE_CONFIG)) { ! Object objectCommandLineConfig=contextParams.get(JobContext.CONTEXT_PARAM_JOB_COMMAND_LINE_CONFIG); ! if(objectCommandLineConfig instanceof Map) ! this.commandLineConfig=(Map)objectCommandLineConfig; else ! throw new IllegalArgumentException("Provided job command line configuration object to initalize job context is not valid."); } else ! throw new IllegalArgumentException("Missing the required job command line configuration map object in context params."); /** --- 102,118 ---- /** ! * Retrieve and add the invoke configuration map to the context. */ ! if(contextParams.containsKey(JobContext.CONTEXT_PARAM_JOB_INVOKE_CONFIG)) { ! Object objectInvokeConfig=contextParams.get(JobContext.CONTEXT_PARAM_JOB_INVOKE_CONFIG); ! if(objectInvokeConfig instanceof Map) ! this.jobInvokeConfig=(Map)objectInvokeConfig; else ! throw new IllegalArgumentException("Provided job invoke configuration object to initalize job context is not valid."); } else ! throw new IllegalArgumentException("Missing the required job invoke configuration map object in context params."); ! logger.debug("Added the invoke configuration to JobContext"); /** *************** *** 68,71 **** --- 129,133 ---- else throw new IllegalArgumentException("Missing the required job configuration object in context params."); + logger.debug("Added the job config reference to JobContext"); /** *************** *** 82,87 **** --- 144,157 ---- else throw new IllegalArgumentException("Missing the required repository object in context params."); + logger.debug("Added the repository reference to JobContext"); + + logger.trace("Exiting JobContext init"); } + /** + * Gets the name of the job this context is associated with. + * + * @return Returns the name of the job. + */ public String getJobName() { *************** *** 89,92 **** --- 159,167 ---- } + /** + * Gets the repository reference configured for this framework. + * + * @return Gets the repository reference. + */ public Repository getRepository() { *************** *** 94,97 **** --- 169,177 ---- } + /** + * Gets the job configuration object belongs to the running job. + * + * @return Returns the running job's configuration object. + */ public JobConfig getJobConfig() { *************** *** 99,107 **** } ! public Map getJobCommandLineConfig() { ! return Collections.unmodifiableMap(this.commandLineConfig); } public FrameworkConfig getFrameworkConfig() { --- 179,199 ---- } ! /** ! * Gets the configuration passed in the invocation to the framework. This ! * could be command line parameters, if job is invoked from command line or ! * config map if job is invoked through Main.process method. ! * ! * @return Returns the configuration provided at the invocation time. ! */ ! public Map getJobInvokeConfig() { ! return Collections.unmodifiableMap(this.jobInvokeConfig); } + /** + * Gets the reference to the framework configuration. + * + * @return Gets the framework configuration reference. + */ public FrameworkConfig getFrameworkConfig() { |
From: Suresh <sur...@us...> - 2006-09-14 23:05:19
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680 Modified Files: LoggingManager.java Main.java Log Message: no message Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Main.java 13 Sep 2006 23:29:25 -0000 1.19 --- Main.java 14 Sep 2006 23:05:13 -0000 1.20 *************** *** 12,22 **** - - - /** * <p> ! * Main class is the entry point to the batch framework. This provides ! * the methods to accept the information to identify the job and kick off the job. * The framework can be executed either through command line as an independent * program or from any other java program. The information on how to kickoff using --- 12,19 ---- /** * <p> ! * Main is the entry point to the batch framework. This provides ! * the methods to accept the information to identify the job and kicks off the job. * The framework can be executed either through command line as an independent * program or from any other java program. The information on how to kickoff using *************** *** 34,54 **** /** ! * Key name have the value of the job name in configuration map. */ public static final String JOB_NAME_KEY_NAME = "job-name"; /** ! * Restrict the temptation of creating the instance of Main. */ private Main() { } /** * <p> * This method provides the interface to execute the job from another java ! * program. This accepts the job-name and additional configuration information ! * relate to this job as a key value pairs in the map. Among the entries ! * in the map, there should be <i>job-name</i> key available with the values ! * as a name of the job to be executed. * <br><br> * <pre> --- 31,54 ---- /** ! * Name of the parameter key holds the job name in configuration map which ! * is <code>job-name</code>. */ public static final String JOB_NAME_KEY_NAME = "job-name"; /** ! * Restrict the temptation of creating the instance of Main to create ! * any resources in the framework. */ private Main() { } + /** * <p> * This method provides the interface to execute the job from another java ! * program. This accepts the job name and additional configuration information ! * relate to this job as a key value pairs in the map. Among these entries ! * in the map, there should be a <i>job-name</i> parameter key available to ! * identify the job to be executed. * <br><br> * <pre> *************** *** 58,67 **** * configMap.put("config-name2","config-value2"); * ! * ErrorCode statusCode=Main.process(configMap); ! * System.out.println("Job exited with return code : " + errorCode.toString()); * </pre> * <br><br> ! * Whatever the configuration key values passed here will override the values ! * defined in job configuration. * </p> * <br> --- 58,68 ---- * configMap.put("config-name2","config-value2"); * ! * ErrorCode exitCode=Main.process(configMap); ! * System.out.println("Job exited with return code : " + exitCode.getCode()); * </pre> * <br><br> ! * Whatever the configuration passed here can be retrived from the JobContext ! * instance passed to all the jobs either through initialize methods or process ! * methods. * </p> * <br> *************** *** 69,73 **** * @param configMap Map object consist of all the properties needed to kick off this batch job. * ! * @return Returns zero for success and non-zero for failure. * * @throws IllegalArgumentException If input configMap is null. --- 70,74 ---- * @param configMap Map object consist of all the properties needed to kick off this batch job. * ! * @return Returns ErrorCode provides the status of the batch job. * * @throws IllegalArgumentException If input configMap is null. *************** *** 91,95 **** FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); logger.debug("Initializing the framework logging"); ! LoggingManager.initializeFrameworkLogging(frameworkConfig.getFrameworkLoggingConfig()); /** * Get the job name from given configMap and start execution. --- 92,97 ---- FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); logger.debug("Initializing the framework logging"); ! LoggingManager.initializeFrameworkLogging( ! frameworkConfig.getFrameworkLoggingConfig(), frameworkCreator); /** * Get the job name from given configMap and start execution. *************** *** 104,108 **** */ logger.debug("Retrieving the configuration factory"); ! JobConfigFactory jobConfigFactory=JobConfigFactory.getJobConfigFactory(frameworkConfig.getJobConfigFactoryConfig()); logger.debug("Retrieving the job configuration"); JobConfig jobConfig=jobConfigFactory.getJobConfig(jobName); --- 106,111 ---- */ logger.debug("Retrieving the configuration factory"); ! JobConfigFactory jobConfigFactory=JobConfigFactory. ! getJobConfigFactory(frameworkConfig.getJobConfigFactoryConfig()); logger.debug("Retrieving the job configuration"); JobConfig jobConfig=jobConfigFactory.getJobConfig(jobName); *************** *** 114,118 **** */ logger.debug("Initializing the job logging"); ! LoggingManager.initializeJobLogging(jobName,frameworkConfig.getFrameworkLoggingConfig(), jobConfig.getJobLoggingConfig()); logger.debug("Create the job context"); jobContext=createJobContext(jobConfig, configMap, frameworkCreator); --- 117,122 ---- */ logger.debug("Initializing the job logging"); ! LoggingManager.initializeJobLogging(jobName,frameworkConfig. ! getFrameworkLoggingConfig(), jobConfig.getJobLoggingConfig(), frameworkCreator); logger.debug("Create the job context"); jobContext=createJobContext(jobConfig, configMap, frameworkCreator); *************** *** 173,181 **** * <p> * This method provides the interface to execute the jobs from command line. ! * This accepts the job name and additional configuration information relate * to this job as a command line parameters. Each parameter passed through * command line should be in the format <i>name=value</i>. Among these, ! * <i>job-name=process_file_abc</i> property should exist. ! * The ErrorCode's code value will be return as exit code. * </p> * <p> --- 177,185 ---- * <p> * This method provides the interface to execute the jobs from command line. ! * This accepts the job name and additional configuration information related * to this job as a command line parameters. Each parameter passed through * command line should be in the format <i>name=value</i>. Among these, ! * <i>job-name=process_file_abc</i> property should exist to identify the job ! * to kick off. The ErrorCode's code value will be returned as exit code. * </p> * <p> *************** *** 183,187 **** * java org.jmonks.batchserver.framework.Main job-name=process_file_abc config-name1=config-value1 config-name2=config-value2 * <br><br> ! * Whatever the configuration paremters passed here will override the values defined in job configuration. * </p> * --- 187,193 ---- * java org.jmonks.batchserver.framework.Main job-name=process_file_abc config-name1=config-value1 config-name2=config-value2 * <br><br> ! * Whatever the configuration paremters passed here can be retrieved using ! * the JobContext reference passed to all the jobs either using their initialize ! * methods or process methods. * </p> * *************** *** 191,194 **** --- 197,201 ---- { ErrorCode exitCode=ErrorCode.JOB_COMPLETED_SUCCESSFULLY; + Main frameworkCreator=new Main(); try { *************** *** 199,203 **** FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); logger.debug("Initializing the framework logging"); ! LoggingManager.initializeFrameworkLogging(frameworkConfig.getFrameworkLoggingConfig()); /** --- 206,211 ---- FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); logger.debug("Initializing the framework logging"); ! LoggingManager.initializeFrameworkLogging(frameworkConfig. ! getFrameworkLoggingConfig(), frameworkCreator); /** *************** *** 239,250 **** System.exit(exitCode.getCode()); } ! ! private static JobContext createJobContext(JobConfig jobConfig, Map commandLineConfig, Main frameworkCreator) { Map contextParams=new HashMap(); contextParams.put(JobContext.CONTEXT_PARAM_JOB_CONFIG, jobConfig); ! contextParams.put(JobContext.CONTEXT_PARAM_JOB_COMMAND_LINE_CONFIG, commandLineConfig); ! Repository repository=Repository.createRepository(jobConfig.getJobName(), FrameworkConfig.getInstance().getRepositoryConfig(), frameworkCreator); contextParams.put(JobContext.CONTEXT_PARAM_REPOSITORY, repository); JobContext jobContext=new JobContext(contextParams, frameworkCreator); return jobContext; --- 247,276 ---- System.exit(exitCode.getCode()); } ! ! /** ! * Creates the map to be passed to create the JobContext and passes it to the ! * JobContext and returns the created JobContext object. ! * ! * @param jobConfig Job configuration object. ! * @param invokeConfig Configuration provided at invocation time. ! * @param frameworkCreator Authorized class to the create the job context. ! * ! * @return Returns the JobContext reference. ! */ ! private static JobContext createJobContext(JobConfig jobConfig, Map invokeConfig, Main frameworkCreator) { + /** + * Create the context params map to create the JobContext instance. + */ Map contextParams=new HashMap(); contextParams.put(JobContext.CONTEXT_PARAM_JOB_CONFIG, jobConfig); ! contextParams.put(JobContext.CONTEXT_PARAM_JOB_INVOKE_CONFIG, invokeConfig); ! Repository repository=Repository.createRepository(jobConfig.getJobName(), ! FrameworkConfig.getInstance().getRepositoryConfig(), frameworkCreator); contextParams.put(JobContext.CONTEXT_PARAM_REPOSITORY, repository); + + /** + * Create the JobContext and return it. + */ JobContext jobContext=new JobContext(contextParams, frameworkCreator); return jobContext; Index: LoggingManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/LoggingManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LoggingManager.java 6 Sep 2006 22:08:23 -0000 1.7 --- LoggingManager.java 14 Sep 2006 23:05:13 -0000 1.8 *************** *** 9,13 **** import org.apache.log4j.PatternLayout; import org.apache.log4j.RollingFileAppender; ! import org.jmonks.batchserver.framework.config.*; /** --- 9,16 ---- import org.apache.log4j.PatternLayout; import org.apache.log4j.RollingFileAppender; ! import org.jmonks.batchserver.framework.config.ConfigurationException; ! import org.jmonks.batchserver.framework.config.FrameworkConfig.FrameworkLoggingConfig; ! import org.jmonks.batchserver.framework.config.JobLoggingConfig; ! /** *************** *** 17,34 **** * which works for all the jobs and provide the facility to * use their own logging mechanism. ! * * The default logging mechanism defined at the framework will * work like this. It reads the directory to create the log files from ! * the framework logging configuration <logging-config> and creates a directory * with the "job-name" and create the log files for each run. So, the format * will be * <br><br> ! * <directory-defined-in-config>/job-name/jobname_with_timestamp.log * <br><br> ! * * If job developer would like to override this logging mechanism, they can ! * define their logging configuration in the element <job-logging-config> in batch ! * configuration file or defining entries in job_logging_config table. * </p> * @author Suresh Pragada * @version 1.0 --- 20,40 ---- * which works for all the jobs and provide the facility to * use their own logging mechanism. ! * </p> ! * <p> * The default logging mechanism defined at the framework will * work like this. It reads the directory to create the log files from ! * the framework logging configuration <logging-config> and creates a directory * with the "job-name" and create the log files for each run. So, the format * will be * <br><br> ! * <directory-defined-in-config>/job-name/jobname_with_timestamp.log * <br><br> ! * </p> ! * <p> * If job developer would like to override this logging mechanism, they can ! * define their logging configuration in the element <job-logging-config> in ! * batch job configuration file or defining entries in job_logging_config table. * </p> + * * @author Suresh Pragada * @version 1.0 *************** *** 38,42 **** { /** ! * Framework configuration file. */ public static final String FRAMEWORK_LOGGING_FILE = "batch_framework.log"; --- 44,48 ---- { /** ! * Framework configuration file which is batch_framework.log. */ public static final String FRAMEWORK_LOGGING_FILE = "batch_framework.log"; *************** *** 46,53 **** public static final String DEFAULT_MESSAGE_PATTERN = "%5p [%d{ISO8601}] [%t - %C] %m%n"; /** ! * Tells whether framework logging has been intialized or not. */ private static boolean isFrameworkLoggingInitialized=false; - /** * Private constructor to make sure LoggingManager will not be instantiated. --- 52,58 ---- public static final String DEFAULT_MESSAGE_PATTERN = "%5p [%d{ISO8601}] [%t - %C] %m%n"; /** ! * Tells whether framework logging has been already initailized or not. */ private static boolean isFrameworkLoggingInitialized=false; /** * Private constructor to make sure LoggingManager will not be instantiated. *************** *** 63,67 **** * This does the follwing steps. * <ul> ! * <li>Create the directory <directory name configured in logging config>/jobName * <li>Generates the logging file name jobName_yyyymmdd_hhmmss_ms.log * <li>Creates the Rolling File appender with the above created directory and logging file name. --- 68,72 ---- * This does the follwing steps. * <ul> ! * <li>Create the directory <directory name configured in logging config>/jobName * <li>Generates the logging file name jobName_yyyymmdd_hhmmss_ms.log * <li>Creates the Rolling File appender with the above created directory and logging file name. *************** *** 74,90 **** * @param frameworkLoggingConfig Logging configuration defined at the framework. * @param jobLoggingFramework Logging configuration defined at the job level. * ! * @throws IllegalArgumentException If input values jobName and frameworkLoggingConfig are null. * @throws ConfigurationException If logging file cannot be created at the configured directory. * </p> */ ! public static void initializeJobLogging(String jobName, FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig,JobLoggingConfig jobLoggingConfig) { ! if(jobName==null) ! throw new IllegalArgumentException("job name cannot be null to establish the job logging service."); - if(frameworkLoggingConfig==null) - throw new IllegalArgumentException("framework logging config object cannot be null to establish the job logging service."); - File loggingDirecotry=new File(frameworkLoggingConfig.getJobLoggingDirecotry()+File.separator+jobName); LoggingManager.createDirectory(loggingDirecotry); --- 79,93 ---- * @param frameworkLoggingConfig Logging configuration defined at the framework. * @param jobLoggingFramework Logging configuration defined at the job level. + * @param loggingInitalizer Main class instance which is authorized to initailze the job logging. * ! * @throws SecurityException If any class other than Main(framework) tried to initialize the job logging. * @throws ConfigurationException If logging file cannot be created at the configured directory. * </p> */ ! public static void initializeJobLogging(String jobName, FrameworkLoggingConfig frameworkLoggingConfig,JobLoggingConfig jobLoggingConfig, Main loggingInitalizer) { ! if(!(loggingInitalizer instanceof Main)) ! throw new SecurityException("Not authorized to initialize the job logging."); File loggingDirecotry=new File(frameworkLoggingConfig.getJobLoggingDirecotry()+File.separator+jobName); LoggingManager.createDirectory(loggingDirecotry); *************** *** 129,137 **** * * @param frameworkLoggingConfig Framework logging configuration object. * * @throws ConfigurationException If logging directory cannot be created. */ ! public static synchronized void initializeFrameworkLogging(FrameworkConfig.FrameworkLoggingConfig frameworkLoggingConfig) { if(!isFrameworkLoggingInitialized) { --- 132,145 ---- * * @param frameworkLoggingConfig Framework logging configuration object. + * @param loggingInitalizer Main class instance which is authorized to initailze the logging. * + * @throws SecurityException If any class other than Main(framework) tried to initialize the framework logging. * @throws ConfigurationException If logging directory cannot be created. */ ! public static synchronized void initializeFrameworkLogging(FrameworkLoggingConfig frameworkLoggingConfig, Main loggingInitalizer) { + if(!(loggingInitalizer instanceof Main)) + throw new SecurityException("Not authorized to initialize the framework logging."); + if(!isFrameworkLoggingInitialized) { *************** *** 160,168 **** frameworkLogger.setAdditivity(true); frameworkLogger.setLevel(Level.toLevel(frameworkLoggingConfig.getFrameworkLoggingLevel())); ! isFrameworkLoggingInitialized=true; } else ! System.out.println("Framework logging has been already initialized."); } --- 168,180 ---- frameworkLogger.setAdditivity(true); frameworkLogger.setLevel(Level.toLevel(frameworkLoggingConfig.getFrameworkLoggingLevel())); ! isFrameworkLoggingInitialized=true; } else ! { ! /** ! * Framework logging has been already initialized. Ignore this call. ! */ ! } } |
From: Suresh <sur...@us...> - 2006-09-14 23:05:19
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/config/xml Modified Files: XMLBasicJobControllerConfig.java XMLJobConfig.java XMLJobConfigFactory.java XMLJobControllerConfig.java XMLJobLoggingConfig.java XMLPoolJobControllerConfig.java Log Message: no message Index: XMLJobConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLJobConfig.java 17 Mar 2006 14:04:38 -0000 1.9 --- XMLJobConfig.java 14 Sep 2006 23:05:13 -0000 1.10 *************** *** 20,24 **** * <p> * XMLJobConfig provides the implementation of JobConfig by reading the ! * job configuration from XML DOM element <job-config> configured in the * job configuration file. This reads and represents the following piece of XML * block from job configuration file. --- 20,24 ---- * <p> * XMLJobConfig provides the implementation of JobConfig by reading the ! * job configuration from XML DOM element <job-config> configured in the * job configuration file. This reads and represents the following piece of XML * block from job configuration file. *************** *** 46,58 **** { /** ! * Element name that identifies the job configuration. */ public static final String JOB_CONFIG_ELEMENT_NAME = "job-config"; /** ! * Attribute name that identifies the job name. */ public static final String JOB_NAME_ATTRIBUTE_NAME = "job-name"; /** ! * Attribute name that identifies the job status. */ public static final String JOB_STATUS_ATTRIBUTE_NAME = "job-status"; --- 46,58 ---- { /** ! * Element name that identifies the job configuration which is <code>job-config</code>. */ public static final String JOB_CONFIG_ELEMENT_NAME = "job-config"; /** ! * Attribute name that identifies the job name which is <code>job-name</code>. */ public static final String JOB_NAME_ATTRIBUTE_NAME = "job-name"; /** ! * Attribute name that identifies the job status which is <code>job-status</code>. */ public static final String JOB_STATUS_ATTRIBUTE_NAME = "job-status"; Index: XMLJobLoggingConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobLoggingConfig.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XMLJobLoggingConfig.java 14 Mar 2006 23:05:25 -0000 1.2 --- XMLJobLoggingConfig.java 14 Sep 2006 23:05:13 -0000 1.3 *************** *** 26,42 **** { /** ! * Element name represents the job logging config. */ public static final String JOB_LOGGING_CONFIG_ELEMENT_NAME = "job-logging-config"; /** ! * Element name represents the job logger config. */ private static final String JOB_LOGGER_CONFIG_ELEMENT_NAME = "job-logger-config"; /** ! * Atrribute name represents the logger name in job logger config. */ private static final String LOGGER_NAME_ATTRIBUTE_NAME = "logger-name"; /** ! * Atrribute name represents the logger level in job logger config. */ private static final String LOGGER_LEVEL_ATTRIBUTE_NAME = "logger-level"; --- 26,42 ---- { /** ! * Element name represents the job logging config which is <code>job-logging-config</code>. */ public static final String JOB_LOGGING_CONFIG_ELEMENT_NAME = "job-logging-config"; /** ! * Element name represents the job logger config which is <code>job-logger-config</code>. */ private static final String JOB_LOGGER_CONFIG_ELEMENT_NAME = "job-logger-config"; /** ! * Atrribute name represents the logger name in job logger config which is <code>logger-name</code>. */ private static final String LOGGER_NAME_ATTRIBUTE_NAME = "logger-name"; /** ! * Atrribute name represents the logger level in job logger config which is <code>logger-level</code>. */ private static final String LOGGER_LEVEL_ATTRIBUTE_NAME = "logger-level"; Index: XMLPoolJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLPoolJobControllerConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLPoolJobControllerConfig.java 29 Aug 2006 02:01:33 -0000 1.9 --- XMLPoolJobControllerConfig.java 14 Sep 2006 23:05:13 -0000 1.10 *************** *** 45,73 **** { /** ! * XML Element name defines the pool job loader configuration. */ private static final String POOL_JOB_LOADER_ELEMENT_NAME = "pool-job-loader"; /** ! * XML Attribute name defines the pool job loader class name. */ private static final String POOL_JOB_LOADER_CLASS_ATTRIBUTE_NAME = "pool-job-loader-class-name"; /** ! * XML Element name defines the job pool configuration. */ private static final String POOL_JOB_POOL_ELEMENT_NAME = "job-pool"; /** ! * XML Attribute name defines the job pool class name. */ private static final String POOL_JOB_POOL_CLASS_ATTRIBUTE_NAME = "job-pool-class-name"; /** ! * XML Element name defines the pool job processor configuration. */ private static final String POOL_JOB_PROCESSOR_ELEMENT_NAME = "pool-job-processor"; /** ! * XML Attribute name defines the pool job processor class name. */ private static final String POOL_JOB_PROCESSOR_CLASS_ATTRIBUTE_NAME = "pool-job-processor-class-name"; /** ! * XML Attribute name defines the thread count of the job processor. */ private static final String THREAD_COUNT_ATTRIBUTE_NAME = "thread-count"; --- 45,73 ---- { /** ! * XML Element name defines the pool job loader configuration which is <code>pool-job-loader</code>. */ private static final String POOL_JOB_LOADER_ELEMENT_NAME = "pool-job-loader"; /** ! * XML Attribute name defines the pool job loader class name which is <code>pool-job-loader-class-name</code>. */ private static final String POOL_JOB_LOADER_CLASS_ATTRIBUTE_NAME = "pool-job-loader-class-name"; /** ! * XML Element name defines the job pool configuration which is <code>job-pool</code>. */ private static final String POOL_JOB_POOL_ELEMENT_NAME = "job-pool"; /** ! * XML Attribute name defines the job pool class name which is <code>job-pool-class-name</code>. */ private static final String POOL_JOB_POOL_CLASS_ATTRIBUTE_NAME = "job-pool-class-name"; /** ! * XML Element name defines the pool job processor configuration which is <code>pool-job-processor</code>. */ private static final String POOL_JOB_PROCESSOR_ELEMENT_NAME = "pool-job-processor"; /** ! * XML Attribute name defines the pool job processor class name which is <code>pool-job-processor-class-name</code>. */ private static final String POOL_JOB_PROCESSOR_CLASS_ATTRIBUTE_NAME = "pool-job-processor-class-name"; /** ! * XML Attribute name defines the thread count of the job processor which is <code>thread-count</code>. */ private static final String THREAD_COUNT_ATTRIBUTE_NAME = "thread-count"; Index: XMLJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobControllerConfig.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** XMLJobControllerConfig.java 14 Mar 2006 23:05:25 -0000 1.7 --- XMLJobControllerConfig.java 14 Sep 2006 23:05:13 -0000 1.8 *************** *** 21,25 **** /** * XMLJobControllerConfig responsible to build the controller specific ! * JobControllerConfig objects from the given XML. * * @author Suresh Pragada --- 21,26 ---- /** * XMLJobControllerConfig responsible to build the controller specific ! * JobControllerConfig objects from the given XML. Look at {@link #getJobControllerConfig(Element)} ! * to understand on how this is going to get the correct job controller config instance. * * @author Suresh Pragada *************** *** 30,42 **** { /** ! * Element name that identifies the job controller configuration. */ public static final String JOB_CONTROLLER_ELEMENT_NAME = "job-controller"; /** ! * Attribute name that identifies the job controller class name. */ public static final String JOB_CONTROLLER_CLASS_ATTRIBUTE_NAME = "job-controller-class-name"; /** ! * Element name that identifies the job controller configuration class name. */ public static final String JOB_CONTROLLER_CONFIG_FACTORY_CLASS_ATTRIBUTE_NAME = "xml-factory-config-class-name"; --- 31,43 ---- { /** ! * Element name that identifies the job controller configuration which is <code>job-controller</code>. */ public static final String JOB_CONTROLLER_ELEMENT_NAME = "job-controller"; /** ! * Attribute name that identifies the job controller class name which is <code>job-controller-class-name</code>. */ public static final String JOB_CONTROLLER_CLASS_ATTRIBUTE_NAME = "job-controller-class-name"; /** ! * Element name that identifies the job controller configuration class name which is <code>xml-factory-config-class-name</code>. */ public static final String JOB_CONTROLLER_CONFIG_FACTORY_CLASS_ATTRIBUTE_NAME = "xml-factory-config-class-name"; Index: XMLJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobConfigFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** XMLJobConfigFactory.java 14 Sep 2006 05:04:34 -0000 1.12 --- XMLJobConfigFactory.java 14 Sep 2006 23:05:13 -0000 1.13 *************** *** 34,38 **** * XMLJobConfigFactory reads the job configuration from XML file to create the * configuration objects needed by the job. This factory looks for few properties ! * in the config properties map to identify the source of the XML file. The source of * the XML file can be defined as absolute path on the file system or resource on the * class path. --- 34,38 ---- * XMLJobConfigFactory reads the job configuration from XML file to create the * configuration objects needed by the job. This factory looks for few properties ! * in the factory config properties map to identify the source of the XML file. The source of * the XML file can be defined as absolute path on the file system or resource on the * class path. *************** *** 46,50 **** * <tr><td>job-config-file-classpath-location</td><td>batch-config.xml</td></tr> * </table> ! * These properties can be configured using <property> element in the <job-config-factory-config> element * in the framework configuration file. * </p> --- 46,50 ---- * <tr><td>job-config-file-classpath-location</td><td>batch-config.xml</td></tr> * </table> ! * These properties can be configured using <property> attribute in the <job-config-factory-config> element * in the framework configuration file. * </p> *************** *** 57,65 **** { /** ! * Constant defines the property name of config file absolute location. */ private static final String PROPERTY_JOB_CONFIG_FILE_ABSOLUTE_LOCATION = "job-config-file-absolute-location"; /** ! * Constant defines the property name of config file classpath location. */ private static final String PROPERTY_JOB_CONFIG_FILE_CLASSPATH_LOCATION = "job-config-file-classpath-location"; --- 57,65 ---- { /** ! * Constant defines the property name of config file absolute location which is <code>job-config-file-absolute-location</code>. */ private static final String PROPERTY_JOB_CONFIG_FILE_ABSOLUTE_LOCATION = "job-config-file-absolute-location"; /** ! * Constant defines the property name of config file classpath location which is <code>job-config-file-classpath-location</code>. */ private static final String PROPERTY_JOB_CONFIG_FILE_CLASSPATH_LOCATION = "job-config-file-classpath-location"; *************** *** 68,72 **** */ private Map configFactoryProps=null; - /** * batch-config element in the XML configuration file. --- 68,71 ---- *************** *** 168,172 **** /** * Returns the requested job configuration as JobConfig object. The requested job ! * name should be passed as a parameter. If it doesnt find the configuration of * the requested jobName in the job configuration file, it returns null. * --- 167,171 ---- /** * Returns the requested job configuration as JobConfig object. The requested job ! * name should be passed as a parameter. If it does not find the configuration of * the requested jobName in the job configuration file, it returns null. * *************** *** 214,217 **** --- 213,217 ---- * * @param jobConfigStream InputStream of XML job configuration file. + * * @return Returns true, if it could load the element from the given inputstream, false, otherwise. */ Index: XMLBasicJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLBasicJobControllerConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLBasicJobControllerConfig.java 29 Aug 2006 02:01:33 -0000 1.9 --- XMLBasicJobControllerConfig.java 14 Sep 2006 23:05:13 -0000 1.10 *************** *** 40,52 **** { /** ! * XML Element name defiens the basic job processor configuration. */ private static final String BASIC_JOB_PROCESSOR_ELEMENT_NAME = "basic-job-processor"; /** ! * XML Attribute name defines the basic job processor class name. */ private static final String BASIC_JOB_PROCESSOR_CLASS_ATTRIBUTE_NAME = "basic-job-processor-class-name"; /** ! * XML Attribute name defines the thread count of the job processor. */ private static final String THREAD_COUNT_ATTRIBUTE_NAME = "thread-count"; --- 40,52 ---- { /** ! * XML Element name defiens the basic job processor configuration which is <code>basic-job-processor</code>. */ private static final String BASIC_JOB_PROCESSOR_ELEMENT_NAME = "basic-job-processor"; /** ! * XML Attribute name defines the basic job processor class name which is <code>basic-job-processor-class-name</code>. */ private static final String BASIC_JOB_PROCESSOR_CLASS_ATTRIBUTE_NAME = "basic-job-processor-class-name"; /** ! * XML Attribute name defines the thread count of the job processor which is <code>thread-count</code>. */ private static final String THREAD_COUNT_ATTRIBUTE_NAME = "thread-count"; |
From: Suresh <sur...@us...> - 2006-09-14 23:05:18
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/management/jmxmp Modified Files: RepositoryJMXMPConnectorHelper.java Log Message: no message Index: RepositoryJMXMPConnectorHelper.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp/RepositoryJMXMPConnectorHelper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RepositoryJMXMPConnectorHelper.java 13 Sep 2006 23:29:45 -0000 1.5 --- RepositoryJMXMPConnectorHelper.java 14 Sep 2006 23:05:13 -0000 1.6 *************** *** 35,42 **** /** ! * Registers the jmx connector server with the given job name in the repository ! * defined for this framework. * ! * @param jobName Name of the job to be used in the registration. * @param jmxConnectorServer JMX connector server identifies where all the manager and montiro mbeans are configured. * --- 35,42 ---- /** ! * Registers the jmx connector server with the job name taken from job context in the repository ! * defined for this framework. Repository reference will also be taken from job context. * ! * @param jobContext Context of the job is being run. * @param jmxConnectorServer JMX connector server identifies where all the manager and montiro mbeans are configured. * *************** *** 66,73 **** /** ! * Unregisters the jmx connector server registered in repository with the given ! * job name. * ! * @param jobName Name of the job the connector server registered with. * * @return Returns true, if it successfully unregistered, false otherwise. --- 66,73 ---- /** ! * Unregisters the jmx connector server registered in repository with the ! * job name available in job context. * ! * @param jobContext Context of the job is begin run. * * @return Returns true, if it successfully unregistered, false otherwise. |
From: Suresh <sur...@us...> - 2006-09-14 23:05:18
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/management Modified Files: JobManagementAgent.java ProcessorState.java Log Message: no message Index: JobManagementAgent.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagementAgent.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JobManagementAgent.java 13 Sep 2006 23:29:45 -0000 1.5 --- JobManagementAgent.java 14 Sep 2006 23:05:12 -0000 1.6 *************** *** 19,29 **** * <p> * JobManagementAgent defines the methods to start and stop the JMX Agent for this job. ! * Only one agent will be created for a job and this agent will be initialized ! * when you request to get the job management agent instance. Agent service can be ! * started and stopped only once during the life cycle of the job. This uses * the JobConnectorHelper to take the help in creating different JMX ! * connector servers and different lookup locations to ! * register and unregister jmx connector servers. * </p> * @author Suresh Pragada * @version 1.0 --- 19,29 ---- * <p> * JobManagementAgent defines the methods to start and stop the JMX Agent for this job. ! * Only one agent will be created for a job and this can be created only be the framework. ! * Agent service can be started and stopped only once during the life cycle of the job. This uses * the JobConnectorHelper to take the help in creating different JMX ! * connector servers and register and unregister jmx connector servers to be looked up ! * by the JMX connector clients. * </p> + * * @author Suresh Pragada * @version 1.0 *************** *** 109,117 **** * when it is already started, it throws IllegalStateException. * </p> ! * @param jobName Name of the job the controller belongs to. * @param jobController Controller reference to be passed to the mbeans. * * @return Returns true, if manager is started properly, false, otherwise. * * @throws IllegalArgumentException If input parameters job name or job controller is null. * @throws IllegalStateException If manager is already started or already stopped. --- 109,120 ---- * when it is already started, it throws IllegalStateException. * </p> ! * ! * @param jobContext Context of the job is being run. * @param jobController Controller reference to be passed to the mbeans. + * @param agentManager Main class reference as a agent manager. * * @return Returns true, if manager is started properly, false, otherwise. * + * @throws SecurityException if an attempt is maded to start by any one other than Main(framework). * @throws IllegalArgumentException If input parameters job name or job controller is null. * @throws IllegalStateException If manager is already started or already stopped. *************** *** 218,226 **** * exit status will be sent to all the JMX remote clients as a notification. * ! * * @param exitCode errorCode returned by controller to the Main class. * * @return Returns true, if agent could be stopped properly, false otherwise. * * @throws IllegalArgumentException If input parameter status code is null. * @throws IllegalStateException If agent is already stopped or it not yet started. --- 221,231 ---- * exit status will be sent to all the JMX remote clients as a notification. * ! * @param jobContext Context of the job is being run. * @param exitCode errorCode returned by controller to the Main class. + * @param agentManager Main class reference as a agent manager. * * @return Returns true, if agent could be stopped properly, false otherwise. * + * @throws SecurityException if an attempt is maded to stop by any one other than Main(framework). * @throws IllegalArgumentException If input parameter status code is null. * @throws IllegalStateException If agent is already stopped or it not yet started. Index: ProcessorState.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/ProcessorState.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProcessorState.java 14 May 2006 01:34:49 -0000 1.1 --- ProcessorState.java 14 Sep 2006 23:05:12 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- * processing information. * </p> + * * @author Suresh pragada * @version 1.0 *************** *** 28,32 **** /** ! * Constructor to initialize the whole object at a time and make sure it is immutable. */ public ProcessorState(String processorID,String processorDescription,Object processingInfo) --- 29,33 ---- /** ! * Constructor initializes the object. */ public ProcessorState(String processorID,String processorDescription,Object processingInfo) *************** *** 74,78 **** return stringValue.toString(); } ! ! } --- 75,78 ---- return stringValue.toString(); } ! } |
From: Suresh <sur...@us...> - 2006-09-14 23:05:18
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/controller Modified Files: JobController.java Log Message: no message Index: JobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/JobController.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** JobController.java 13 Sep 2006 23:29:45 -0000 1.12 --- JobController.java 14 Sep 2006 23:05:12 -0000 1.13 *************** *** 12,22 **** /** * <p> ! * Job Controller is the important component, which actually creates and starts ! * the proper components to process the job. Controller can defines its own ! * logic (architecture) to process the jobs. This creates and manages the complete ! * architecture it defines to process the job. * </p> * <p> ! * This provides a factory method which returns the appropriate controller component * based on the provided controller config object. This implements the management and * monitoring interfaces to make sure all the controller implementations are manageable --- 12,24 ---- /** * <p> ! * Job Controller is the important component, which actually creates and drives ! * the execution of the job. This defines the logic and the flow, how the user components ! * needs to be written and how they would be driven while executing the job. ! * Framework provides two controllers called as BasicJobController and PoolJobController ! * which defines their own way of executing the job. * </p> + * * <p> ! * JobController provides a factory method which returns the appropriate controller component * based on the provided controller config object. This implements the management and * monitoring interfaces to make sure all the controller implementations are manageable *************** *** 31,35 **** { /** ! * Name of the job this controller belongs to. */ protected JobContext jobContext=null; --- 33,37 ---- { /** ! * JobContext associated to this controller. */ protected JobContext jobContext=null; *************** *** 43,63 **** * <p> * This factory method loads the required implementation of the controller ! * based on the controller configuration received. First it tries to look for the ! * existence of controller with this jobName in repository (If job is stopped ! * in middle through job management agent using restart=true flag, ! * this controller will be stopped and persisted in the repository). ! * By default, if job is stopped in the middle it will be restarted. ! * To override this behaviour special property needs to be sent as ! * "job-controller-restart=false" in the additional configuration. ! * If it is false, it calls the releaseController method on repository to ! * clear its current state and create a new controller using the configuration ! * defined in controllerConfig. * </p> ! * @param jobName Name of the job to be started. ! * @param controllerConfig configuration object represents controller configuration. * ! * @return Returns the correct implementation of the controller. */ ! public static synchronized JobController getJobController(JobContext jobContext) { logger.trace("Entering getJobController = " + jobContext.getJobName()); --- 45,57 ---- * <p> * This factory method loads the required implementation of the controller ! * based on the controller configuration available in job context and sets ! * this context to the controller. * </p> ! * ! * @param jobContext Job context going to be associated with the controller. * ! * @return Returns the defined implementation of the controller. */ ! public static JobController getJobController(JobContext jobContext) { logger.trace("Entering getJobController = " + jobContext.getJobName()); *************** *** 99,110 **** /** - * Gets the job context. - */ - public JobContext getJobContext() - { - return this.jobContext; - } - - /** * Gets the log level of the given logger name. * --- 93,96 ---- *************** *** 132,144 **** /** ! * This method will be called by Main to process the job. ! * This returns the exit status of the job, which will be communicate to everyone. * ! * @return Returns the exit status of the job. */ public abstract ErrorCode process(); /** ! * Returns the statistics of this job. Statistics should be queried only * after the completion of controller processing. Querying before the completion * of processing always returns null. --- 118,130 ---- /** ! * This method will be called by the Main to process the job. This returns the ! * ErrorCode explaining whether the process has been failed or succeeded. * ! * @return Returns the ErrorCode as exit status of the job. */ public abstract ErrorCode process(); /** ! * Returns the statistics of this job. Statistics will be queried only * after the completion of controller processing. Querying before the completion * of processing always returns null. |
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/controller/pool Modified Files: JobPool.java PoolJobController.java PoolJobLoader.java PoolJobProcessor.java Log Message: no message Index: PoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobProcessor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PoolJobProcessor.java 13 Sep 2006 23:29:45 -0000 1.8 --- PoolJobProcessor.java 14 Sep 2006 23:05:13 -0000 1.9 *************** *** 23,27 **** * </p> * ! * @param configProps Configuration defined for the job processor in job configuration. * @param pool Reference to Job Pool. * --- 23,27 ---- * </p> * ! * @param jobContext Context the job is being run. * @param pool Reference to Job Pool. * Index: PoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobLoader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PoolJobLoader.java 13 Sep 2006 23:29:45 -0000 1.9 --- PoolJobLoader.java 14 Sep 2006 23:05:13 -0000 1.10 *************** *** 23,38 **** * When finished loading of all the job data, loads the <i>null</i> into the pool * to singal the processor(s) that loading of all the jobs have been done. ! * Configuration defined for this loader in job configuration will be accessed by ! * configProps map received from controller. * <br> * Example loading the 100 integer objects into the pool. * <pre> ! * public class MyLoader * { ! * public ErrorCode loadPool(Map configProps, JobPool pool) * { * for(int i=0;i<100;i++ * pool.loadJobData(new Integer(i)); * pool.loadJobData(null); * } * } --- 23,40 ---- * When finished loading of all the job data, loads the <i>null</i> into the pool * to singal the processor(s) that loading of all the jobs have been done. ! * Configuration defined for this loader in job configuration can be accessed ! * using job context reference. * <br> * Example loading the 100 integer objects into the pool. * <pre> ! * public class MyLoader implements PoolJobLoader * { ! * public ErrorCode loadPool(JobContext jobContext, JobPool pool) * { * for(int i=0;i<100;i++ * pool.loadJobData(new Integer(i)); * pool.loadJobData(null); + * + * return ErrorCode.JOB_COMPLETED_SUCCESSFULLY * } * } *************** *** 40,44 **** * </p> * ! * @param configProps Properties defined for this job loader in job configuration. * @param pool Job Pool reference. * --- 42,46 ---- * </p> * ! * @param jobContext Context of the job being run. * @param pool Job Pool reference. * Index: JobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/JobPool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobPool.java 13 Sep 2006 23:29:45 -0000 1.7 --- JobPool.java 14 Sep 2006 23:05:12 -0000 1.8 *************** *** 16,23 **** { /** ! * Controller calls this method with the properties defined in the configuration ! * before reference is being passed to the job loader and job processor. * ! * @param configProps Properties defined in the configuration for the job pool. */ public void initialize(JobContext jobContext); --- 16,25 ---- { /** ! * Controller calls this method to initialize the job pool. This will be called ! * before pool reference is being passed to the job loader and job processor. ! * All the configuration defined for the job pool can be retrieved using ! * job context reference. * ! * @param jobContext Context of the job being run. */ public void initialize(JobContext jobContext); Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PoolJobController.java 13 Sep 2006 23:29:45 -0000 1.15 --- PoolJobController.java 14 Sep 2006 23:05:12 -0000 1.16 *************** *** 58,62 **** * <i>DB Configuration is as follows</i> * <table> ! * <tr><td>Column</td><td>Value</td></tr> * </table> * </p> --- 58,74 ---- * <i>DB Configuration is as follows</i> * <table> ! * <tr><td><b>TableName.ColumnName</b></td><td><b>Value</b></td></tr> ! * <tr><td>job_config.job_name</td><td>process_file_abc</td></tr> ! * <tr><td>job_config.job_status</td><td>1</td></tr> ! * <tr><td>job_config.job_controller_class_name</td><td>org.jmonks.batchserver.framework.controller.pool.PoolJobController</td></tr> ! * <tr><td>job_config.job_controller_props</td><td>pool-controller-config1=pool-controller-value1:pool-controller-config1=poo2-controller-value2</td></tr> ! * <tr><td>pool_job_controller_config.job_name</td><td>process_file_abc</td></tr> ! * <tr><td>pool_job_controller_config.pool_job_loader_class_name</td><td>com.mycompany.batch.processfileabc.AbcJobLoader</td></tr> ! * <tr><td>pool_job_controller_config.pool_job_loader_props</td><td>pool-job-loader-key1=loader-value1</td></tr> ! * <tr><td>pool_job_controller_config.pool_job_processor_class_name</td><td>com.mycompany.batch.processfileabc.AbcJobProcessor</td></tr> ! * <tr><td>pool_job_controller_config.pool_job_processor_props</td><td>pool-job-processor-key1=processor-value1</td></tr> ! * <tr><td>pool_job_controller_config.pool_job_processor_thread_cnt</td><td>5</td></tr> ! * <tr><td>pool_job_controller_config.job_pool_class_name</td><td>org.jmonks.batchserver.framework.controller.pool.CollectionJobPool</td></tr> ! * <tr><td>pool_job_controller_config.job_pool_props</td><td>job-pool-size=5000</td></tr> * </table> * </p> *************** *** 411,415 **** * @param countDownLock Count down to be released at the end of the processing. * @param jobLoader Job Loader that needs to be invoked. ! * @param configProps Properties defined for this loader in job configuration. * @param pool Job pool where the loader needs to load the jobs. * --- 423,427 ---- * @param countDownLock Count down to be released at the end of the processing. * @param jobLoader Job Loader that needs to be invoked. ! * @param jobContext Context of the job being run. * @param pool Job pool where the loader needs to load the jobs. * *************** *** 450,454 **** * @param countDownLock Count down to be released at the end of the processing. * @param jobProcessor Job processor that needs to be invoked. ! * @param configProps Properties defined for this loader in job configuration. * @param pool Job pool where the processor needs to pull the jobs. * --- 462,466 ---- * @param countDownLock Count down to be released at the end of the processing. * @param jobProcessor Job processor that needs to be invoked. ! * @param jobContext Context of the job being run. * @param pool Job pool where the processor needs to pull the jobs. * |
From: Suresh <sur...@us...> - 2006-09-14 23:05:17
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10680/config Modified Files: JobControllerConfig.java PoolJobControllerConfig.java Log Message: no message Index: JobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/JobControllerConfig.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobControllerConfig.java 14 Sep 2006 05:04:34 -0000 1.7 --- JobControllerConfig.java 14 Sep 2006 23:05:12 -0000 1.8 *************** *** 19,23 **** * <p> * JobControllerConfig represents the configuration needed for the Controller componenet. ! * There could be different implementation of the controller componenet. Each controller * componenet can have different configurations. So, this class provides the basic features * required by all the controllers. Each controller will have specific controller config which --- 19,23 ---- * <p> * JobControllerConfig represents the configuration needed for the Controller componenet. ! * There could be different implementations of the controller componenet available. Each controller * componenet can have different configurations. So, this class provides the basic features * required by all the controllers. Each controller will have specific controller config which Index: PoolJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/PoolJobControllerConfig.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PoolJobControllerConfig.java 14 Sep 2006 05:04:34 -0000 1.8 --- PoolJobControllerConfig.java 14 Sep 2006 23:05:12 -0000 1.9 *************** *** 22,25 **** --- 22,30 ---- * </p> * + * <p> + * PoolJobController holds the class names of the JobPool, PoolJobLoader & + * PoolJobProcessor and configuration required by those classes processor. + * </p> + * * @author Suresh Pragada * @since 1.0 |
From: Suresh <sur...@us...> - 2006-09-14 23:05:02
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10276/config Modified Files: JobConfig.java JobConfigFactory.java Log Message: no message Index: JobConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/JobConfig.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobConfig.java 14 Mar 2006 05:45:25 -0000 1.7 --- JobConfig.java 14 Sep 2006 23:04:59 -0000 1.8 *************** *** 16,21 **** * <p> * JobConfig represents the configuration needed to execute the job. This provides ! * interface to the different implementations of JobConfig. Each factory will provide ! * its own implementation of JobConfig. * </p> * --- 16,21 ---- * <p> * JobConfig represents the configuration needed to execute the job. This provides ! * interface to the different implementations of JobConfig. Each factory will read ! * the configuration from its source and creates JobConfig. * </p> * Index: JobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/JobConfigFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobConfigFactory.java 17 Mar 2006 05:14:13 -0000 1.7 --- JobConfigFactory.java 14 Sep 2006 23:04:59 -0000 1.8 *************** *** 10,16 **** package org.jmonks.batchserver.framework.config; - - import java.lang.reflect.Constructor; - import java.lang.reflect.InvocationTargetException; import java.util.Map; import org.apache.log4j.Logger; --- 10,13 ---- *************** *** 18,25 **** /** * <p> ! * This class returns the factory class which in turn returns the job configuration ! * objects from the defined factory. This class determines which factory needs to * be returned is based on the configFactoryClassName defined JobConfigFactoryConfig ! * object passed as input parameter. This class is based on the AbstractFacotry pattern. * </p> * <p> --- 15,22 ---- /** * <p> ! * JobConfigFactory returns the factory class instance which in turn returns the job configuration ! * objects from the designated factory. This class determines the factory needs to * be returned is based on the configFactoryClassName defined JobConfigFactoryConfig ! * object passed as input parameter. * </p> * <p> *************** *** 43,47 **** /** ! * This factory method will return the appropriated job configuration factory based * on the input values in JobConfigFactoryConfig object. This looks for the factory class * name in the given object, instantiates and return that factory. --- 40,44 ---- /** ! * This factory method will return the appropriate job configuration factory based * on the input values in JobConfigFactoryConfig object. This looks for the factory class * name in the given object, instantiates and return that factory. *************** *** 112,116 **** * Method to initialize the factory using properies defined for this factory * in framework configuration file. All the properties defined for this ! * configuration factory will be passed as map to this method. * * @param configFactoryProps Map consists of all the properties defined for this factory. --- 109,114 ---- * Method to initialize the factory using properies defined for this factory * in framework configuration file. All the properties defined for this ! * configuration factory will be passed as map to this method as soon as the ! * factory is instantiated. * * @param configFactoryProps Map consists of all the properties defined for this factory. |
From: Suresh <sur...@us...> - 2006-09-14 23:05:02
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/util In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10276/util Modified Files: FrameworkUtil.java JdbcConnectionHelper.java Log Message: no message Index: FrameworkUtil.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/util/FrameworkUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrameworkUtil.java 29 Aug 2006 02:01:33 -0000 1.1 --- FrameworkUtil.java 14 Sep 2006 23:04:59 -0000 1.2 *************** *** 13,19 **** * FramworkUtil contains utility methods required by the framework. * </p> - * <p> - * Note : This class does not maintain any state. Keep all the methods as static - * </p> * * @author Suresh Pragada --- 13,16 ---- Index: JdbcConnectionHelper.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/util/JdbcConnectionHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JdbcConnectionHelper.java 12 Sep 2006 04:07:55 -0000 1.2 --- JdbcConnectionHelper.java 14 Sep 2006 23:04:59 -0000 1.3 *************** *** 17,43 **** /** * ! * @author Suresh Pragada */ public final class JdbcConnectionHelper { /** ! * Constant defines the property name for jdbc driver class name. The name ! * should be "jdbc-driver-class-name". */ public static final String PROPERTY_JDBC_DRIVER_CLASS_NAME = "jdbc-driver-class-name"; /** ! * Constant defines the property name for database URL. The name ! * should be "jdbc-url". */ public static final String PROPERTY_JDBC_URL = "jdbc-url"; /** ! * Constant defines the property name for database user name. The name ! * should be "username". */ public static final String PROPERTY_DATABASE_USER_NAME = "username"; /** ! * Constant defines the property name for database password. The name ! * should be "password". */ public static final String PROPERTY_DATABASE_PASSWORD = "password"; --- 17,48 ---- /** + * JdbcConnectionHelper helps the jdbc repository and db configuration factory + * to create the jdbc connections with the given configuration map and closes the + * connections. * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public final class JdbcConnectionHelper { /** ! * Constant defines the property name for jdbc driver class name which is ! * <code>jdbc-driver-class-name</code>. */ public static final String PROPERTY_JDBC_DRIVER_CLASS_NAME = "jdbc-driver-class-name"; /** ! * Constant defines the property name for database URL which is ! * <code>jdbc-url</code>. */ public static final String PROPERTY_JDBC_URL = "jdbc-url"; /** ! * Constant defines the property name for database user name which is ! * <code>username</code>. */ public static final String PROPERTY_DATABASE_USER_NAME = "username"; /** ! * Constant defines the property name for database password which is ! * <code>password</code>. */ public static final String PROPERTY_DATABASE_PASSWORD = "password"; *************** *** 83,86 **** --- 88,92 ---- connection=DriverManager.getConnection(databaseURL,userName, password); connection.setAutoCommit(false); + logger.debug("Connection has been created successfully"); } catch(Exception exception) *************** *** 108,111 **** --- 114,118 ---- if(connection!=null && !connection.isClosed()) connection.close(); + logger.debug("Connection has been closed successfully"); } catch(Exception exception) |
From: Suresh <sur...@us...> - 2006-09-14 23:05:02
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10276/controller/pool Modified Files: AbstractPoolJobLoader.java AbstractPoolJobProcessor.java Log Message: no message Index: AbstractPoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobLoader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AbstractPoolJobLoader.java 13 Sep 2006 23:29:45 -0000 1.10 --- AbstractPoolJobLoader.java 14 Sep 2006 23:04:59 -0000 1.11 *************** *** 62,66 **** * and monitoring related methods. * ! * @param configProps Properties defined for this loader in job configuration. * @param pool Job Pool reference. * --- 62,66 ---- * and monitoring related methods. * ! * @param jobContext Context of the job being run. * @param pool Job Pool reference. * *************** *** 210,216 **** * <br> * <pre> ! * public class MyLoader * { ! * public ErrorCode loadPool(Map configProps) * { * for(int i=0;i<100;i++) --- 210,216 ---- * <br> * <pre> ! * public class MyLoader extends AbstractPoolJobLoader * { ! * public ErrorCode loadPool(JobContext jobContext) * { * for(int i=0;i<100;i++) *************** *** 231,235 **** * </p> * ! * @param configProps Configuration defined for this job loader in job configuration. * * @return Returns the final status of the loader. --- 231,235 ---- * </p> * ! * @param jobContext Context of the job being run. * * @return Returns the final status of the loader. Index: AbstractPoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobProcessor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractPoolJobProcessor.java 13 Sep 2006 23:29:45 -0000 1.7 --- AbstractPoolJobProcessor.java 14 Sep 2006 23:04:59 -0000 1.8 *************** *** 57,61 **** * </p> * ! * @param configProps Properties defined for the processor in job configuration. * @param pool Job pool reference where job data needs to be pulled. * --- 57,61 ---- * </p> * ! * @param jobContext Context the job is being run. * @param pool Job pool reference where job data needs to be pulled. * *************** *** 209,226 **** /** ! * Chance to initialize itself using the information configured for this job ! * processor in job configuration. * ! * @param configProps Configuration defined for the job processor in job configuration. */ public abstract void initialize(JobContext jobContext); /** * */ public abstract ErrorCode process(Object jobData); /** ! * Chance to do any cleanup at the end of the processing. */ public abstract void cleanup(); --- 209,232 ---- /** ! * Chance to initialize itself using the information provided through ! * job context. This will be called only once for each processor and before ! * it start processing job data using process method. * ! * @param jobContext Context the job is being run. */ public abstract void initialize(JobContext jobContext); /** + * Execute the business logic on the given jobData and return the + * appropriate error code. The format and type of jobData is depend + * on the job loader. * + * @param jobData Data to be processed. */ public abstract ErrorCode process(Object jobData); /** ! * Chance to do any cleanup at the end of the processing. Called once per ! * each processor at the end of processing of all the jobs. */ public abstract void cleanup(); |
From: Suresh <sur...@us...> - 2006-09-14 23:05:02
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10276/controller/basic Modified Files: BasicJobController.java Log Message: no message Index: BasicJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobController.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BasicJobController.java 13 Sep 2006 23:29:45 -0000 1.15 --- BasicJobController.java 14 Sep 2006 23:04:59 -0000 1.16 *************** *** 67,71 **** { logger.info("Entering process in basic job controller = " + super.jobContext.getJobName()); ! BasicJobControllerConfig basicJobControllerConfig=(BasicJobControllerConfig)getJobContext().getJobConfig().getJobControllerConfig(); int threadCount=basicJobControllerConfig.getBasicJobProcessThreadCount(); /** --- 67,71 ---- { logger.info("Entering process in basic job controller = " + super.jobContext.getJobName()); ! BasicJobControllerConfig basicJobControllerConfig=(BasicJobControllerConfig)super.jobContext.getJobConfig().getJobControllerConfig(); int threadCount=basicJobControllerConfig.getBasicJobProcessThreadCount(); /** *************** *** 289,294 **** --- 289,296 ---- * method on the controller. * </p> + * * @param countDownLock CountDown object to release when the processing has been done. * @param jobProcessor Initialized Basic job processor instance. + * @param jobContext JobContext to be passed to the job processors. * * @return Returns the runnable instance. |
From: Suresh <sur...@us...> - 2006-09-14 23:05:02
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10276/management Modified Files: JobConnectorHelper.java Log Message: no message Index: JobConnectorHelper.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobConnectorHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JobConnectorHelper.java 13 Sep 2006 23:29:45 -0000 1.4 --- JobConnectorHelper.java 14 Sep 2006 23:04:59 -0000 1.5 *************** *** 129,135 **** /** ! * Registers the jmx connector server with the given job name in the desired lookup location. * ! * @param jobName Name of the job to be used in the registration. * @param jmxConnectorServer JMX connector server where all the manager and monnitor mbeans are configured. * --- 129,135 ---- /** ! * Registers the jmx connector server with the job name taken from job context in the desired lookup location. * ! * @param jobContext Context of the job is being run. * @param jmxConnectorServer JMX connector server where all the manager and monnitor mbeans are configured. * *************** *** 141,148 **** /** ! * Unregisters the jmx connector server registered in desired lookup location with the given ! * job name. * ! * @param Name of the job by which jmx connector server has been registered with. * * @return Returns true, if it successfully unregistered, false otherwise. --- 141,148 ---- /** ! * Unregisters the jmx connector server registered in desired lookup location with the ! * job name available in job context. * ! * @param jobContext Context of the job is being run. * * @return Returns true, if it successfully unregistered, false otherwise. |
From: Suresh <sur...@us...> - 2006-09-14 23:04:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10191/config/db Modified Files: DBBasicJobControllerConfig.java DBJobConfig.java DBJobConfigFactory.java DBJobControllerConfig.java DBJobLoggingConfig.java DBPoolJobControllerConfig.java Log Message: no message Index: DBJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfigFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DBJobConfigFactory.java 10 Sep 2006 17:58:07 -0000 1.10 --- DBJobConfigFactory.java 14 Sep 2006 23:04:23 -0000 1.11 *************** *** 27,41 **** * DBJobConfigFactory reads the job configuration from defined database to create the * configuration objects needed by the job. This factory looks for few properties ! * in the config properties map to identify the database it needs to connect to. This ! * factory looks for the job configuration in the table <b>job-config</b> in the database. * Controller configuration will be defined in a seperate tables, and DBJobControllerConfig * is responsible to read the job controller configuration from the database. * </p> * <p> * This factory looks for the properties "jdbc-driver-class-name","jdbc-url", * "username" and "password" in job config factory config in framework configuration to ! * establish the connection to read the job configuration. If anyone of the properties * are missing, it throws ConfigurationException. Following example shows, how it can ! * be configured. * <br><br> * <pre> --- 27,42 ---- * DBJobConfigFactory reads the job configuration from defined database to create the * configuration objects needed by the job. This factory looks for few properties ! * in the factory config properties map to identify the database it needs to connect to. This ! * factory looks for the job configuration in the <b>job-config</b> table in the database. * Controller configuration will be defined in a seperate tables, and DBJobControllerConfig * is responsible to read the job controller configuration from the database. * </p> + * * <p> * This factory looks for the properties "jdbc-driver-class-name","jdbc-url", * "username" and "password" in job config factory config in framework configuration to ! * establish the connection to read the job configuration. If any one of the properties * are missing, it throws ConfigurationException. Following example shows, how it can ! * be configured for Oracle database. * <br><br> * <pre> Index: DBJobConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfig.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DBJobConfig.java 14 Mar 2006 23:04:09 -0000 1.5 --- DBJobConfig.java 14 Sep 2006 23:04:23 -0000 1.6 *************** *** 23,35 **** * DBJobConfig provides the implementation of JobConfig by reading the * job configuration from given connection. This reads the job configuration ! * from table "job_config". Following is the schema of that table. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td></tr> ! * <tr><td>JOB_STATUS</td><td>NUMBER</td></tr> ! * <tr><td>JOB_CONTROLLER_CLASS_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>JOB_CONTROLLER_PROPS</td><td>VARCHAR2(1024)</td></tr> * </table> * </pre> --- 23,35 ---- * DBJobConfig provides the implementation of JobConfig by reading the * job configuration from given connection. This reads the job configuration ! * from table <b>job_config</b>. Following is the schema of that table. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> ! * <tr><td>JOB_STATUS</td><td>NUMBER</td><td>Status of the job. 1 - Active, 0 - Inactive</td></tr> ! * <tr><td>JOB_CONTROLLER_CLASS_NAME</td><td>VARCHAR2(256)</td><td>Controller to be used for this job. For pool job controller "<code>org.jmonks.batchserver.framework.controller.pool.PoolJobController</code> and for basic job controller <code>org.jmonks.batchserver.framework.controller.basic.BasicJobController</code></td></tr> ! * <tr><td>JOB_CONTROLLER_PROPS</td><td>VARCHAR2(1024)</td><td>Configuration properties for the controller. See the schema column comments for the format.</td></tr> * </table> * </pre> Index: DBPoolJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBPoolJobControllerConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DBPoolJobControllerConfig.java 29 Aug 2006 02:01:32 -0000 1.9 --- DBPoolJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.10 *************** *** 23,41 **** * <p> * DBPoolJobControllerConfig loads the job controller configuration from the defined ! * database. This loads the pool controller configuration from the table "pool_job_controller_config". * Following is the schema of that table defined in the database. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_CLASS_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_THREAD_CNT</td><td>NUMBER</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_PROPS</td><td>VARCHAR2(1024)</td></tr> ! * <tr><td>POOL_JOB_LOADER_CLASS_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>POOL_JOB_LOADER_PROPS</td><td>VARCHAR2(1024)</td></tr> ! * <tr><td>JOB_POOL_CLASS_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>JOB_POOL_PROPS</td><td>VARCHAR2(1024)</td></tr> ! * * </table> * </pre> --- 23,40 ---- * <p> * DBPoolJobControllerConfig loads the job controller configuration from the defined ! * database. This loads the pool controller configuration from the table <b>pool_job_controller_config</b>. * Following is the schema of that table defined in the database. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_CLASS_NAME</td><td>VARCHAR2(256)</td><td>Name of the processor class writes the business logic of consumer the data from the pool by implementing the PoolJobProcessor interface.</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_THREAD_CNT</td><td>NUMBER</td><td>Number of processor instances (each instance will be run in its own thread) to be created while executing the job.</td></tr> ! * <tr><td>POOL_JOB_PROCESSOR_PROPS</td><td>VARCHAR2(1024)</td><td>Configuration properties required by the job processor.</td></tr> ! * <tr><td>POOL_JOB_LOADER_CLASS_NAME</td><td>VARCHAR2(256)</td><td>Name of the loader class writes the business logic of loading the jobs into the pool by implemention the PoolJobLoader interface. This will be run in its own thread.</td></tr> ! * <tr><td>POOL_JOB_LOADER_PROPS</td><td>VARCHAR2(1024)</td><td>Configuration properties required by the job loader.</td></tr> ! * <tr><td>JOB_POOL_CLASS_NAME</td><td>VARCHAR2(256)</td><td>Name of the class act as pool/channel/pipe between the loader and multiple processors. Multiple implementations will be available and can be chosen based on the need.</td></tr> ! * <tr><td>JOB_POOL_PROPS</td><td>VARCHAR2(1024)</td><td>Configuration properties required by the job pool.</td></tr> * </table> * </pre> Index: DBJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobControllerConfig.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DBJobControllerConfig.java 14 Mar 2006 23:04:09 -0000 1.6 --- DBJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.7 *************** *** 23,29 **** /** * DBJobControllerConfig responsible to build the controller specific ! * JobControllerConfig objects from the given database. ! * * @author Suresh Pragada * @version 1.0 --- 23,34 ---- /** + * <p> * DBJobControllerConfig responsible to build the controller specific ! * JobControllerConfig objects from the given database. It looks for the ! * configured controller in <b>job_config.job_controller_class_name</b> column ! * and instantiates the appropriate JobControllerConfig instance and set the ! * controller configuration properties. ! * </p> ! * * @author Suresh Pragada * @version 1.0 Index: DBBasicJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBBasicJobControllerConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DBBasicJobControllerConfig.java 29 Aug 2006 02:01:32 -0000 1.9 --- DBBasicJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.10 *************** *** 23,36 **** * <p> * DBBasicJobControllerConfig loads the job controller configuration from the defined ! * database. This loads the basic controller configuration from the table "basic_job_controller_config". * Following is the schema of that table defined in the database. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_CLASS_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_THREAD_CNT</td><td>NUMBER</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_PROPS</td><td>VARCHAR2(1024)</td></tr> * </table> * </pre> --- 23,36 ---- * <p> * DBBasicJobControllerConfig loads the job controller configuration from the defined ! * database. This loads the basic controller configuration from the table <b>basic_job_controller_config</b>. * Following is the schema of that table defined in the database. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_CLASS_NAME</td><td>VARCHAR2(256)</td><td>Name of the processor class implements the business logic by extending the BasicJobProcessor class.</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_THREAD_CNT</td><td>NUMBER</td><td>Number of processor instances(each instance will be executed in its own thread) to be created while executing the job.</td></tr> ! * <tr><td>BASIC_JOB_PROCESSOR_PROPS</td><td>VARCHAR2(1024)</td><td>Configuration properties required by the processor. These can be accessed through JobContext reference.</td></tr> * </table> * </pre> Index: DBJobLoggingConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobLoggingConfig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DBJobLoggingConfig.java 14 Mar 2006 05:47:15 -0000 1.1 --- DBJobLoggingConfig.java 14 Sep 2006 23:04:23 -0000 1.2 *************** *** 21,33 **** /** * <p> ! * DBJobLoggingConfig reads the job logging configuration from the table "job_logging_config". ! * Below is the schema of job_logging_config table. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td></tr> ! * <tr><td>JOB_LOGGER_NAME</td><td>VARCHAR2(256)</td></tr> ! * <tr><td>JOB_LOGGER_LEVEL</td><td>VARCHAR2(32)</td></tr> * </table> * </pre> --- 21,33 ---- /** * <p> ! * DBJobLoggingConfig reads the job logging configuration from the table <b>job_logging_config</b>. ! * Below is the schema of <b>job_logging_config</b> table. * <br><br> * <pre> * <table> ! * <tr><td><b>Column Name</b></td><td><b>Data Type</b></td><td><b>Purpose</b></td></tr> ! * <tr><td>JOB_NAME</td><td>VARCHAR2(64)</td><td>Name of the Job.</td></tr> ! * <tr><td>JOB_LOGGER_NAME</td><td>VARCHAR2(256)</td><td>Package name of the logger. Values will be like <code>com.mycompany.jobs.myjob</code></td></tr> ! * <tr><td>JOB_LOGGER_LEVEL</td><td>VARCHAR2(32)</td><td>Level of the logger. Values can be TRACE,DEBUG,INFO,WARN,ERROR,FATAL</td></tr> * </table> * </pre> *************** *** 44,48 **** /** ! * Reads the configuration from the table job_logging_config and add * each record as JobLoggerConfig object. * --- 44,48 ---- /** ! * Reads the configuration from the table <b>job_logging_config</b> and add * each record as JobLoggerConfig object. * |
From: Suresh <sur...@us...> - 2006-09-14 23:04:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10191/config Modified Files: BasicJobControllerConfig.java ConfigurationException.java FrameworkConfig.java Log Message: no message Index: BasicJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/BasicJobControllerConfig.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BasicJobControllerConfig.java 14 Sep 2006 05:04:33 -0000 1.8 --- BasicJobControllerConfig.java 14 Sep 2006 23:04:23 -0000 1.9 *************** *** 17,22 **** /** * BasicJobControllerConfig provides the configuration for the BasicJobController. ! * * @author Suresh Pragada * @version 1.0 --- 17,30 ---- /** + * <p> * BasicJobControllerConfig provides the configuration for the BasicJobController. ! * </p> ! * ! * <p> ! * BasicJobController holds the class name that extended the BasicJobProcessor and ! * number of instances(each instance run its own thread) to be created to run this ! * processor and configuration required by that processor. ! * </p> ! * * @author Suresh Pragada * @version 1.0 Index: FrameworkConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/FrameworkConfig.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FrameworkConfig.java 14 Sep 2006 05:04:33 -0000 1.12 --- FrameworkConfig.java 14 Sep 2006 23:04:23 -0000 1.13 *************** *** 31,37 **** * <p> * FrameworkConfig class is responsible to read the framework configuration from ! * framework-config.xml file and gives configuration in the form of ! * configuration objects when needed. Framework configuration will be defined ! * in the file framework-config.xml and will be accessed using class path loader. * </p> * --- 31,38 ---- * <p> * FrameworkConfig class is responsible to read the framework configuration from ! * <code>framework-config.xml</code> file and gives the configuration ! * in the form of configuration objects when needed. ! * This searches the classpath for the <code>framework-config.xml</code>. Place ! * this file in any directory and keep the directory in the classpath. * </p> * *************** *** 49,58 **** /** ! * Declaration of XML file holds the framework configuration. */ private static final String FRAMEWORK_CONFIG_FILE = "framework-config.xml"; /** ! * Name of the tag represents the complete framework configuration. */ private static final String FRAMEWORK_CONFIG_TAG_NAME = "framework-confg"; --- 50,59 ---- /** ! * Declaration of XML file holds the framework configuration which is <code>framework-config.xml</code>. */ private static final String FRAMEWORK_CONFIG_FILE = "framework-config.xml"; /** ! * Name of the tag represents the complete framework configuration which is <code>framework-config</code>. */ private static final String FRAMEWORK_CONFIG_TAG_NAME = "framework-confg"; *************** *** 79,90 **** /** ! * ! * Private constructor to make sure FrameworkCongi cannot be instantiated. This will * read the framework configuration file and create the instances of of JobConfigFactoryConfig, * FrameworkLoggingConfig, JobConnectorConfig and RepositoryConfig by passing the correct DOM elements to their ! * constructors. This does the validation of configuration file against the defined XML schema file. ! * In case of errors it throws the ConfigurationException with the correct error code. ! * ! * @throws RuntimeException If framework configuration file is not properly formed and validation is failed. * @throws ConfigurationException If configuration file could not be found. */ --- 80,91 ---- /** ! * <p> ! * Private constructor to make sure FrameworkConfig cannot be instantiated. This will * read the framework configuration file and create the instances of of JobConfigFactoryConfig, * FrameworkLoggingConfig, JobConnectorConfig and RepositoryConfig by passing the correct DOM elements to their ! * constructors. In case of errors in the configuration it throws the ConfigurationException ! * with the correct error code. ! * </p> ! * * @throws ConfigurationException If configuration file could not be found. */ *************** *** 105,112 **** DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance(); documentBuilderFactory.setValidating(true); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema"); InputStream xsdStream=FrameworkConfig.class.getClassLoader().getResourceAsStream("framework-config.xsd"); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",xsdStream); ! DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder(); documentBuilder.setErrorHandler(new DefaultHandler()); --- 106,115 ---- DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance(); documentBuilderFactory.setValidating(true); + + /* Commenting out the validator for a while documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema"); InputStream xsdStream=FrameworkConfig.class.getClassLoader().getResourceAsStream("framework-config.xsd"); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",xsdStream); ! */ DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder(); documentBuilder.setErrorHandler(new DefaultHandler()); *************** *** 201,205 **** * Returns the FrameworkConfig instance. * ! * @return Returns the frameworkconfig instance. */ public static FrameworkConfig getInstance() --- 204,208 ---- * Returns the FrameworkConfig instance. * ! * @return Returns the FrameworkConfig instance. */ public static FrameworkConfig getInstance() *************** *** 231,234 **** --- 234,238 ---- /** * Returns the mgmt&mntr configuration defines in the framework configuration as JobConnectorConfig object. + * * @return Returns the JobConnectorConfig object. */ *************** *** 261,265 **** * <p> * JobConfigFactoryConfig class holds the configuration information required ! * by Job configuration factory. Factory would need some properties like source * of the job configuration, credentials to access the source * based on the factory type. This object provides the factory class name --- 265,269 ---- * <p> * JobConfigFactoryConfig class holds the configuration information required ! * by Job configuration factories. Factory would need some properties like source * of the job configuration, credentials to access the source * based on the factory type. This object provides the factory class name *************** *** 287,295 **** { /** ! * Tag name represents the job config factory config in framework configuration file. */ private static final String TAG_NAME = "job-config-factory-config"; /** ! * Attribute name represents the job config factory class name. */ private static final String FACTORY_CLASS_ATTRIBUTE_NAME = "job-config-factory-class-name"; --- 291,301 ---- { /** ! * Tag name represents the job config factory config in framework configuration file ! * which is <code>job-config-factory-config</code>. */ private static final String TAG_NAME = "job-config-factory-config"; /** ! * Attribute name represents the job config factory class name which is ! * <code>job-config-factory-class-name</code>. */ private static final String FACTORY_CLASS_ATTRIBUTE_NAME = "job-config-factory-class-name"; *************** *** 326,329 **** --- 332,336 ---- /** * Returns the class name of the factory used to read the job configuration. + * * @return Returns the factory class name. */ *************** *** 366,370 **** * FrameworkLoggingConfig class holds configuration required to enable the framework logging * by LoggingManager. This configuration would be like the directory needs to write ! * job log files and logging level of the framework logs and job logs and base package name * to be used to create the logging handlers. * This class can be accessed by all the classes in the framework --- 373,377 ---- * FrameworkLoggingConfig class holds configuration required to enable the framework logging * by LoggingManager. This configuration would be like the directory needs to write ! * job log files and logging level of the framework logs & job logs and base package name * to be used to create the logging handlers. * This class can be accessed by all the classes in the framework *************** *** 383,404 **** { /** ! * Tag name represents the logging config in framework configuration file. */ ! private static final String TAG_NAME = "framework-logging-config"; ! /** ! * Attribute name defines the framework logging level. */ private static final String FRAMEWORK_LOGGING_LEVEL_ATTRIB_NAME = "framework-logging-level"; /** ! * Attribute name defines the job logging directory. */ private static final String JOB_LOGGING_DIRECTORY_ATTRIB_NAME = "job-logging-directory"; /** ! * Attribute name defines the job logging level. */ private static final String JOB_LOGGING_LEVEL_ATTRIB_NAME = "job-logging-level"; /** ! * Attribute name defines the job base package name. */ private static final String JOB_BASE_PACKAGE_ATTRIB_NAME = "job-base-package-name"; --- 390,411 ---- { /** ! * Tag name represents the logging config in framework configuration file which ! * is <code>framework-logging-config</code>. */ ! private static final String TAG_NAME = "framework-logging-config"; /** ! * Attribute name defines the framework logging level which is <code>framework-logging-level</code>. */ private static final String FRAMEWORK_LOGGING_LEVEL_ATTRIB_NAME = "framework-logging-level"; /** ! * Attribute name defines the job logging directory which is <code>job-logging-directory</code>. */ private static final String JOB_LOGGING_DIRECTORY_ATTRIB_NAME = "job-logging-directory"; /** ! * Attribute name defines the job logging level which is <code>job-logging-level</code>. */ private static final String JOB_LOGGING_LEVEL_ATTRIB_NAME = "job-logging-level"; /** ! * Attribute name defines the job base package name which is <code>job-base-package-name</code>. */ private static final String JOB_BASE_PACKAGE_ATTRIB_NAME = "job-base-package-name"; *************** *** 531,540 **** { /** ! * Tag name represents the job connector config in framework configuration file. */ private static final String TAG_NAME = "job-connector-config"; /** ! * Attribute name defines the job connector server helper class name. */ private static final String JOB_CONNECTOR_HELPER_CLASS_ATTRIB_NAME = "job-connector-helper-class-name"; --- 538,549 ---- { /** ! * Tag name represents the job connector config in framework configuration file ! * which is <code>job-connector-config</code>. */ private static final String TAG_NAME = "job-connector-config"; /** ! * Attribute name defines the job connector server helper class name ! * which is <code>job-connector-helper-class-name</code>. */ private static final String JOB_CONNECTOR_HELPER_CLASS_ATTRIB_NAME = "job-connector-helper-class-name"; *************** *** 627,636 **** { /** ! * Tag name represents the repository config in framework configuration file. */ private static final String TAG_NAME = "repository-config"; /** ! * Attribute name defines the repository class name. */ private static final String REPOSITORY_CLASS_ATTRIB_NAME = "repository-class-name"; --- 636,646 ---- { /** ! * Tag name represents the repository config in framework configuration file ! * which is <code>repository-config</code>. */ private static final String TAG_NAME = "repository-config"; /** ! * Attribute name defines the repository class name which is <code>repository-class-name</code>. */ private static final String REPOSITORY_CLASS_ATTRIB_NAME = "repository-class-name"; *************** *** 728,740 **** { /** ! * Tag name represents the controller config in framework configuration file. */ private static final String TAG_NAME = "job-controller-config"; /** ! * Tag name defines the each controller. */ private static final String JOB_CONTROLLER_TAG_NAME = "job-controller"; /** ! * Attribute name defines the controller class name. */ private static final String JOB_CONTROLLER_CLASS_ATTRIB_NAME = "controller-class-name"; --- 738,751 ---- { /** ! * Tag name represents the controller config in framework configuration file ! * which is <code>job-controller-config</code>. */ private static final String TAG_NAME = "job-controller-config"; /** ! * Tag name defines the each controller which is <code>job-controller</code>. */ private static final String JOB_CONTROLLER_TAG_NAME = "job-controller"; /** ! * Attribute name defines the controller class name which is <code>controller-class-name</code>. */ private static final String JOB_CONTROLLER_CLASS_ATTRIB_NAME = "controller-class-name"; Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ConfigurationException.java 29 Aug 2006 02:01:32 -0000 1.12 --- ConfigurationException.java 14 Sep 2006 23:04:23 -0000 1.13 *************** *** 4,10 **** /** * <p> ! * ConfigurationException defines problems in either framework configuration ! * or job configuration. This is runtime exception, since, configuration ! * problems cannot be detected until the runtime. This will have component * name identifies either framework configuration or job configuration and the message * explains the complete problem. --- 4,10 ---- /** * <p> ! * ConfigurationException defines the problems in either framework configuration ! * or job configuration. Since the configuration exceptions are cannot be detected ! * untile the runtime, this has been defined as Runtime exception. This will have the component * name identifies either framework configuration or job configuration and the message * explains the complete problem. |
From: Suresh <sur...@us...> - 2006-09-14 23:04:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10191/controller/basic Modified Files: BasicJobProcessor.java Log Message: no message Index: BasicJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobProcessor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BasicJobProcessor.java 13 Sep 2006 23:29:45 -0000 1.12 --- BasicJobProcessor.java 14 Sep 2006 23:04:23 -0000 1.13 *************** *** 7,11 **** /** * <p> ! * BasicJobProcessor lets developers implement their business logic. * </p> * --- 7,11 ---- /** * <p> ! * BasicJobProcessor lets developers implement their business logic. * </p> * *************** *** 127,134 **** * <p> * Does the processing and return the appropriate error code. Properties ! * configured for this job processor will be passed through the configProps. * </p> * ! * @param configProps Properties defined for job processor in the job configuration. * * @return Returns the appropriate error code needs to be passed to the invocation layer. --- 127,134 ---- * <p> * Does the processing and return the appropriate error code. Properties ! * configured for this job processor can be retrieved from the JobContext. * </p> * ! * @param jobContext Context of the job, where all the properties will be defined. * * @return Returns the appropriate error code needs to be passed to the invocation layer. |
From: Suresh <sur...@us...> - 2006-09-14 23:04:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10191/controller/pool Modified Files: CollectionJobPool.java Log Message: no message Index: CollectionJobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/CollectionJobPool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CollectionJobPool.java 13 Sep 2006 23:29:45 -0000 1.8 --- CollectionJobPool.java 14 Sep 2006 23:04:23 -0000 1.9 *************** *** 124,132 **** /** * Initializes the collection job pool using the configuration defined ! * in the job configuration. It gets the pool size from the given configuration, * by looking for the property "job-pool-size", if it couldnt find it uses the default pool size "1000" * and initializes the collection to be used as the pool. * ! * @param configProps Configuration defined for the job pool. */ public void initialize(JobContext jobContext) --- 124,132 ---- /** * Initializes the collection job pool using the configuration defined ! * in the job configuration. It gets the pool size from the defined configuration, * by looking for the property "job-pool-size", if it couldnt find it uses the default pool size "1000" * and initializes the collection to be used as the pool. * ! * @param jobContext Context of the job being run. */ public void initialize(JobContext jobContext) |