batchserver-cvs Mailing List for Enterprise Batch Server (Page 24)
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-03-07 03:42:46
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19383 Modified Files: ErrorCode.java Log Message: no message Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/ErrorCode.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ErrorCode.java 6 Mar 2006 04:36:30 -0000 1.3 --- ErrorCode.java 7 Mar 2006 03:42:43 -0000 1.4 *************** *** 81,99 **** * Framework Configuration Error Codes. */ ! public final static ErrorCode JOBNAME_KEY_NOT_FOUND = new ErrorCode(1001,"job-name key not found in the startup properties"); ! public final static ErrorCode FRAMEWORK_CONFIG_FILE_NOT_FOUND = new ErrorCode(1002,"framework configuration file framework-config.xml is not found in the classpath"); ! public final static ErrorCode NONE_OR_MULITPLE_JOB_CONFIG_FACTORY_CONFIG_TAGS = new ErrorCode(1003,"None or multiple job-config-factory-config tag(s) in framework configuration"); ! public final static ErrorCode NONE_OR_MULITPLE_LOGGING_CONFIG_TAGS = new ErrorCode(1004,"None or multiple logging-config tag(s) in framework configuration"); ! public final static ErrorCode NONE_OR_MULITPLE_MGMT_MNTR_CONFIG_TAGS = new ErrorCode(1005,"None or multiple mgmt-mntr-config tag(s) in framework configuration"); ! public final static ErrorCode NONE_OR_MULITPLE_REPOSITORY_CONFIG_TAGS = new ErrorCode(1006,"None or multiple repository-config tag(s) in framework configuration"); public static final ErrorCode JOB_CONFIG_FACTORY_CLASS_NAME_ATTRIB_NOT_FOUND = new ErrorCode(1007,"Attribute job-config-factory-class-name not found in job-config-factory-config element"); /** * Job Configuration Error Codes. */ ! public final static ErrorCode JOB_NOT_CONFIGURED = new ErrorCode(2001,"job is not configured in the job configuration source"); ! public final static ErrorCode INVALID_JOB_CONFIG_FACTORY = new ErrorCode(2002,"not a valid configuration factory"); ! public final static ErrorCode MISSING_PROPS_XML_CONFIG_FACTORY = new ErrorCode(2003,"required properties are missing in xml config factory configuration"); ! public final static ErrorCode UNABLE_TO_LOAD_XML_JOB_CONFIG_FILE = new ErrorCode(2004,"configured xml job configuration file cannot be loaded"); ! public final static ErrorCode INVALID_JOB_CONFIG_FILE_FORMAT = new ErrorCode(2005,"xml job configuration file is not in a valid format"); } --- 81,104 ---- * Framework Configuration Error Codes. */ ! public static final ErrorCode JOBNAME_KEY_NOT_FOUND = new ErrorCode(1001,"job-name key not found in the startup properties"); ! public static final ErrorCode FRAMEWORK_CONFIG_FILE_NOT_FOUND = new ErrorCode(1002,"framework configuration file framework-config.xml is not found in the classpath"); ! public static final ErrorCode NONE_OR_MULITPLE_JOB_CONFIG_FACTORY_CONFIG_TAGS = new ErrorCode(1003,"None or multiple job-config-factory-config tag(s) in framework configuration"); ! public static final ErrorCode NONE_OR_MULITPLE_LOGGING_CONFIG_TAGS = new ErrorCode(1004,"None or multiple logging-config tag(s) in framework configuration"); ! public static final ErrorCode NONE_OR_MULITPLE_MGMT_MNTR_CONFIG_TAGS = new ErrorCode(1005,"None or multiple mgmt-mntr-config tag(s) in framework configuration"); ! public static final ErrorCode NONE_OR_MULITPLE_REPOSITORY_CONFIG_TAGS = new ErrorCode(1006,"None or multiple repository-config tag(s) in framework configuration"); public static final ErrorCode JOB_CONFIG_FACTORY_CLASS_NAME_ATTRIB_NOT_FOUND = new ErrorCode(1007,"Attribute job-config-factory-class-name not found in job-config-factory-config element"); + public static final ErrorCode LOGGING_DIRECTORY_NOT_DEFINED = new ErrorCode(1008,"Logging directory is not defined in the logging-config"); + public static final ErrorCode MGMT_MNTR_CLASS_NAME_ATTRIB_NOT_FOUND = new ErrorCode(1009,"Attribute mgmt-mntr-class-name not found in mgmt-mntr-config element"); + public static final ErrorCode REPOSITORY_CLASS_NAME_ATTRIB_NOT_FOUND = new ErrorCode(1010,"Attribute repository-class-name not found in repository-config element"); + /** * Job Configuration Error Codes. */ ! public static final ErrorCode JOB_NOT_CONFIGURED = new ErrorCode(2001,"job is not configured in the job configuration source"); ! public static final ErrorCode JOB_CONFIG_FACTORY_CLASS_NOT_VALID = new ErrorCode(2002,"defined configuration factory class is not valid"); ! public static final ErrorCode JOB_CONFIG_FACTORY_CLASS_NOT_FOUND = new ErrorCode(2003,"defined configuration factory class could not be found"); ! public static final ErrorCode MISSING_PROPS_XML_CONFIG_FACTORY = new ErrorCode(2003,"required properties are missing in xml config factory configuration"); ! public static final ErrorCode UNABLE_TO_LOAD_XML_JOB_CONFIG_FILE = new ErrorCode(2004,"configured xml job configuration file cannot be loaded"); ! public static final ErrorCode INVALID_JOB_CONFIG_FILE_FORMAT = new ErrorCode(2005,"xml job configuration file is not in a valid format"); } |
From: Suresh <sur...@us...> - 2006-03-07 03:42:28
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19304 Added Files: ConfigurationExceptionTest.java FrameworkConfigTest.java Log Message: no message --- NEW FILE: FrameworkConfigTest.java --- /* * FrameworkConfigTest.java * JUnit based test * * Created on March 5, 2006, 4:24 PM */ package org.jmonks.batchserver.framework.config; import junit.framework.*; import java.util.Map; import org.w3c.dom.Element; /** * Test cases to test the FrameworkConfig class. * * @author Suresh Pragada */ public class FrameworkConfigTest extends TestCase { public FrameworkConfigTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(FrameworkConfigTest.class); return suite; } /** * Test that FrameworkConfig cannot be instantiated. */ public void testInstantiation() { try { FrameworkConfig frameworkConfig=(FrameworkConfig)FrameworkConfig.class.newInstance(); fail("FrameworkConfig should not be instantiated."); } catch(InstantiationException ex) { /** * This is expected as FrameworkConfig cannot be instantiated. */ } catch(IllegalAccessException ex) { /** * This is expected as the constructor of FrameworkConfig is private. */ } } /** * Test that make sure getInstance never returns null object. */ public void testGetInstance() { FrameworkConfig config=FrameworkConfig.getInstance(); assertNotNull(config); System.out.println(config); } /** * Test that job-config-factory-config is configured properly in the framework-config.xml file * and it doestn return null factory class name and properties map. */ public void testGetJobConfigFactoryConfig() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); assertNotNull(factoryConfig.getJobConfigFactoryClassName()); assertNotNull(factoryConfig.getJobConfigFactoryProperties()); System.out.println(factoryConfig); } /** * Test that logging-config is configured properly in the framework-config.xml file and * make sure it defines all the required properties. */ public void testGetLoggingConfig() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.LoggingConfig loggingConfig=frameworkConfig.getLoggingConfig(); assertNotNull(loggingConfig); assertNotNull(loggingConfig.getLoggingDirecotry()); assertNotNull(loggingConfig.getFrameworkLogLevel()); assertNotNull(loggingConfig.getBasePackageName()); System.out.println(loggingConfig); } /** * Test that mgmt-mntr-config is properly configured and make sure it doesnt return null for * manager class name and properties. */ public void testGetMgmtMntrConfig() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.MgmtMntrConfig mmConfig=frameworkConfig.getMgmtMntrConfig(); assertNotNull(mmConfig); assertNotNull(mmConfig.getMgmtMntrClassName()); assertNotNull(mmConfig.getMgmtMntrProperties()); System.out.println(mmConfig); } /** * Test that repository-config is properly configured and make sure it doesnt return null * for the repository class name and properties. */ public void testGetRepositoryConfig() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.RepositoryConfig repConfig=frameworkConfig.getRepositoryConfig(); assertNotNull(repConfig); assertNotNull(repConfig.getRepositoryClassName()); assertNotNull(repConfig.getRepositoryConfigProperties()); System.out.println(repConfig); } } --- NEW FILE: ConfigurationExceptionTest.java --- /* * ConfigurationExceptionTest.java * JUnit based test * * Created on March 5, 2006, 5:14 PM */ package org.jmonks.batchserver.framework.config; import junit.framework.*; import org.jmonks.batchserver.framework.common.ErrorCode; /** * Test all the cases of Configuration Exception. * @author Suresh Pragada */ public class ConfigurationExceptionTest extends TestCase { public ConfigurationExceptionTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(ConfigurationExceptionTest.class); return suite; } /** * Test that exception is not return null for the error code. */ public void testGetErrorCode() { ConfigurationException exception=new ConfigurationException(ErrorCode.FRAMEWORK_CONFIG_FILE_NOT_FOUND); ErrorCode code=exception.getErrorCode(); assertNotNull(code); } /** * Test that exception cannot be instantiated until unless the error code has been passed. */ public void testInstantiation() { try { ConfigurationException exception=(ConfigurationException)ConfigurationException.class.newInstance(); fail("ConfigurationException should not be instantiated."); } catch(InstantiationException ex) { /** * This is expected as ConfigurationException cannot be instantiated. */ } catch(IllegalAccessException ex) { /** * This is expected as the constructor of ConfigurationException is private. */ } } } |
From: Suresh <sur...@us...> - 2006-03-07 03:42:00
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18912/config Log Message: Directory /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/config added to the repository |
From: Suresh <sur...@us...> - 2006-03-07 03:41:38
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18819 Modified Files: ErrorCodeTest.java FrameworkUtilTest.java StatusCodeTest.java Log Message: no message Index: FrameworkUtilTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common/FrameworkUtilTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FrameworkUtilTest.java 6 Mar 2006 23:54:21 -0000 1.3 --- FrameworkUtilTest.java 7 Mar 2006 03:41:35 -0000 1.4 *************** *** 43,46 **** --- 43,50 ---- } + /** + * Test to make sure method "loadPropertiesFromElementToMap" is not accepting null + * parameters as input and loading the properties as inteded. + */ public void testLoadPropertiesFromElementToMap() throws Exception { *************** *** 83,87 **** Element propertyElement2=document.createElement("property"); ! propertyElement1.setAttribute("key","config-key2"); Node textNode2=document.createCDATASection("This is CDATA section"); propertyElement2.appendChild(textNode2); --- 87,91 ---- Element propertyElement2=document.createElement("property"); ! propertyElement2.setAttribute("key","config-key2"); Node textNode2=document.createCDATASection("This is CDATA section"); propertyElement2.appendChild(textNode2); *************** *** 99,103 **** { /** ! * This is expected. */ } --- 103,107 ---- { /** ! * This is as expected. */ } *************** *** 105,110 **** FrameworkUtil.loadPropertiesFromElementToMap(configElement, propertyMap); assertEquals(2,propertyMap.size()); - System.out.println(propertyMap); - System.out.println(configElement); } --- 109,112 ---- Index: ErrorCodeTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common/ErrorCodeTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ErrorCodeTest.java 4 Mar 2006 04:20:34 -0000 1.1 --- ErrorCodeTest.java 7 Mar 2006 03:41:35 -0000 1.2 *************** *** 46,50 **** ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; int code=errorCode.getCode(); ! Assert.assertEquals(1002,code); } --- 46,50 ---- ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; int code=errorCode.getCode(); ! assertEquals(1002,code); } *************** *** 56,60 **** ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; String message=errorCode.getMessage(); ! Assert.assertNotNull(message); } --- 56,60 ---- ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; String message=errorCode.getMessage(); ! assertNotNull(message); } Index: StatusCodeTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common/StatusCodeTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusCodeTest.java 4 Mar 2006 04:20:34 -0000 1.1 --- StatusCodeTest.java 7 Mar 2006 03:41:35 -0000 1.2 *************** *** 44,48 **** StatusCode statusCode=StatusCode.SUCCESS; int code=statusCode.getCode(); ! Assert.assertEquals(0,code); } --- 44,48 ---- StatusCode statusCode=StatusCode.SUCCESS; int code=statusCode.getCode(); ! assertEquals(0,code); } |
From: Suresh <sur...@us...> - 2006-03-07 03:41:24
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18752 Modified Files: FrameworkTestSuite.java Log Message: no message Index: FrameworkTestSuite.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/FrameworkTestSuite.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrameworkTestSuite.java 4 Mar 2006 04:20:36 -0000 1.1 --- FrameworkTestSuite.java 7 Mar 2006 03:41:19 -0000 1.2 *************** *** 12,15 **** --- 12,17 ---- import org.jmonks.batchserver.framework.common.FrameworkUtilTest; import org.jmonks.batchserver.framework.common.StatusCodeTest; + import org.jmonks.batchserver.framework.config.ConfigurationExceptionTest; + import org.jmonks.batchserver.framework.config.FrameworkConfigTest; /** *************** *** 45,48 **** --- 47,52 ---- mainSuite.addTest(ErrorCodeTest.suite()); mainSuite.addTest(StatusCodeTest.suite()); + mainSuite.addTest(FrameworkConfigTest.suite()); + mainSuite.addTest(ConfigurationExceptionTest.suite()); return mainSuite; |
From: Suresh <sur...@us...> - 2006-03-06 23:54:59
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv824 Modified Files: FrameworkUtil.java Log Message: no message Index: FrameworkUtil.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/FrameworkUtil.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FrameworkUtil.java 6 Mar 2006 04:36:30 -0000 1.4 --- FrameworkUtil.java 6 Mar 2006 23:54:55 -0000 1.5 *************** *** 68,72 **** { Node propertyValueNode=propertyValueNodes.item(j); ! if(propertyValueNode.getNodeType()==Node.TEXT_NODE) { value=propertyValueNode.getNodeValue(); --- 68,73 ---- { Node propertyValueNode=propertyValueNodes.item(j); ! if(propertyValueNode.getNodeType()==Node.TEXT_NODE || ! propertyValueNode.getNodeType()==Node.CDATA_SECTION_NODE) { value=propertyValueNode.getNodeValue(); |
From: Suresh <sur...@us...> - 2006-03-06 23:54:50
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv762 Modified Files: ConfigurationException.java Log Message: no message Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConfigurationException.java 6 Mar 2006 04:36:48 -0000 1.3 --- ConfigurationException.java 6 Mar 2006 23:54:45 -0000 1.4 *************** *** 5,10 **** * <p> * Exception defines problems in either framework configuration or ! * job configuration. This is the runtime exception because problem ! * cannot be detected until the runtime. This represents the errorCode * cause of the exception. * </p> --- 5,11 ---- * <p> * Exception defines problems in either framework configuration or ! * job configuration. Configuration problems ! * cannot be detected until the runtime, so this exception will be ! * runtime exception. This will have the errorCode tells the * cause of the exception. * </p> |
From: Suresh <sur...@us...> - 2006-03-06 23:54:24
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv661 Modified Files: FrameworkUtilTest.java Log Message: no message Index: FrameworkUtilTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common/FrameworkUtilTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FrameworkUtilTest.java 4 Mar 2006 04:20:34 -0000 1.2 --- FrameworkUtilTest.java 6 Mar 2006 23:54:21 -0000 1.3 *************** *** 1,7 **** --- 1,15 ---- package org.jmonks.batchserver.framework.common; + import java.util.HashMap; + import java.util.Map; + import javax.xml.parsers.DocumentBuilder; + import javax.xml.parsers.DocumentBuilderFactory; + import javax.xml.parsers.ParserConfigurationException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + import org.w3c.dom.Node; public class FrameworkUtilTest extends TestCase *************** *** 35,38 **** --- 43,112 ---- } + public void testLoadPropertiesFromElementToMap() throws Exception + { + Element configElement=null; + Map propertyMap=null; + try + { + FrameworkUtil.loadPropertiesFromElementToMap(configElement,propertyMap); + fail("Accepting the null valuse as input parameters."); + } + catch(IllegalArgumentException exception) + { + /** + * This is as expected. + */ + } + + try + { + FrameworkUtil.loadPropertiesFromElementToMap(configElement,new HashMap()); + fail("Accepting the null element as input parameter "); + } + catch(IllegalArgumentException exception) + { + /** + * This is as expected. + */ + } + + DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder=builderFactory.newDocumentBuilder(); + Document document=documentBuilder.newDocument(); + + configElement=document.createElement("some-config"); + + Element propertyElement1=document.createElement("property"); + propertyElement1.setAttribute("key","config-key1"); + Node textNode1=document.createTextNode("config-value1"); + propertyElement1.appendChild(textNode1); + + Element propertyElement2=document.createElement("property"); + propertyElement1.setAttribute("key","config-key2"); + Node textNode2=document.createCDATASection("This is CDATA section"); + propertyElement2.appendChild(textNode2); + + configElement.appendChild(propertyElement1); + configElement.appendChild(propertyElement2); + + + try + { + FrameworkUtil.loadPropertiesFromElementToMap(configElement,propertyMap); + fail("Accepting the property map uninitialized."); + } + catch(IllegalArgumentException exception) + { + /** + * This is expected. + */ + } + propertyMap=new HashMap(); + FrameworkUtil.loadPropertiesFromElementToMap(configElement, propertyMap); + assertEquals(2,propertyMap.size()); + System.out.println(propertyMap); + System.out.println(configElement); + } + protected void tearDown() throws Exception { |
From: Suresh <sur...@us...> - 2006-03-06 04:36:52
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30624 Modified Files: ConfigurationException.java framework-config.xml FrameworkConfig.java Log Message: no message Index: framework-config.xml =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/framework-config.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** framework-config.xml 3 Mar 2006 04:14:11 -0000 1.2 --- framework-config.xml 6 Mar 2006 04:36:48 -0000 1.3 *************** *** 1,4 **** <framework-config> ! <job-config-factory-config config-reader-class-name="org.jmonks.batchserver.framework.config.xml.XMLJobConfigFactory"> <property key="config-file-absolute-location">/batchserver/config/batch-config.xml</property> <!-- --- 1,4 ---- <framework-config> ! <job-config-factory-config job-config-factory-class-name="org.jmonks.batchserver.framework.config.xml.XMLJobConfigFactory"> <property key="config-file-absolute-location">/batchserver/config/batch-config.xml</property> <!-- Index: FrameworkConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/FrameworkConfig.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FrameworkConfig.java 4 Mar 2006 04:40:49 -0000 1.2 --- FrameworkConfig.java 6 Mar 2006 04:36:48 -0000 1.3 *************** *** 11,70 **** package org.jmonks.batchserver.framework.config; import java.util.Map; import org.w3c.dom.Element; /** ! * ! * @author Suresh Pragada */ public final class FrameworkConfig { ! private static final FrameworkConfig mFrameworkConfig=new FrameworkConfig(); private static final String FRAMEWORK_CONFIG_FILE = "org.jmonks.batchserver.framework.config.framework-config.xml"; ! /** Creates a new instance of FrameworkConfig */ ! private FrameworkConfig() { } public static FrameworkConfig getInstance() { ! return mFrameworkConfig; } public JobConfigFactoryConfig getJobConfigFactoryConfig() { ! return null; } public LoggingConfig getLoggingConfig() { ! return null; } ! public MgmtMntrConfig getMgmtMntrConfig() { ! return null; } ! public FrameworkConfig.RepositoryConfig getRepositoryConfig() { ! return null; } public class JobConfigFactoryConfig { private JobConfigFactoryConfig(Element jobConfigFactoryElement) { ! } ! public String getJobConfigFactoryClassName() { return null; } ! public Map getJobConfigFactoryProperties() { --- 11,273 ---- package org.jmonks.batchserver.framework.config; + import java.io.IOException; + import java.io.InputStream; + import java.util.HashMap; import java.util.Map; + import javax.xml.parsers.DocumentBuilder; + import javax.xml.parsers.DocumentBuilderFactory; + import javax.xml.parsers.ParserConfigurationException; + import org.jmonks.batchserver.framework.common.ErrorCode; + import org.jmonks.batchserver.framework.common.FrameworkUtil; + import org.w3c.dom.Document; import org.w3c.dom.Element; + import org.w3c.dom.NodeList; + import org.xml.sax.SAXException; /** ! * <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 located in the class path org.jmonks.batchserver.framework.config. ! * </p> ! * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public final class FrameworkConfig { ! /** ! * FrameworkConfig singleton instance varaible. ! */ ! private static final FrameworkConfig frameworkConfig=new FrameworkConfig(); + /** + * Declaration of XML file holds the framework configuration. + */ private static final String FRAMEWORK_CONFIG_FILE = "org.jmonks.batchserver.framework.config.framework-config.xml"; ! /** ! * JobConfigFactoryConfig variable to hold the JobConfigFactoryObject object. ! */ ! private JobConfigFactoryConfig configFactoryConfig=null; ! /** ! * LoggingConfig variable to hold the LoggingConfig object. ! */ ! private LoggingConfig logginConfig=null; ! /** ! * MgmtMntrConfig variable to hold the MgmtMntrConfig object. ! */ ! private MgmtMntrConfig mgmtMntrConfig=null; ! /** ! * RepositoryConfig variable to hold the RepositoryConfig object. ! */ ! private RepositoryConfig repositoryConfig=null; ! ! /** ! * Private constructor to make sure FrameworkCongi cannot be instantiated. This will ! * read the framework configuration file and create the instances of of JobConfigFactoryConfig, ! * LoggingConfig, MgmtMntrConfig 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. ! */ ! private FrameworkConfig() { + try + { + InputStream configFileStream=FrameworkConfig.class.getResourceAsStream(FrameworkConfig.FRAMEWORK_CONFIG_FILE); + if(configFileStream==null) + throw new ConfigurationException(ErrorCode.FRAMEWORK_CONFIG_FILE_NOT_FOUND); + + DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance(); + documentBuilderFactory.setValidating(true); + DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder(); + Document document=documentBuilder.parse(configFileStream); + Element frameworkConfigElement=document.getDocumentElement(); + + NodeList jobConfigFactoryConfigNodeList=frameworkConfigElement.getElementsByTagName(JobConfigFactoryConfig.TAG_NAME); + if(jobConfigFactoryConfigNodeList.getLength()==1) + { + this.configFactoryConfig=new JobConfigFactoryConfig(((Element)jobConfigFactoryConfigNodeList.item(0))); + } + else + { + throw new ConfigurationException(ErrorCode.NONE_OR_MULITPLE_JOB_CONFIG_FACTORY_CONFIG_TAGS); + } + + NodeList loggingConfigNodeList=frameworkConfigElement.getElementsByTagName(LoggingConfig.TAG_NAME); + if(loggingConfigNodeList.getLength()==1) + { + this.logginConfig=new LoggingConfig(((Element)loggingConfigNodeList.item(0))); + } + else + { + throw new ConfigurationException(ErrorCode.NONE_OR_MULITPLE_LOGGING_CONFIG_TAGS); + } + + NodeList mgmtMntrConfigNodeList=frameworkConfigElement.getElementsByTagName(MgmtMntrConfig.TAG_NAME); + if(mgmtMntrConfigNodeList.getLength()==1) + { + this.mgmtMntrConfig=new MgmtMntrConfig(((Element)mgmtMntrConfigNodeList.item(0))); + } + else + { + throw new ConfigurationException(ErrorCode.NONE_OR_MULITPLE_MGMT_MNTR_CONFIG_TAGS); + } + + NodeList repositoryConfigNodeList=frameworkConfigElement.getElementsByTagName(RepositoryConfig.TAG_NAME); + if(repositoryConfigNodeList.getLength()==1) + { + this.repositoryConfig=new RepositoryConfig(((Element)repositoryConfigNodeList.item(0))); + } + else + { + throw new ConfigurationException(ErrorCode.NONE_OR_MULITPLE_REPOSITORY_CONFIG_TAGS); + } + } + catch(IOException ioException) + { + ioException.printStackTrace(); + throw new RuntimeException(ioException); + } + catch(ParserConfigurationException parserConfigException) + { + parserConfigException.printStackTrace(); + throw new RuntimeException(parserConfigException); + } + catch(SAXException saxException) + { + saxException.printStackTrace(); + throw new RuntimeException(saxException); + } } + /** + * Returns the FrameworkConfig instance. + * + * @return Returns the frameworkconfig instance. + */ public static FrameworkConfig getInstance() { ! return frameworkConfig; } + /** + * Returns the job configuration factory configuration defined in framework configuration + * as JobConfigFactoryConfig object. + * + * @return Returns the JobConfigFactoryConfig object. + */ public JobConfigFactoryConfig getJobConfigFactoryConfig() { ! return this.configFactoryConfig; } + /** + * Returns the logging configuration defined in the framework configuration as a LoggingConfig object. + * + * @return Returns the LoggingConfig object. + */ public LoggingConfig getLoggingConfig() { ! return this.logginConfig; } ! /** ! * Returns the mgmt&mntr configuration defines in the framework configuration as MgmtMntrConfig object. ! * @return Returns the MgmtMntrConfig object. ! */ public MgmtMntrConfig getMgmtMntrConfig() { ! return this.mgmtMntrConfig; } ! /** ! * Returns the repository configuration defined in framework configuration as a RepositoryConfig object. ! * ! * @return Returns the RepositoryConfig object. ! */ ! public RepositoryConfig getRepositoryConfig() { ! return this.repositoryConfig; } + /** + * <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 + * and its supported property information. + * </p> + * <p> + * This class will be accessible to all the classes in the framework and can be created + * only by the FrameworkConfig class. + * </p> + * <p> + * Holds the following configuration defined in the framework configuration file. + * <br><br> + * <pre> + * <job-config-factory-config job-config-factory-class-name="org.jmonks.batchserver.framework.config.xml.XMLJobConfigFactory"> + * <property key="config-file-absolute-location">/batchserver/config/batch-config.xml</property> + * <!-- + * Following is the another way to configure the XML Job configuration. + * <property key="config-file-classpath-location">org.jmonks.batchserver.framework.config.batch-config.xml</property> + * --> + * </job-config-factory-config> + * </pre> + * </p> + */ public class JobConfigFactoryConfig { + /** + * 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"; + + /** + * Job config factory class name. + */ + private String factoryClassName=null; + + private Map jobConfigFactoryProperties=new HashMap(); + + /** + * This constructor will read the job configuration factory information from + * the given DOM element which represents the tag <job-config-factory-config>. + * Private constructor to make sure, it cannot be instantiated from outside of FrameworkConfig class. + * + * @param jobConfigFactoryElement DOM Element represents <job-config-factory-config> tag in framework configuration file. + */ private JobConfigFactoryConfig(Element jobConfigFactoryElement) { ! this.factoryClassName=jobConfigFactoryElement.getAttribute(JobConfigFactoryConfig.FACTORY_CLASS_ATTRIBUTE_NAME); ! if(this.factoryClassName==null) ! throw new ConfigurationException(ErrorCode.JOB_CONFIG_FACTORY_CLASS_NAME_ATTRIB_NOT_FOUND); ! ! FrameworkUtil.loadPropertiesFromElementToMap(jobConfigFactoryElement,jobConfigFactoryProperties); } ! ! /** ! * Returns the class name of the factory used to read the job configuration. ! * @return Returns the factory class name. ! */ public String getJobConfigFactoryClassName() { return null; } ! ! /** ! * Returns the properties map used by the factory class to read the job configuration. ! * @returns Returns properties in a map. In case if there are no properties, it returns empty map. It doesnt return null. ! */ public Map getJobConfigFactoryProperties() { *************** *** 73,93 **** } public class LoggingConfig { private LoggingConfig(Element loggingConfigElement) { - } public String getLoggingDirecotry() { return null; } ! ! public int getFrameworkLogLevel() { ! return 1; } public String getBasePackageName() { --- 276,343 ---- } + /** + * <p> + * LoggingConfig 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 and base package name to be used to create the + * logging handlers. This class can be accessed by all the classes in the framework + * but cannot be instantiated outside of this class. + * </p> + * <p> + * This class represents the following information for the framework configration file + * <br><br> + * <pre> + * <logging-config> + * <logging-directory>/batchserver/logs</logging-directory> + * <logging-level>DEBUG</logging-level> + * <job-base-package-name>com.mycompany.batch</job-base-package-name> + * </logging-config> + * </pre> + * </p> + */ public class LoggingConfig { + /** + * Tag name represents the logging config in framework configuration file. + */ + private static final String TAG_NAME = "logging-config"; + + /** + * This constructor will read the logging configuration from + * the given DOM element which represents the tag <logging-config>. + * Private constructor to make sure, it cannot be instantiated from outside of FrameworkConfig class. + * + * @param loggingConfigElement DOM Element represents <logging-config> tag in framework configuration file. + */ private LoggingConfig(Element loggingConfigElement) { } + /** + * Returns the logging directory name, where to all the job logs needs to be written. + * + * @return Returns the logging directory name. + */ public String getLoggingDirecotry() { return null; } ! ! /** ! * Returns the log level to use for the logging. ! * ! * @return Returns the log level. ! */ ! public String getFrameworkLogLevel() { ! return null; } + /** + * Returns the base package name to be used for the logging. This base package is job + * base package like com.mycompany.batch + * + * @return Returns the jobs base package name. + */ public String getBasePackageName() { *************** *** 96,111 **** } public class MgmtMntrConfig { private MgmtMntrConfig(Element mgmtMntrConfigElement) { } ! public String getMgmtMntrClassName() { return null; } ! public Map getMgmtMntrProperties() { --- 346,398 ---- } + /** + * <p> + * MgmtMntrConfig class holds the configuration required to create the MgmtMntrManager for this + * framework. This configuration defines the specialized manager name and properties required + * by that manager. This class cannot be instantiated by any other classes outside this framework. + * </p> + * <p> + * This class holds the following configuration from the framework configuration file. + * <br><br> + * <pre> + * <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.DefaultMgmtMntrManager"> + * <property key="port-range">15000-20000</property> + * </mgmt-mntr-config> + * </pre> + * </p> + */ public class MgmtMntrConfig { + /** + * Tag name represents the mgmt mntr config in framework configuration file. + */ + private static final String TAG_NAME = "mgmt-mntr-config"; + + /** + * This constructor loads the MgmtMntrConfig object with the given + * DOM Element represents the <mgmt-mntr-config> in the framework configuration file. + * + * @param mgmtMntrConfigElement DOM Element represents the <mgmt-mntr-config> tag in framework configuration file. + */ private MgmtMntrConfig(Element mgmtMntrConfigElement) { } ! ! /** ! * Returns the defined MgmtMntrManager class name for the framework. ! * ! * @return Returns the MgmtMntrManager class name. ! */ public String getMgmtMntrClassName() { return null; } ! ! /** ! * Returns the map consist of the properties needed by the defined manager. ! * ! * @return Returns the properties in a map. ! */ public Map getMgmtMntrProperties() { *************** *** 114,123 **** } public class RepositoryConfig { private RepositoryConfig(Element repositoryConfigElement) { } ! public String getRepositoryClassName() { --- 401,446 ---- } + + /** + * <p> + * RepositoryConfig class holds the configuration required to create the class + * provides the interface to the framework repository and properties needed + * to work with the repository. + * </p> + * <p> + * This class represents the following configuration from framework configuration file. + * <br><br> + * <pre> + * <repository-config repository-class-name="org.jmonks.batchserver.framework.DefaultRepository"> + * <property key="repository-location">/batchserver/repository</property> + * <property key="repository-filename">batchserver_repository.db</property> + * </repository-config> + * </pre> + * </p> + */ public class RepositoryConfig { + /** + * Tag name represents the repository config in framework configuration file. + */ + private static final String TAG_NAME = "repository-config"; + + /** + * This constructor would read the configuration from the given DOM Element represents + * the <repository-config> tag and creates + * the object with that information. Private constructor to make sure, this class cannot + * be instantiated from outside of this class. + * + * @param repositoryConfigElement DOM Element repsents the <repository-config> tag in framework configuration. + */ private RepositoryConfig(Element repositoryConfigElement) { } ! ! /** ! * Returns the repository class name responsible to work with the repository. ! * ! * @return Returns the repository class name. ! **/ public String getRepositoryClassName() { *************** *** 125,128 **** --- 448,456 ---- } + /** + * Returns all the properties required by the repository class to interact with the repsoitory in a map. + * + * @return Returns the properties required by repository class in a map. + */ public Map getRepositoryConfigProperties() { Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigurationException.java 4 Mar 2006 04:40:49 -0000 1.2 --- ConfigurationException.java 6 Mar 2006 04:36:48 -0000 1.3 *************** *** 3,19 **** /** ! * @author Suresh Pragada ! * */ ! public class ConfigurationException extends Exception { ! private ErrorCode errorCode=null; /** ! * Constructs an instance of <code>ConfigurationException</code> with the specified detail message. ! * @param msg the detail message. ! * */ ! public ConfigurationException(org.jmonks.batchserver.framework.common.ErrorCode errorCode) { super(errorCode.getMessage()); --- 3,28 ---- /** ! * <p> ! * Exception defines problems in either framework configuration or ! * job configuration. This is the runtime exception because problem ! * cannot be detected until the runtime. This represents the errorCode ! * cause of the exception. ! * </p> ! * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ ! public class ConfigurationException extends RuntimeException { ! /** ! * Error code represents the cause of this exception. ! */ private ErrorCode errorCode=null; /** ! * Constructs an instance of <code>ConfigurationException</code> with the specified error code. ! * @param errorCode Error code represents the cause of the exception. */ ! public ConfigurationException(ErrorCode errorCode) { super(errorCode.getMessage()); *************** *** 21,29 **** } ! public org.jmonks.batchserver.framework.common.ErrorCode getErrorCode() ! { return this.errorCode; } } --- 30,57 ---- } ! /** ! * Returns the error code represents the cause of this exception. ! * ! * @return Returns the error code. ! */ ! public ErrorCode getErrorCode() { return this.errorCode; } + /** + * <p> + * Returns the string representation of ConfigurationException class in the format + * <br> {ConfigurationException [errorCode = value]} + * </p> + * + * @return Returns the string representation of ConfigurationException. + */ + public String toString() + { + StringBuffer stringValue=new StringBuffer("{ConfigurationException "); + stringValue.append("[code = " + this.errorCode.toString() + "]"); + stringValue.append("}"); + return stringValue.toString(); + } } |
From: Suresh <sur...@us...> - 2006-03-06 04:36:33
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30574 Modified Files: ErrorCode.java FrameworkUtil.java Log Message: no message Index: FrameworkUtil.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/FrameworkUtil.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FrameworkUtil.java 4 Mar 2006 04:40:28 -0000 1.3 --- FrameworkUtil.java 6 Mar 2006 04:36:30 -0000 1.4 *************** *** 1,4 **** --- 1,9 ---- package org.jmonks.batchserver.framework.common; + import java.util.Map; + import org.w3c.dom.Element; + import org.w3c.dom.Node; + import org.w3c.dom.NodeList; + /** *************** *** 27,29 **** --- 32,79 ---- */ } + + /** + * <p> + * Loads the property elements exists in the given element to the given map. + * This looks for the <property> elements in the given element and looks + * for the value of "key" attribute and the values of <property> element + * and load them as key values pairs. + * </p> + * <p> + * Property elements should be in the following format.<br><br> + * <property key="some-config-key1">some-config-value1</property> + * </p> + * + * @param configElement DOM Element consists of <property> elements. + * @param propertyMap Map to be loaded with property key values. + * + * @throws IllegalArgumentException If either configElement or propertyMap is null. + */ + public static void loadPropertiesFromElementToMap(Element configElement,Map propertyMap) + { + if(configElement==null) + throw new IllegalArgumentException("Input configuration element configElement cannot be null"); + + if(propertyMap==null) + throw new IllegalArgumentException("Input properties map propertyMap cannot be null"); + + NodeList propertyElements=configElement.getElementsByTagName("property"); + for(int i=0;i<propertyElements.getLength();i++) + { + Element propertyElement=(Element)propertyElements.item(i); + String key=propertyElement.getAttribute("key"); + String value=""; + NodeList propertyValueNodes=propertyElement.getChildNodes(); + for(int j=0;j<propertyValueNodes.getLength();j++) + { + Node propertyValueNode=propertyValueNodes.item(j); + if(propertyValueNode.getNodeType()==Node.TEXT_NODE) + { + value=propertyValueNode.getNodeValue(); + break; + } + } + propertyMap.put(key,value); + } + } } \ No newline at end of file Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/ErrorCode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ErrorCode.java 4 Mar 2006 04:40:28 -0000 1.2 --- ErrorCode.java 6 Mar 2006 04:36:30 -0000 1.3 *************** *** 15,26 **** public final class ErrorCode { - - public final static ErrorCode JOBNAME_KEY_NOT_FOUND = new ErrorCode(1001,"job-name key not found in the startup properties"); - public final static ErrorCode JOB_NOT_CONFIGURED = new ErrorCode(1002,"job is not configured in the job configuration file"); - public final static ErrorCode INVALID_CONFIG_FACTORY = new ErrorCode(1003,"not a valid configuration factory"); - public final static ErrorCode MISSING_PROPS_XML_CONFIG_FACTORY = new ErrorCode(1004,"required properties are missing in xml config factory configuration"); - public final static ErrorCode UNABLE_TO_LOAD_XML_JOB_CONFIG_FILE = new ErrorCode(1005,"configured xml job configuration file cannot be loaded"); - public final static ErrorCode INVALID_JOB_CONFIG_FILE_FORMAT = new ErrorCode(1006,"xml job configuration file is not in a valid format"); - /** * Code represents the error. --- 15,18 ---- *************** *** 85,87 **** --- 77,99 ---- return stringValue.toString(); } + + /** + * Framework Configuration Error Codes. + */ + public final static ErrorCode JOBNAME_KEY_NOT_FOUND = new ErrorCode(1001,"job-name key not found in the startup properties"); + public final static ErrorCode FRAMEWORK_CONFIG_FILE_NOT_FOUND = new ErrorCode(1002,"framework configuration file framework-config.xml is not found in the classpath"); + public final static ErrorCode NONE_OR_MULITPLE_JOB_CONFIG_FACTORY_CONFIG_TAGS = new ErrorCode(1003,"None or multiple job-config-factory-config tag(s) in framework configuration"); + public final static ErrorCode NONE_OR_MULITPLE_LOGGING_CONFIG_TAGS = new ErrorCode(1004,"None or multiple logging-config tag(s) in framework configuration"); + public final static ErrorCode NONE_OR_MULITPLE_MGMT_MNTR_CONFIG_TAGS = new ErrorCode(1005,"None or multiple mgmt-mntr-config tag(s) in framework configuration"); + public final static ErrorCode NONE_OR_MULITPLE_REPOSITORY_CONFIG_TAGS = new ErrorCode(1006,"None or multiple repository-config tag(s) in framework configuration"); + public static final ErrorCode JOB_CONFIG_FACTORY_CLASS_NAME_ATTRIB_NOT_FOUND = new ErrorCode(1007,"Attribute job-config-factory-class-name not found in job-config-factory-config element"); + /** + * Job Configuration Error Codes. + */ + public final static ErrorCode JOB_NOT_CONFIGURED = new ErrorCode(2001,"job is not configured in the job configuration source"); + public final static ErrorCode INVALID_JOB_CONFIG_FACTORY = new ErrorCode(2002,"not a valid configuration factory"); + public final static ErrorCode MISSING_PROPS_XML_CONFIG_FACTORY = new ErrorCode(2003,"required properties are missing in xml config factory configuration"); + public final static ErrorCode UNABLE_TO_LOAD_XML_JOB_CONFIG_FILE = new ErrorCode(2004,"configured xml job configuration file cannot be loaded"); + public final static ErrorCode INVALID_JOB_CONFIG_FILE_FORMAT = new ErrorCode(2005,"xml job configuration file is not in a valid format"); + } |
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26032 Modified Files: DefaultRepository.java JobContext.java JobStatistics.java LoggingManager.java Main.java Repository.java Log Message: no message Index: JobContext.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobContext.java 4 Mar 2006 04:35:08 -0000 1.1 --- JobContext.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 9,14 **** * to repsoitory. * </p> ! * @author : Suresh Pragada * @version 1.0 */ public class JobContext --- 9,15 ---- * to repsoitory. * </p> ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public class JobContext *************** *** 25,29 **** { ! return null; } --- 26,31 ---- { ! return null; ! } *************** *** 38,42 **** { ! return null; } --- 40,45 ---- { ! return null; ! } Index: JobStatistics.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobStatistics.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobStatistics.java 4 Mar 2006 04:35:08 -0000 1.1 --- JobStatistics.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 6,11 **** * This represents all the statistics related to the job. * ! * @author : Suresh Pragada * @version 1.0 */ public class JobStatistics --- 6,12 ---- * This represents all the statistics related to the job. * ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public class JobStatistics Index: LoggingManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/LoggingManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoggingManager.java 4 Mar 2006 04:35:08 -0000 1.1 --- LoggingManager.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 4,8 **** /** * <p> ! * This class provides the logging services to the framework. * It defines the default logging mechanism at the framework level * which works for all the jobs and provide the facility to --- 4,8 ---- /** * <p> ! * Logging Manager provides the logging services to the framework. * It defines the default logging mechanism at the framework level * which works for all the jobs and provide the facility to *************** *** 22,27 **** * configuration file. * </p> ! * @author : Suresh Pragada * @version 1.0 */ public class LoggingManager { --- 22,28 ---- * configuration file. * </p> ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public class LoggingManager { Index: Repository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Repository.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Repository.java 4 Mar 2006 04:35:08 -0000 1.1 --- Repository.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 6,10 **** /** * <p> ! * This interface provides utility methods to access and use the repository. * There could be differnt implementations of the repository. Framework * configuration defines which implementation should be used for this framework. --- 6,10 ---- /** * <p> ! * Repository provides utility methods to access and use the repository. * There could be differnt implementations of the repository. Framework * configuration defines which implementation should be used for this framework. *************** *** 13,18 **** * information between framework and server. * </p> ! * @author : Suresh Pragada * @version 1.0 */ public abstract class Repository --- 13,19 ---- * information between framework and server. * </p> ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public abstract class Repository Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.java 4 Mar 2006 04:35:08 -0000 1.1 --- Main.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 10,18 **** /** * <p> ! * This class is the interface to the batch framework. ! * This provides the methods accept the information to identify the job and kick off. * 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 these two methods available in {@link #main(String[])} and {@link #process(Map)} methods of this class. - * <br><br> * </p> * --- 10,17 ---- /** * <p> ! * Main class is the interface to the batch framework. ! * This provides the methods to accept the information to identify the job and kick off the jobs. * 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 these two methods available in {@link #main(String[])} and {@link #process(Map)} methods of this class. * </p> * Index: DefaultRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/DefaultRepository.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultRepository.java 4 Mar 2006 04:35:08 -0000 1.1 --- DefaultRepository.java 4 Mar 2006 04:48:52 -0000 1.2 *************** *** 16,21 **** * * </p> ! * @author : Suresh Pragada * @version 1.0 */ public abstract class DefaultRepository extends Repository --- 16,22 ---- * * </p> ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public abstract class DefaultRepository extends Repository |
From: Suresh <sur...@us...> - 2006-03-04 04:42:32
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23309 Modified Files: DefaultMgmtMntrManager.java MgmtMntrManager.java Log Message: no message Index: MgmtMntrManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/MgmtMntrManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MgmtMntrManager.java 3 Mar 2006 04:19:56 -0000 1.1 --- MgmtMntrManager.java 4 Mar 2006 04:42:28 -0000 1.2 *************** *** 20,24 **** private JobManagerMBean mJobManager; ! private MgmtMntrManager() { } --- 20,24 ---- private JobManagerMBean mJobManager; ! protected MgmtMntrManager() { } *************** *** 40,44 **** * @return Returns the MgmtMntrManager implemenation. */ ! public static org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager getMgmtMntrManager(String jobName, org.jmonks.batchserver.framework.config.MgmtMntrConfig config) --- 40,44 ---- * @return Returns the MgmtMntrManager implemenation. */ ! public static org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager getMgmtMntrManager(String jobName, org.jmonks.batchserver.framework.config.FrameworkConfig.MgmtMntrConfig config) *************** *** 63,67 **** { ! return null; } --- 63,88 ---- { ! return null; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! } *************** *** 87,91 **** { ! return null; } --- 108,113 ---- { ! return null; ! } Index: DefaultMgmtMntrManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/DefaultMgmtMntrManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultMgmtMntrManager.java 3 Mar 2006 04:19:56 -0000 1.1 --- DefaultMgmtMntrManager.java 4 Mar 2006 04:42:28 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.jmonks.batchserver.framework.mgmtmntr; + import org.jmonks.batchserver.framework.config.FrameworkConfig; + /** *************** *** 12,17 **** public class DefaultMgmtMntrManager extends MgmtMntrManager { ! public DefaultMgmtMntrManager(FrameworkConfig$MgmtMntrConfig config) { } --- 14,20 ---- public class DefaultMgmtMntrManager extends MgmtMntrManager { ! protected DefaultMgmtMntrManager(FrameworkConfig.MgmtMntrConfig config) { + } |
From: Suresh <sur...@us...> - 2006-03-04 04:42:14
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22982 Modified Files: AbstractPoolJobLoader.java AbstractPoolJobProcessor.java CollectionJobPool.java DefaultCollectionJobPool.java JobPool.java OrderedCollectionJobPool.java PoolJobController.java PoolJobLoader.java PoolJobProcessor.java Log Message: no message Index: PoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobLoader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PoolJobLoader.java 3 Mar 2006 04:19:56 -0000 1.1 --- PoolJobLoader.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,4 **** package org.jmonks.batchserver.framework.controller.pool; ! import org.jmonks.batchserver.framework.config.*; /** --- 1,4 ---- package org.jmonks.batchserver.framework.controller.pool; ! import java.util.Map; /** *************** *** 10,15 **** public interface PoolJobLoader { - public void initialize(org.jmonks.batchserver.framework.controller.pool.JobPool pool, org.jmonks.batchserver.framework.config.PoolJobLoaderConfig config); - public void cleanup(); --- 10,13 ---- Index: JobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/JobPool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobPool.java 3 Mar 2006 04:19:56 -0000 1.1 --- JobPool.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,5 **** package org.jmonks.batchserver.framework.controller.pool; ! ! import org.jmonks.batchserver.framework.config.*; /** --- 1,4 ---- package org.jmonks.batchserver.framework.controller.pool; ! import java.util.Map; /** *************** *** 17,21 **** public Object getNextJobData(); ! public void initialize(org.jmonks.batchserver.framework.config.JobPoolConfig config); public void cleanup(); --- 16,20 ---- public Object getNextJobData(); ! public void initialize(Map configProps); public void cleanup(); Index: AbstractPoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobProcessor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractPoolJobProcessor.java 3 Mar 2006 04:19:56 -0000 1.1 --- AbstractPoolJobProcessor.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,8 **** package org.jmonks.batchserver.framework.controller.pool; ! ! import org.jmonks.batchserver.framework.*; ! import org.jmonks.batchserver.framework.config.*; ! import org.jmonks.batchserver.framework.controller.pool; ! import org.jmonks.batchserver.framework.controller.pool; --- 1,4 ---- package org.jmonks.batchserver.framework.controller.pool; ! import java.util.Map; *************** *** 23,27 **** } ! public abstract void initialize(org.jmonks.batchserver.framework.config.PoolJobProcessorConfig config); public boolean suspend() --- 19,23 ---- } ! public abstract void initialize(Map configProps); public boolean suspend() *************** *** 40,46 **** } - public void initialize(org.jmonks.batchserver.framework.controller.pool.JobPool pool, org.jmonks.batchserver.framework.config.PoolJobProcessorConfig config) - { - } public abstract void cleanup(); --- 36,39 ---- Index: PoolJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobProcessor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PoolJobProcessor.java 3 Mar 2006 04:19:56 -0000 1.1 --- PoolJobProcessor.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.jmonks.batchserver.framework.controller.pool; + import java.util.Map; + /** * Processor is the one which processes the job data. This interface defines the responsiblities of the job processor. *************** *** 15,20 **** public boolean stop(); - public void initialize(org.jmonks.batchserver.framework.controller.pool.JobPool pool, org.jmonks.batchserver.framework.config.PoolJobProcessorConfig config); - public void cleanup(); --- 17,20 ---- Index: DefaultCollectionJobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/DefaultCollectionJobPool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultCollectionJobPool.java 3 Mar 2006 04:19:56 -0000 1.1 --- DefaultCollectionJobPool.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.jmonks.batchserver.framework.controller.pool; + import java.util.List; + /** * <p> Index: AbstractPoolJobLoader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/AbstractPoolJobLoader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractPoolJobLoader.java 3 Mar 2006 04:19:56 -0000 1.1 --- AbstractPoolJobLoader.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,6 **** package org.jmonks.batchserver.framework.controller.pool; - import org.jmonks.batchserver.framework.config.*; - import org.jmonks.batchserver.framework.controller.pool; --- 1,5 ---- package org.jmonks.batchserver.framework.controller.pool; + import java.util.Map; *************** *** 22,30 **** public abstract int loadJobData(); ! public abstract void initialize(org.jmonks.batchserver.framework.config.PoolJobLoaderConfig config); public abstract Object getNextLoadableJobData(); ! public void initialize(org.jmonks.batchserver.framework.controller.pool.JobPool pool, org.jmonks.batchserver.framework.config.PoolJobLoaderConfig config) { } --- 21,29 ---- public abstract int loadJobData(); ! public abstract void initialize(Map configProps); public abstract Object getNextLoadableJobData(); ! public void initialize(Map configProps,org.jmonks.batchserver.framework.controller.pool.JobPool pool) { } *************** *** 58,64 **** return null; } - - public void initialize(Map configProps, org.jmonks.batchserver.framework.controller.pool.JobPool pool) - { - } } --- 57,59 ---- Index: OrderedCollectionJobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/OrderedCollectionJobPool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OrderedCollectionJobPool.java 3 Mar 2006 04:19:56 -0000 1.1 --- OrderedCollectionJobPool.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.jmonks.batchserver.framework.controller.pool; + import java.util.List; + /** Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PoolJobController.java 3 Mar 2006 04:19:56 -0000 1.1 --- PoolJobController.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,8 **** package org.jmonks.batchserver.framework.controller.pool; ! import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.controller.JobController; ! import org.jmonks.batchserver.framework.controller.*; ! import org.jmonks.batchserver.framework.mgmtmntr.*; ! import org.jmonks.batchserver.framework.common.*; --- 1,6 ---- package org.jmonks.batchserver.framework.controller.pool; ! import org.jmonks.batchserver.framework.config.JobControllerConfig; import org.jmonks.batchserver.framework.controller.JobController; ! *************** *** 52,55 **** --- 50,54 ---- public PoolJobController(JobControllerConfig config) { + } *************** *** 57,61 **** { ! return null; } --- 56,61 ---- { ! return null; ! } *************** *** 70,74 **** { ! return 0; } --- 70,77 ---- { ! return 0; ! ! ! } *************** *** 82,86 **** { ! return 0; } --- 85,91 ---- { ! return 0; ! ! } *************** *** 90,98 **** * @return Returns the number of threads controller created to process this job. */ ! public String getThreadIDList() { ! return null; } --- 95,105 ---- * @return Returns the number of threads controller created to process this job. */ ! public java.lang.String[] getThreadIDList() { ! return null; ! ! } *************** *** 107,111 **** { ! return null; } --- 114,120 ---- { ! return null; ! ! } *************** *** 119,123 **** { ! return null; } --- 128,134 ---- { ! return null; ! ! } *************** *** 128,132 **** { ! return true; } --- 139,144 ---- { ! return true; ! } *************** *** 139,143 **** { ! return true; } --- 151,156 ---- { ! return true; ! } *************** *** 150,154 **** { ! return true; } --- 163,168 ---- { ! return true; ! } Index: CollectionJobPool.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/CollectionJobPool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CollectionJobPool.java 3 Mar 2006 04:19:56 -0000 1.1 --- CollectionJobPool.java 4 Mar 2006 04:42:01 -0000 1.2 *************** *** 1,4 **** --- 1,7 ---- package org.jmonks.batchserver.framework.controller.pool; + import java.util.List; + import java.util.Map; + /** * <p> *************** *** 27,31 **** } ! public void initialize(org.jmonks.batchserver.framework.config.JobPoolConfig config) { } --- 30,34 ---- } ! public void initialize(Map configProps) { } |
From: Suresh <sur...@us...> - 2006-03-04 04:41:47
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22878 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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicJobProcessor.java 3 Mar 2006 04:19:56 -0000 1.1 --- BasicJobProcessor.java 4 Mar 2006 04:41:42 -0000 1.2 *************** *** 1,5 **** package org.jmonks.batchserver.framework.controller.basic; ! import org.jmonks.batchserver.framework.config.BasicJobProcessorConfig; ! import org.jmonks.batchserver.framework.common.*; /** --- 1,4 ---- package org.jmonks.batchserver.framework.controller.basic; ! import java.util.Map; /** *************** *** 19,23 **** public boolean stop(); ! public void initialize(BasicJobProcessorConfig Unnamed); public org.jmonks.batchserver.framework.common.StatusCode process(); --- 18,22 ---- public boolean stop(); ! public void initialize(Map configProps); public org.jmonks.batchserver.framework.common.StatusCode process(); Index: BasicJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicJobController.java 3 Mar 2006 04:19:56 -0000 1.1 --- BasicJobController.java 4 Mar 2006 04:41:42 -0000 1.2 *************** *** 22,26 **** { ! return null; } --- 22,27 ---- { ! return null; ! } *************** *** 35,39 **** { ! return 0; } --- 36,43 ---- { ! return 0; ! ! ! } *************** *** 45,49 **** { ! return 0; } --- 49,55 ---- { ! return 0; ! ! } *************** *** 51,59 **** * Returns the thread count. */ ! public String getThreadIDList() ! { ! return null; } --- 57,66 ---- * Returns the thread count. */ ! public java.lang.String[] getThreadIDList() { ! return null; ! ! } *************** *** 65,69 **** { ! return null; } --- 72,78 ---- { ! return null; ! ! } *************** *** 75,79 **** { ! return null; } --- 84,90 ---- { ! return null; ! ! } *************** *** 84,88 **** { ! return true; } --- 95,100 ---- { ! return true; ! } *************** *** 93,97 **** { ! return true; } --- 105,110 ---- { ! return true; ! } *************** *** 102,106 **** { ! return true; } --- 115,120 ---- { ! return true; ! } |
From: Suresh <sur...@us...> - 2006-03-04 04:41:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22790 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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobController.java 3 Mar 2006 04:19:57 -0000 1.1 --- JobController.java 4 Mar 2006 04:41:19 -0000 1.2 *************** *** 3,8 **** import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.mgmtmntr.JobMonitorMBean; - import org.jmonks.batchserver.framework.mgmtmntr; - import org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.mgmtmntr.*; import org.jmonks.batchserver.framework.common.*; --- 3,6 ---- *************** *** 21,25 **** private Main mMain; ! private JobController() { } --- 19,23 ---- private Main mMain; ! protected JobController() { } *************** *** 35,39 **** * </p> */ ! public static org.jmonks.batchserver.framework.controller.JobController getJobController(String jobName, org.jmonks.batchserver.framework.config.ControllerConfig config) --- 33,37 ---- * </p> */ ! public static org.jmonks.batchserver.framework.controller.JobController getJobController(String jobName, org.jmonks.batchserver.framework.config.JobControllerConfig config) *************** *** 54,58 **** { ! return null; } --- 52,72 ---- { ! return null; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! } *************** *** 62,70 **** * @return Returns the controller configuration object. */ ! public ControllerConfig getControllerConfig() { ! return mControllerConfig; } --- 76,85 ---- * @return Returns the controller configuration object. */ ! public JobControllerConfig getControllerConfig() { ! return null; ! } *************** *** 84,88 **** { ! return null; } --- 99,104 ---- { ! return null; ! } |
From: Suresh <sur...@us...> - 2006-03-04 04:40:57
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22466 Modified Files: ConfigurationException.java FrameworkConfig.java JobConfig.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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobConfig.java 3 Mar 2006 04:19:56 -0000 1.1 --- JobConfig.java 4 Mar 2006 04:40:49 -0000 1.2 *************** *** 22,25 **** --- 22,27 ---- protected Object mJobControllerConfig=null; + + private JobControllerConfig mJobControllerConfig1; public Object getJobControllerConfig() Index: FrameworkConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/FrameworkConfig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrameworkConfig.java 3 Mar 2006 04:19:56 -0000 1.1 --- FrameworkConfig.java 4 Mar 2006 04:40:49 -0000 1.2 *************** *** 50,54 **** } ! public FrameworkConfig$RepositoryConfig getRepositoryConfig() { return null; --- 50,54 ---- } ! public FrameworkConfig.RepositoryConfig getRepositoryConfig() { return null; Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConfigurationException.java 4 Mar 2006 00:50:57 -0000 1.1 --- ConfigurationException.java 4 Mar 2006 04:40:49 -0000 1.2 *************** *** 1,14 **** package org.jmonks.batchserver.framework.config; ! /* ! * ConfigurationException.java ! * ! * Created on March 2, 2006, 8:01 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. ! */ ! ! import org.jmonks.batchserver.framework.*; /** --- 1,4 ---- package org.jmonks.batchserver.framework.config; ! import org.jmonks.batchserver.framework.common.ErrorCode; /** *************** *** 19,23 **** { ! /** * Constructs an instance of <code>ConfigurationException</code> with the specified detail message. --- 9,13 ---- { ! private ErrorCode errorCode=null; /** * Constructs an instance of <code>ConfigurationException</code> with the specified detail message. *************** *** 27,31 **** public ConfigurationException(org.jmonks.batchserver.framework.common.ErrorCode errorCode) { ! super(msg); } --- 17,22 ---- public ConfigurationException(org.jmonks.batchserver.framework.common.ErrorCode errorCode) { ! super(errorCode.getMessage()); ! this.errorCode=errorCode; } *************** *** 33,37 **** { ! return null; } --- 24,28 ---- { ! return this.errorCode; } |
From: Suresh <sur...@us...> - 2006-03-04 04:40:33
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22365 Modified Files: ErrorCode.java FrameworkUtil.java StatusCode.java Log Message: no message Index: FrameworkUtil.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/FrameworkUtil.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FrameworkUtil.java 3 Mar 2006 04:19:56 -0000 1.2 --- FrameworkUtil.java 4 Mar 2006 04:40:28 -0000 1.3 *************** *** 3,27 **** /** ! * FramworkUtil contains utility methods required in the framework. * <p> * Note : This class does not maintain any state. Keep all the methods as static and make * sure taken appropriate steps in case of that method is accessed by mulitple threads. * ! * @author Suresh Pragada */ public final class FrameworkUtil { ! ! private FrameworkUtil() ! { ! /** ! * Just to make sure this class will not be instantiated. ! */ ! } ! ! public static void printMessage(String message) ! { ! System.out.println(message); ! } } \ No newline at end of file --- 3,29 ---- /** ! * <p> ! * FramworkUtil contains utility methods required by the framework. ! * </p> * <p> * Note : This class does not maintain any state. Keep all the methods as static and make * sure taken appropriate steps in case of that method is accessed by mulitple threads. + * </p> * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public final class FrameworkUtil { ! /** ! * Private constructor to make sure it will not be instantiated. ! */ ! private FrameworkUtil() ! { ! /** ! * Just to make sure this class will not be instantiated. ! */ ! } } \ No newline at end of file Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/ErrorCode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ErrorCode.java 3 Mar 2006 04:19:56 -0000 1.1 --- ErrorCode.java 4 Mar 2006 04:40:28 -0000 1.2 *************** *** 1,43 **** package org.jmonks.batchserver.framework.common; - import java.util.HashMap; - import java.util.Map; - /** * <p> ! * This class declares all the error codes framework can return and provides some utilities on method converting the error codes to string messages. * </p> * ! * @author : Suresh Pragada */ ! public class ErrorCode { - public static final int CONFIG_ERROR_JOB_NAME_NOT_EXIST = 1001; - - private static Map errorMessages=null; ! public static ErrorCode JOBNAME_NOT_EXISTS = new ErrorCode(1,""); ! static ! { ! errorMessages=new HashMap(); ! errorMessages.put(new Integer(ErrorCode.CONFIG_ERROR_JOB_NAME_NOT_EXIST), "Configurion is missing job-name parameter or key in config parameters or config map."); ! } private ErrorCode(int errorCode, String errorMsg) { } public int getCode() - { ! return 0; } public String getMessage() - { ! return null; } } --- 1,87 ---- package org.jmonks.batchserver.framework.common; /** * <p> ! * The ErrorCode represents the error condition can generate in the system ! * and holds code and message. This is like a enum class to make sure ! * the error codes being passed around the application are valid (defined). ! * No instances of this class can be created from outside and cannot be instantiated. * </p> * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ ! public final class ErrorCode { ! public final static ErrorCode JOBNAME_KEY_NOT_FOUND = new ErrorCode(1001,"job-name key not found in the startup properties"); ! public final static ErrorCode JOB_NOT_CONFIGURED = new ErrorCode(1002,"job is not configured in the job configuration file"); ! public final static ErrorCode INVALID_CONFIG_FACTORY = new ErrorCode(1003,"not a valid configuration factory"); ! public final static ErrorCode MISSING_PROPS_XML_CONFIG_FACTORY = new ErrorCode(1004,"required properties are missing in xml config factory configuration"); ! public final static ErrorCode UNABLE_TO_LOAD_XML_JOB_CONFIG_FILE = new ErrorCode(1005,"configured xml job configuration file cannot be loaded"); ! public final static ErrorCode INVALID_JOB_CONFIG_FILE_FORMAT = new ErrorCode(1006,"xml job configuration file is not in a valid format"); ! ! /** ! * Code represents the error. ! */ ! private int code; ! /** ! * Message illustrates the error code. ! */ ! private String message=null; + /** + * <p> + * Private constructor make sure no instances will be created of this class + * from outside of this class. + * </p> + * + * @param errorCode Code represents the error. + * @param errorMsg Message illustrates the error code. + */ private ErrorCode(int errorCode, String errorMsg) { + this.code=errorCode; + this.message=errorMsg; } + /** + * Returns the code represents the error. + * + * @return Returns the code represents the error. + */ public int getCode() { ! return this.code; ! } + /** + * Returns the message illustrates the error code. + * + * @return Returns the error message. + */ public String getMessage() { ! return this.message; } + /** + * <p> + * Returns the string representation of ErrorCode class in the format + * <br> {ErrorCode [code = value] [message = value]} + * </p> + * + * @return Returns the string representation of ErrorCode. + */ + public String toString() + { + StringBuffer stringValue=new StringBuffer("{ErrorCode "); + stringValue.append("[code = " + this.code + "]"); + stringValue.append("[message = " + this.message + "]"); + stringValue.append("}"); + return stringValue.toString(); + } } Index: StatusCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/StatusCode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusCode.java 3 Mar 2006 04:19:56 -0000 1.1 --- StatusCode.java 4 Mar 2006 04:40:28 -0000 1.2 *************** *** 1,20 **** package org.jmonks.batchserver.framework.common; ! public class StatusCode { private int code; ! public static StatusCode SUCCESS = new StatusCode(1); ! ! public static StatusCode FAILURE = new StatusCode(-1); private StatusCode(int statusCode) { } public int getCode() { ! return 0; } } --- 1,69 ---- package org.jmonks.batchserver.framework.common; ! /** ! * <p> ! * The StatusCode represents the possible status of the processed in the system and holds ! * the code represents the status. This is like a status enum to make sure the proper (defined) ! * status is being passed/returned around the system. No instances of this status code can ! * be created from outside of this class. ! * </p> ! * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 ! */ ! public final class StatusCode { + /** + * Represents the code of the status. + */ private int code; ! public final static StatusCode SUCCESS = new StatusCode(0); ! public final static StatusCode FAILURE = new StatusCode(1); ! ! /** ! * <p> ! * Private construction will make sure no instances of this class can be ! * created outside of this class. ! * </p> ! * ! * @param statusCode code repesents the status. ! */ private StatusCode(int statusCode) { + this.code=statusCode; } + /** + * <p> + * Returns the code represents the status. Defined status codes are + * <br> + * <br>SUCCESS - 0 + * <br>FAILURE - 1 + * </p> + * + * @return Returns the code represents the status. + */ public int getCode() + { + return this.code; + } + /** + * <p> + * Returns the string representation of StatusCode class in the format + * <br> {StatusCode [code = value]} + * </p> + * + * @return Returns the string representation of StatusCode. + */ + public String toString() { ! StringBuffer stringValue=new StringBuffer("{StatusCode "); ! stringValue.append("[code = " + this.code + "]"); ! stringValue.append("}"); ! return stringValue.toString(); } } |
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19729 Added Files: DefaultRepository.java JobContext.java JobStatistics.java LoggingManager.java Main.java Repository.java Log Message: no message --- NEW FILE: JobContext.java --- package org.jmonks.batchserver.framework; import org.jmonks.batchserver.framework.config.*; /** * <p> * This class provides the interface to access various resources outside the framework. * This allows to access the framework configuration and get the reference * to repsoitory. * </p> * @author : Suresh Pragada * @version 1.0 */ public class JobContext { private static JobContext context = new JobContext(); private Repository mRepository; private JobContext() { } public static org.jmonks.batchserver.framework.JobContext getInstance() { return null; } /** * Gets the repository configured for this framework. It it cannot locate * the repository or cannot access the repository, it returns null. * * @return Returns the repository configured for this framework, null, if * it cannot access the repository. */ public org.jmonks.batchserver.framework.Repository getReposiotry() { return null; } /** * Gets the framework configuration. * * @return Gets the framework configuration, null, if it cannot locate * the framework-config.xml file. */ public FrameworkConfig getFrameworkConfig() { return null; } } --- NEW FILE: JobStatistics.java --- package org.jmonks.batchserver.framework; import java.util.Date; /** * This represents all the statistics related to the job. * * @author : Suresh Pragada * @version 1.0 */ public class JobStatistics { private Date startTime; private Date endTime; private int recordsProcessed; private int maxMemoryUsage; private String jobName; public JobStatistics() { } /** * Sets the startime of the job. * * @param startTime Starting time of the job. */ public void setStartTime(Date startTime) { } /** * Sets the endtime of the job. * * @param endTime Ending time of the job. */ public void setEndTime(Date endTime) { this.endTime = endTime; } /** * Sets the number of the records processed in this job. * * @param recordCount Sets the number of records got processed. */ public void setRecordsProcessed(int recordCount) { this.recordsProcessed = recordCount; } /** * Sets the maximum memory used for the job. * * @param memoryUsaeg Sets the memory usage by the job. */ public void setMaxMemeoryUsage(int memoryUsage) { } /** * Gets the start time of this job. * * @return Returns the starting time of this job. */ public Date getStartTime() { return startTime; } /** * Gets the ending time of this job. * * @return Gets the end time of this job. */ public Date getEndTime() { return endTime; } /** * Gets the number of records processed. * * @return Returns the number of records got processed. */ public int getRecordsProcessed() { return recordsProcessed; } /** * Gets the maximum memory used by this job. * * @return Returns the max memory used by this job. */ public int getMaxMemoryUsage() { return maxMemoryUsage; } /** * Gets the job name * * @return Returns the name of this job. */ public String getJobname() { return null; } /** * Sets the name of the job. * * @param jobName Name of the job. */ public void setJobname(String jobName) { } } --- NEW FILE: LoggingManager.java --- package org.jmonks.batchserver.framework; import org.jmonks.batchserver.framework.config.*; /** * <p> * This class provides the logging services to the framework. * It defines the default logging mechanism at the framework level * 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-directory> 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-config> in batch * configuration file. * </p> * @author : Suresh Pragada * @version 1.0 */ public class LoggingManager { private static LoggingManager loggingManager = new LoggingManager(); private LoggingManager() { } public static LoggingManager getInstance() { return null; } /** * <p> * This method accepts all the information available from framwork configuration * and job configuration and loads the required loggers appropriately. If jobLoggingConfig * is null, it uses frameworkLoggingConfig to initialize the logging. * * @param jobName Name of the job. * @param frameworkLoggingConfig Logging configuration defined at the framework. * @param jobLogginConfig Logging configuration defined at the job. * </p> */ public void initializeLogging(String jobName, org.jmonks.batchserver.framework.config.FrameworkConfig.LoggingConfig loggingConfig) { } } --- NEW FILE: Repository.java --- package org.jmonks.batchserver.framework; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.controller.*; /** * <p> * This interface provides utility methods to access and use the repository. * There could be differnt implementations of the repository. Framework * configuration defines which implementation should be used for this framework. * This povides utility methods to logs the job statistics and persist any objects, * transfer some information between the jobs and transfer some management and monitor * information between framework and server. * </p> * @author : Suresh Pragada * @version 1.0 */ public abstract class Repository { protected Repository() { } public static void getRepository(org.jmonks.batchserver.framework.config.FrameworkConfig.RepositoryConfig config) { } /** * This method logs the job statistics given in the form JobStatistics object * in the repository for further use. * * @param statistics Job Statistics object which holds all the statistics related to that job. * * @return Returns true if statistics can be logged, false, otherwise. */ public abstract boolean logStatistics(org.jmonks.batchserver.framework.JobStatistics statistics); /** * Given data will be sent to the specified job behalf of this job. * * @param srcJN Name of the source job. * @param srcCmp Name of the source componenet. * @param tgtJN Name of the target job. * @param tgtCmp Name of the target component. * @param data data that needs to be sent as the object. * * @return Returns true, if it could save the data to be sent to the next job. */ public abstract boolean sendDatatoNextJob(String srcJN, String srcCmp, String tgtJN, String tgtCmp, Object data); /** * Gets the data that has been sent to this job. * * @param srcJN Name of the source job. * @param srcCmp Name of the source componenet. * @param tgtJN Name of the target job. * @param tgtCmp Name of the target component. * * @return Returns the data, null, it it couldnt find any data. */ public abstract Object getDataFromPreviousJob(String srcJN, String srcCmp, String tgtJN, String tgtCmp); /** * Registers the job management and monitoring info with the given job name. * * @param jobName Name of the job. * @param registrationInfo Information to be associated with this job name. * * @return Return true, if it could assosciate this information, false, otherwise. */ public abstract boolean registerJobMgmtMntrInfo(String jobName, Object registrationInfo); /** * Retrieves the management and monitoring information assosciated with this job. * * @param jobName Name of the job. * * @return Returns the registered information, null, if it doesnt find any information. */ public abstract Object lookupJobMgmtMntrInfo(String jobName); /** * Unregisters the job management and monitoring info assosciated with the given job name. * * @param jobName Name of the job. * * @return Return true, it it could unregister the information, false, otherwise. */ public abstract boolean unregisterJobMgmtMntrInfo(String jobName); /** * Gets the statistics related to that given job as a JobStatistics object array. * * @param jobName Name of the job for which statistics are required. * @return Returns the array of JobStatistics object, null, if it couldnt find any job with that name. */ public abstract org.jmonks.batchserver.framework.JobStatistics[] getStatistics(String jobName); /** * Persist the controller in repository. This will be useful, when job wants to be restarted. * When controller receives stop signal from servier with restart flag, it persist itself into * the repository. * * @param jobName Name of the job * @param controller Controller object to be persisted. * * @return Returns true, if it could persist the controller, false, otherwise. */ public abstract boolean saveController(org.jmonks.batchserver.framework.controller.JobController controller, String jobName); /** * Loads the controller assosicated with this job name in the repsoitory. When controller starts * execution, always, it looks into the reposiotry for restart. This can be overriden by passing addition * configuration property. * * @param jobName Name of the job. * @return Returns the controller object, null, if it couldnt find any. */ public abstract org.jmonks.batchserver.framework.controller.JobController loadController(String jobName); /** * Releases the persistedcontroller object from repository. * * @param jobName Name of the job. * @return Returns true, if it could release the controller from repository, null, otherwise. */ public abstract boolean releaseController(String jobName); } --- NEW FILE: Main.java --- package org.jmonks.batchserver.framework; import java.util.HashMap; import java.util.Map; import org.jmonks.batchserver.framework.mgmtmntr.*; import org.jmonks.batchserver.framework.common.*; /** * <p> * This class is the interface to the batch framework. * This provides the methods accept the information to identify the job and kick off. * 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 these two methods available in {@link #main(String[])} and {@link #process(Map)} methods of this class. * <br><br> * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class Main { private MgmtMntrManager mMgmtMntrManager; public 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 job-name key available. * <br><br> * <pre> * import org.jmonks.batchserver.framework.Main; * import java.util.Map; * import java.util.HashMap(); * * Map configMap=new HashMap(); * configMap.put("job-name","process_file_abc"); * configMap.put("config-name1","config-value1"); * configMap.put("config-name2","config-value2"); * Main main=new Main(); * int errorCode=main.process(configMap); * System.out.println("Job exited with return code : " + errorCode); * </pre> * <br><br> * Whatever the configuration key values passed here will override the values defined in job configuration. * </p> * <br> * @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. */ public org.jmonks.batchserver.framework.common.StatusCode process(Map configMap) { return null; } /** * <p> * This method provides the interface to execute the jobs from command line. This accepts the job name/job config and additional configuration information relate to this job as a command line parameters. Each parameter passed through line should be in the format name=value. Among these, either "jobname=xxxxxx" or "jobconfig=xxxxxxxxx" should exist. If these two passed in the parameters, job will exit with error. If job is invoking in independent mode through this method, the return value will be return as exit code. So, exit should be considered as return value. * </p> * <p> * The format to invoke the job using this interface is as follows. <br> * java org.jmonks.batchserver.framework.Main job-name=process_file_abc config-name1=config-value1 config-name2=config-value2 * <br><br> * java org.jmonks.batchserver.framework.Main job-name=<job-config>...</job-config> 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> * @param args Configuration details in command line params as name=value format * */ public static void main(String args[]) { Map configMap=new HashMap(); /** * parse command line parameters and populate the map. **/ Main main=new Main(); StatusCode statusCode=main.process(configMap); System.exit(statusCode.getCode()); } } --- NEW FILE: DefaultRepository.java --- package org.jmonks.batchserver.framework; /** * <p> * This implementation of repository uses the DB4O database as the repository. It expects the following two properties present in the repository configuration in framework-cofig.xml file. * <br><br> * <pre> * <repository-config repository-class-name="org.jmonks.batchserver.framework.DefaultRepository"> * <property key="repository-location">/batchserver/repository</property> * <property key="repository-filename">batchserver_repository.db</property> * </repository-config> * </pre> * <br><br> * Here repository-location defines where the DB4O database needs to be created and repository-filename defines the name of the file to be used as the repository. * * </p> * @author : Suresh Pragada * @version 1.0 */ public abstract class DefaultRepository extends Repository { private DefaultRepository(java.util.Map configProps) { } /** * @see org.jmonks.batchserver.framework.Repository#logStatistics(org.jmonks.batchserver.framework.JobStatistics) */ public boolean logStatistics(org.jmonks.batchserver.framework.JobStatistics statistics) { return true; } /** * @see org.jmonks.batchserver.framework.Repository#sendDataToNextJob(String,String,String,String,Object) */ public boolean sendDatatoNextJob(String srcJN, String srcCmp, String tgtJN, String tgtCmp, Object data) { return true; } /** * @see org.jmonks.batchserver.framework.Repository#getDataFromPreviousJob(String,String,String,String) */ public Object getDataFromPreviousJob(String srcJN, String srcCmp, String tgtJN, String tgtCmp) { return null; } /** * @see org.jmonks.batchserver.framework.Repository#registerJobMgmtMntrInfo(String,Object) */ public boolean registerJobMgmtMntrInfo(String jobName, Object registrationInfo) { return true; } /** * @see org.jmonks.batchserver.framework.Repository#lookupJobMgmtMntrInfo(String) */ public Object lookupJobMgmtMntrInfo(String jobName) { return null; } /** * @see org.jmonks.batchserver.framework.Repository#unregisterJobMgmtMntrInfo(String) */ public boolean unregisterJobMgmtMntrInfo(String jobName) { return true; } /** * @see org.jmonks.batchserver.framework.Repository#getStatistics(String) */ public org.jmonks.batchserver.framework.JobStatistics[] getStatistics(String jobName) { return null; } /** * @see org.jmonks.batchserver.framework.Repository#saveController(org.jmonks.batchserver.framework.controller.JobController,String) */ public boolean saveController(org.jmonks.batchserver.framework.controller.JobController controller, String jobName) { return true; } /** * @see org.jmonks.batchserver.framework.Repository#loadController(String) */ public org.jmonks.batchserver.framework.controller.JobController loadController(String jobName) { return null; } /** * @see org.jmonks.batchserver.framework.Repository#releaseController(String) */ public boolean releaseController(String jobName) { return true; } /** * <p> * This is the inner class in the DefaultRepository class to hold the data being transferred between the jobs. This will not have any functionality except holding the data. * </p> * @author : Suresh Pragada * @version 1.0 */ public class JobDataTransfer { private String sourceJobName; private String sourceComponentName; private Object data; private int targetJobName; private int targetComponentName; public JobDataTransfer() { } } } |
From: Suresh <sur...@us...> - 2006-03-04 04:20:40
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11196/org/jmonks/batchserver/framework/common Modified Files: FrameworkUtilTest.java Added Files: ErrorCodeTest.java StatusCodeTest.java Log Message: submitting the junits for ErrorCode, StatusCode and FrameworkUtil Index: FrameworkUtilTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/common/FrameworkUtilTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrameworkUtilTest.java 1 Feb 2006 05:05:38 -0000 1.1 --- FrameworkUtilTest.java 4 Mar 2006 04:20:34 -0000 1.2 *************** *** 1,13 **** package org.jmonks.batchserver.framework.common; import junit.framework.TestCase; public class FrameworkUtilTest extends TestCase { ! public void testPrintMessage() ! { ! FrameworkUtil.printMessage("This is testing printMessage method"); ! } } \ No newline at end of file --- 1,54 ---- package org.jmonks.batchserver.framework.common; + import junit.framework.Test; import junit.framework.TestCase; + import junit.framework.TestSuite; public class FrameworkUtilTest extends TestCase { + public FrameworkUtilTest(String testName) + { + super(testName); + } + /** + * Test case to check that FrameworkUtil cannot be instantiated. + */ + public void testInstantiation() + { + try + { + FrameworkUtil utility=(FrameworkUtil)FrameworkUtil.class.newInstance(); + fail("FrameworkUtil should not be instantiated."); + } + catch(InstantiationException ex) + { + /** + * This is expected as Frameworkutil cannot be instantiated. + */ + } + catch(IllegalAccessException ex) + { + /** + * This is expected as the constructor of FrameworkUtil is private. + */ + } + } ! protected void tearDown() throws Exception ! { ! ! super.tearDown(); ! } ! ! protected void setUp() throws Exception ! { ! ! super.setUp(); ! } + public static Test suite() + { + TestSuite suite=new TestSuite(FrameworkUtilTest.class); + return suite; + } } \ No newline at end of file --- NEW FILE: ErrorCodeTest.java --- /* * ErrorCodeTest.java * JUnit based test * * Created on March 3, 2006, 8:12 PM */ package org.jmonks.batchserver.framework.common; import junit.framework.*; /** * Test cases to test the ErrorCode.java. * * @author Suresh Pragada */ public class ErrorCodeTest extends TestCase { public ErrorCodeTest(String testName) { super(testName); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } public static Test suite() { TestSuite suite = new TestSuite(ErrorCodeTest.class); return suite; } /** * Test that getCode is returning the expected errorCode. */ public void testGetCode() { ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; int code=errorCode.getCode(); Assert.assertEquals(1002,code); } /** * Test that getMessage is not returning null. */ public void testGetMessage() { ErrorCode errorCode=ErrorCode.JOB_NOT_CONFIGURED; String message=errorCode.getMessage(); Assert.assertNotNull(message); } /** * Test that ErrorCode cannot be instantiated. */ public void testInstantiation() { try { ErrorCode errorCode=(ErrorCode)ErrorCode.class.newInstance(); fail("ErrorCode should not be instantiated."); } catch(InstantiationException ex) { /** * This is expected as ErrorCode cannot be instantiated. */ } catch(IllegalAccessException ex) { /** * This is expected as the constructor of ErrorCode is private. */ } } } --- NEW FILE: StatusCodeTest.java --- /* * StatusCodeTest.java * JUnit based test * * Created on March 3, 2006, 8:35 PM */ package org.jmonks.batchserver.framework.common; import junit.framework.*; /** * Test cases to test the StatusCode.java. * * @author Suresh Pragada */ public class StatusCodeTest extends TestCase { public StatusCodeTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(StatusCodeTest.class); return suite; } /** * Test that getCode is returning expected values. */ public void testGetCode() { StatusCode statusCode=StatusCode.SUCCESS; int code=statusCode.getCode(); Assert.assertEquals(0,code); } /** * Test that StatusCode cannot be instantiated. */ public void testInstantiation() { try { StatusCode statusCode=(StatusCode)StatusCode.class.newInstance(); fail("StatusCode should not be instantiated."); } catch(InstantiationException ex) { /** * This is expected as StatusCode cannot be instantiated. */ } catch(IllegalAccessException ex) { /** * This is expected as the constructor of StatusCode is private. */ } } } |
From: Suresh <sur...@us...> - 2006-03-04 04:20:39
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11196/org/jmonks/batchserver/framework Added Files: FrameworkTestSuite.java Log Message: submitting the junits for ErrorCode, StatusCode and FrameworkUtil --- NEW FILE: FrameworkTestSuite.java --- /* * FrameworkTestSuite.java * JUnit based test * * Created on March 3, 2006, 8:29 PM */ package org.jmonks.batchserver.framework; import junit.framework.*; import org.jmonks.batchserver.framework.common.ErrorCodeTest; import org.jmonks.batchserver.framework.common.FrameworkUtilTest; import org.jmonks.batchserver.framework.common.StatusCodeTest; /** * This is the main suite for the framework. This actually decides which suites * needs to be considered as the framework suite. * * @author Suresh Pragada */ public class FrameworkTestSuite extends TestCase { public FrameworkTestSuite(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } /** * suite method returns all the suites to be considered as a framework suite. */ public static Test suite() { TestSuite mainSuite = new TestSuite(); mainSuite.addTest(FrameworkUtilTest.suite()); mainSuite.addTest(ErrorCodeTest.suite()); mainSuite.addTest(StatusCodeTest.suite()); return mainSuite; } } |
From: Suresh <sur...@us...> - 2006-03-04 04:16:44
|
Update of /cvsroot/batchserver/batchserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8873 Modified Files: build.xml Log Message: modified the junit targets Index: build.xml =================================================================== RCS file: /cvsroot/batchserver/batchserver/build.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** build.xml 1 Feb 2006 05:06:21 -0000 1.3 --- build.xml 4 Mar 2006 04:16:40 -0000 1.4 *************** *** 33,37 **** <path id="compile.classpath"> <!-- Include all JAR files that will be required to compile application --> - <pathelement location="${lib.home}/log4j/log4j_1.2.9.jar"/> <pathelement location="${lib.home}/xml/xml_apis.jar"/> <pathelement location="${lib.home}/xml/apache/resolver_2.7.1.jar"/> --- 33,36 ---- *************** *** 141,150 **** ! <!-- ==================== Run Test Case Target ===================================== --> ! <target name="run-test-case" depends="test-compile" description="Run Unit Test classes"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> ! <echo message="Running JUnit Test"/> ! <echo message="Classpath for run test : ${test.runtime.classpath}"/> <delete dir="${reports.home}"/> <mkdir dir="${reports.home}"/> --- 140,149 ---- ! <!-- ==================== Run Framework Test Suite Target ===================================== --> ! <target name="run-framework-test-suite" depends="test-compile" description="Run Framework Test Suite"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> ! <echo message="Running Framework Test Suite"/> ! <echo message="Classpath to run test suite : ${test.runtime.classpath}"/> <delete dir="${reports.home}"/> <mkdir dir="${reports.home}"/> *************** *** 152,167 **** <classpath refid="test.runtime.classpath"/> <!-- To generate the test reports use the below xml formatter instead of plain formmater --> ! <!-- <formatter type="xml" usefile="true"/> --> ! <formatter type="plain" usefile="false"/> ! <test name="org.jmonks.batchserver.framework.common.FrameworkUtilTest" todir="${reports.home}"/> </junit> </target> ! <!-- ==================== Run Test Suite Target ===================================== --> ! <target name="run-test-suite" depends="test-compile" description="Run Complete Unit Test Suite"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> ! <echo message="Running JUnit Test Suite"/> ! <echo message="Classpath for run test suite : ${test.runtime.classpath}"/> <delete dir="${reports.home}"/> <mkdir dir="${reports.home}"/> --- 151,166 ---- <classpath refid="test.runtime.classpath"/> <!-- To generate the test reports use the below xml formatter instead of plain formmater --> ! <formatter type="xml" usefile="true"/> ! <!-- <formatter type="plain" usefile="false"/> --> ! <test name="org.jmonks.batchserver.framework.FrameworkTestSuite" todir="${reports.home}"/> </junit> </target> ! <!-- ==================== Run All Tests Target ===================================== --> ! <target name="run-all-tests" depends="test-compile" description="Run all the tests available in project"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> ! <echo message="Running All JUnit Tests"/> ! <echo message="Classpath for run all tests : ${test.runtime.classpath}"/> <delete dir="${reports.home}"/> <mkdir dir="${reports.home}"/> *************** *** 179,183 **** <!-- ==================== JUnit Reports Format Target ===================================== --> ! <target name="run-format-test-results" depends="run-test-suite" description="Run the unittests and format the test results into html docs"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> <junitreport todir="${reports.home}"> --- 178,192 ---- <!-- ==================== JUnit Reports Format Target ===================================== --> ! <target name="run-format-framework-test-suite" depends="run-framework-test-suite" description="Run the unittests and format the test results into html docs"> ! <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> ! <junitreport todir="${reports.home}"> ! <fileset dir="${reports.home}"> ! <include name="*.xml"/> ! </fileset> ! <report format="frames" todir="${reports.home}/html"/> ! </junitreport> ! </target> ! ! <target name="run-format-all-tests-results" depends="run-all-tests" description="Run the unittests and format the test results into html docs"> <!-- Make sure you have junit jar and junit ant jar in ant lib directory --> <junitreport todir="${reports.home}"> *************** *** 210,214 **** <javadoc sourcepath="${src.home}" destdir="${docs.home}" ! packagenames="*"> <classpath refid="compile.classpath"/> </javadoc> --- 219,226 ---- <javadoc sourcepath="${src.home}" destdir="${docs.home}" ! packagenames="*" ! author="true" ! version="true" ! use="true"> <classpath refid="compile.classpath"/> </javadoc> |
From: Suresh <sur...@us...> - 2006-03-04 00:51:04
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12623 Added Files: ConfigurationException.java Log Message: no message --- NEW FILE: ConfigurationException.java --- package org.jmonks.batchserver.framework.config; /* * ConfigurationException.java * * Created on March 2, 2006, 8:01 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. */ import org.jmonks.batchserver.framework.*; /** * @author Suresh Pragada * */ public class ConfigurationException extends Exception { /** * Constructs an instance of <code>ConfigurationException</code> with the specified detail message. * @param msg the detail message. * */ public ConfigurationException(org.jmonks.batchserver.framework.common.ErrorCode errorCode) { super(msg); } public org.jmonks.batchserver.framework.common.ErrorCode getErrorCode() { return null; } } |
From: Suresh <sur...@us...> - 2006-03-03 04:20:05
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30411/common Modified Files: FrameworkUtil.java Added Files: ErrorCode.java StatusCode.java Log Message: Submitting the class skeltons Index: FrameworkUtil.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/FrameworkUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrameworkUtil.java 1 Feb 2006 05:05:38 -0000 1.1 --- FrameworkUtil.java 3 Mar 2006 04:19:56 -0000 1.2 *************** *** 1,5 **** package org.jmonks.batchserver.framework.common; - import org.apache.log4j.Logger; /** --- 1,4 ---- *************** *** 14,18 **** public final class FrameworkUtil { - private static final Logger logger=Logger.getLogger(FrameworkUtil.class); private FrameworkUtil() --- 13,16 ---- *************** *** 25,29 **** public static void printMessage(String message) { ! logger.debug(message); } } \ No newline at end of file --- 23,27 ---- public static void printMessage(String message) { ! System.out.println(message); } } \ No newline at end of file --- NEW FILE: ErrorCode.java --- package org.jmonks.batchserver.framework.common; import java.util.HashMap; import java.util.Map; /** * <p> * This class declares all the error codes framework can return and provides some utilities on method converting the error codes to string messages. * </p> * * @author : Suresh Pragada */ public class ErrorCode { public static final int CONFIG_ERROR_JOB_NAME_NOT_EXIST = 1001; private static Map errorMessages=null; public static ErrorCode JOBNAME_NOT_EXISTS = new ErrorCode(1,""); static { errorMessages=new HashMap(); errorMessages.put(new Integer(ErrorCode.CONFIG_ERROR_JOB_NAME_NOT_EXIST), "Configurion is missing job-name parameter or key in config parameters or config map."); } private ErrorCode(int errorCode, String errorMsg) { } public int getCode() { return 0; } public String getMessage() { return null; } } --- NEW FILE: StatusCode.java --- package org.jmonks.batchserver.framework.common; public class StatusCode { private int code; public static StatusCode SUCCESS = new StatusCode(1); public static StatusCode FAILURE = new StatusCode(-1); private StatusCode(int statusCode) { } public int getCode() { return 0; } } |
From: Suresh <sur...@us...> - 2006-03-03 04:20:05
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30411/mgmtmntr Added Files: DefaultMgmtMntrManager.java JobManagerMBean.java JobMonitorMBean.java JobStatus.java MgmtMntrManager.java ThreadState.java Log Message: Submitting the class skeltons --- NEW FILE: JobMonitorMBean.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.*; public interface JobMonitorMBean { /** * Gets the total number of records this job might try to process. * * @return Returns the total number of records this job might try to process. */ public int getExpectedRecordsCount(); /** * Gets the records processed by this job so far. * * @return Returns the number of records processed by this job so far. */ public int getProcessedRecordsCount(); /** * Returns the number of threads being run by this job. * * @return Returns the number of threads being run by this job. */ public String[] getThreadIDList(); /** * Gets the state of this thread. This returns the state in a ThreadState object. * * @return Returns the state of this thread. */ public org.jmonks.batchserver.framework.mgmtmntr.ThreadState getThreadState(String threadID); } --- NEW FILE: DefaultMgmtMntrManager.java --- package org.jmonks.batchserver.framework.mgmtmntr; /** * <p> * This is the concrete implementation of the MgmtMntrManager, which uses repository as the common place to save the connector server information, which will be looked up by the server. So, thiis will access the repository to save connector server information. * </p> * * @author : Suresh Pragada * @version 1.0 */ public class DefaultMgmtMntrManager extends MgmtMntrManager { public DefaultMgmtMntrManager(FrameworkConfig$MgmtMntrConfig config) { } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@registerController(org.jmonks.batchserver.framework.controller.JobController) */ public void registerController(org.jmonks.batchserver.framework.controller.JobController controller) { } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@unregisterController(int) */ public void unregisterController(org.jmonks.batchserver.framework.common.StatusCode controllerExitStatus) { } } --- NEW FILE: JobManagerMBean.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.controller.*; /** * <p> * This standard MBean, enables the controller to implementat management methods. * </p> * @author : Suresh Pragada * @versio 1.0 */ public interface JobManagerMBean { /** * Returns the status of the job. These statuses are defined as constants in JobManagerMBean. * * @return Returns the job status. */ public org.jmonks.batchserver.framework.mgmtmntr.JobStatus getJobStatus(); /** * Controller should stop its processing as soon this method call has been received. If the restart flag is true, it persist the controller to the repository. * * @param restart Tells whether job needs to be restarted or not. * * @return Returns whether job can be stopped or not. */ public boolean stop(boolean restart); /** * Controller should suspend its processing as soon as its receive this method call. * * @return Returns true, if controller can suspend the process, false otherwise. */ public boolean suspend(); /** * Controller should resume its processing as soon as it receive this method call. * * @return Returns true, if controller can resume the processing, false, otherwise. */ public boolean resume(); } --- NEW FILE: ThreadState.java --- package org.jmonks.batchserver.framework.mgmtmntr; /** * This represents the state of the thread. This gives the information like thread number, description and processing information. */ public class ThreadState { private String threadID; private String threadDescription; private Object processingInfo; public ThreadState() { } } --- NEW FILE: MgmtMntrManager.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.controller.*; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.common.*; /** * <p> * This class will define the methods needs to be implemented by the concrete classes of this manager. This provides the factory method to create the appropriate implementation based on the configuration in MgmtMntrConfig object. * </p> * @author : Suresh Pragada * @version 1.0 */ public abstract class MgmtMntrManager { private JobMonitorMBean mJobMonitor; private JobManagerMBean mJobManager; private MgmtMntrManager() { } /** * This factory method creates the correct implementation of MgmtMntrManager based on the configuration defines in framework-config.xml file. * This looks for the following configuration. * * <pre> * <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.DefaultMgmtMntrManager"> * <property key="port-range">15000-20000</property> * </mgmt-mntr-config> * * </pre> * * @param jobName Name of the job. * @param mgmtMntrConfig MgmtMntrConfig object represents the above show config block from the framework-config.xml file. * * @return Returns the MgmtMntrManager implemenation. */ public static org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager getMgmtMntrManager(String jobName, org.jmonks.batchserver.framework.config.MgmtMntrConfig config) { return null; } /** * This method creates the MBeanServer with JobManagerMBean and JobMonitorMBean beans and passes this controller references to the these mbeans and creates the connector server and saves this connector information in the common place to be looked up by server. * * @param controller Controller reference to be passed to the mbeans. */ public abstract void registerController(org.jmonks.batchserver.framework.controller.JobController controller); /** * Unregisters the controller from mbeans and shuts down the connector server and shuts down the mbean server and unregister information from common place. * * @param existStatus errorCode returned by controller to the Main class. */ public abstract void unregisterController(org.jmonks.batchserver.framework.common.StatusCode controllerExitStatus); /** * Returns the job name. * @return Returns the job name. */ public String getJobName() { return null; } } --- NEW FILE: JobStatus.java --- package org.jmonks.batchserver.framework.mgmtmntr; public class JobStatus { public static JobStatus RUNNING = new JobStatus(1); public static JobStatus SUSPENDED = new JobStatus(2); private JobStatus(int statusID) { } public int getStatusID() { return 0; } } |
From: Suresh <sur...@us...> - 2006-03-03 04:20:05
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30411/config/xml Added Files: XMLBasicJobControllerConfig.java XMLJobConfig.java XMLJobConfigFactory.java XMLJobControllerConfig.java XMLPoolJobControllerConfig.java Log Message: Submitting the class skeltons --- NEW FILE: XMLBasicJobControllerConfig.java --- /* * XMLBasicJobControllerConfig.java * * Created on March 2, 2006, 1:56 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.config.xml; import org.jmonks.batchserver.framework.config.BasicJobControllerConfig; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public class XMLBasicJobControllerConfig extends BasicJobControllerConfig { /** Creates a new instance of XMLBasicJobControllerConfig */ XMLBasicJobControllerConfig(Element controllerConfigElement) { } } --- NEW FILE: XMLPoolJobControllerConfig.java --- /* * XMLPoolJobControllerConfig.java * * Created on March 2, 2006, 1:33 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.config.xml; import org.jmonks.batchserver.framework.config.PoolJobControllerConfig; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public class XMLPoolJobControllerConfig extends PoolJobControllerConfig { /** Creates a new instance of XMLPoolJobControllerConfig */ XMLPoolJobControllerConfig(Element controllerConfigElement) { /** * Load everything defined in base class using the input element. */ } } --- NEW FILE: XMLJobControllerConfig.java --- /* * XMLJobControllerConfig.java * * Created on March 2, 2006, 1:20 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.config.xml; import org.jmonks.batchserver.framework.config.JobControllerConfig; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public abstract class XMLJobControllerConfig extends JobControllerConfig { public static JobControllerConfig getJobControllerConfig(Element controllerConfigElement) { return null; } } --- NEW FILE: XMLJobConfigFactory.java --- /* * XMLJobConfigFactory.java * * Created on March 2, 2006, 12:00 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.config.xml; import java.util.Map; import org.jmonks.batchserver.framework.config.JobConfig; import org.jmonks.batchserver.framework.config.JobConfigFactory; /** * * @author Suresh Pragada */ public class XMLJobConfigFactory extends JobConfigFactory { private Map mConfigFactoryProps=null; /** Creates a new instance of XMLJobConfigFactory */ public XMLJobConfigFactory(Map configFactoryProps) { } public JobConfig getJobConfig(String jobName) { /** * Look up XML configuration for jobName and pass that element. */ return new XMLJobConfig(null); } } --- NEW FILE: XMLJobConfig.java --- /* * XMLJobConfig.java * * Created on March 2, 2006, 11:51 AM * * 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.config.xml; import org.jmonks.batchserver.framework.config.JobConfig; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public class XMLJobConfig extends JobConfig { /** Creates a new instance of XMLJobConfig */ XMLJobConfig(Element jobConfigElement) { /** * Load the configuration properties */ } } |