batchserver-cvs Mailing List for Enterprise Batch Server (Page 20)
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-25 19:25:00
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23557 Removed Files: JobManagerMBean.java Log Message: no message --- JobManagerMBean.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-25 19:24:19
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23048 Removed Files: JobMonitorMBean.java Log Message: no message --- JobMonitorMBean.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-25 19:23:30
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22591 Removed Files: JobStatus.java Log Message: no message --- JobStatus.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-25 19:22:57
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22325 Removed Files: ThreadState.java Log Message: no message --- ThreadState.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-22 14:24:05
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26152 Added Files: JobStatusTest.java Log Message: no message --- NEW FILE: JobStatusTest.java --- /* * JobStatusTest.java * JUnit based test * * Created on March 21, 2006, 10:56 PM */ package org.jmonks.batchserver.framework.mgmtmntr; import junit.framework.*; /** * * @author Suresh Pragada */ public class JobStatusTest extends TestCase { public JobStatusTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(JobStatusTest.class); return suite; } /** * Test to make sure Job Status cannot be instantiated. */ public void testInstantiation() { try { JobStatus status=(JobStatus)JobStatus.class.newInstance(); fail("JobStatus should not be instantiated."); } catch(InstantiationException ex) { /** * This is expected as JobStatus cannot be instantiated. */ } catch(IllegalAccessException ex) { /** * This is expected as the constructor of JobStatus is private. */ } } /** * Test to make sure toString is return the correct string. */ public void testToString() { String running=JobStatus.RUNNING.toString(); assertEquals("RUNNING",running); } /** * Test to make sure equal is working properly. */ public void testEquals() { JobStatus running1=JobStatus.RUNNING; JobStatus running2=JobStatus.RUNNING; assertTrue(running1==running2); assertTrue(running1.equals(running2)); } } |
From: Suresh <sur...@us...> - 2006-03-22 14:23:17
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25742 Modified Files: RepositoryTest.java Log Message: no message Index: RepositoryTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository/RepositoryTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RepositoryTest.java 17 Mar 2006 23:32:59 -0000 1.3 --- RepositoryTest.java 22 Mar 2006 14:23:12 -0000 1.4 *************** *** 77,85 **** public void testGetRepository() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); } --- 77,81 ---- public void testGetRepository() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); } *************** *** 90,98 **** public void testLogJobStatistics() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); JobStatistics statistics=new JobStatistics("process_file_xyz"); --- 86,90 ---- public void testLogJobStatistics() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); JobStatistics statistics=new JobStatistics("process_file_xyz"); *************** *** 110,118 **** public void testGetJobStatistics() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); --- 102,106 ---- public void testGetJobStatistics() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); *************** *** 149,157 **** public void testJobDataTransfer() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); --- 137,141 ---- public void testJobDataTransfer() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); *************** *** 181,189 **** public void testJobMgmtMntrInfoHolder() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); --- 165,169 ---- public void testJobMgmtMntrInfoHolder() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); *************** *** 215,223 **** public void testJobControllerHolder() { ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! assertNotNull(frameworkConfig); ! FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); ! assertNotNull(repositoryConfig); ! Repository repository=Repository.getRepository(repositoryConfig); assertNotNull(repository); --- 195,199 ---- public void testJobControllerHolder() { ! Repository repository=Repository.getRepository(); assertNotNull(repository); |
From: Suresh <sur...@us...> - 2006-03-22 14:22:42
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25467/mgmtmntr Log Message: Directory /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/mgmtmntr added to the repository |
From: Suresh <sur...@us...> - 2006-03-22 14:21:43
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24889 Modified Files: JobContext.java Log Message: no message Index: JobContext.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JobContext.java 16 Mar 2006 05:56:31 -0000 1.3 --- JobContext.java 22 Mar 2006 14:21:31 -0000 1.4 *************** *** 14,46 **** * @since 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.Repository getReposiotry() ! { ! return null; ! } --- 14,33 ---- * @since 1.0 */ ! public final class JobContext { private JobContext() { } /** ! * Gets the repository configured for this framework. If 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 static Repository getReposiotry() { ! return Repository.getRepository(); } *************** *** 49,58 **** * * @return Gets the framework configuration, null, if it cannot locate ! * the framework-config.xml file. */ ! public FrameworkConfig getFrameworkConfig() ! { ! return null; } } --- 36,44 ---- * * @return Gets the framework configuration, null, if it cannot locate ! * the framework-config.xml file. */ ! public static FrameworkConfig getFrameworkConfig() { ! return FrameworkConfig.getInstance(); } } |
From: Suresh <sur...@us...> - 2006-03-22 14:21:13
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/mgmtmntr/jmxmp/repository Modified Files: JMXMPRepositoryMgmtMntrManager.java Log Message: no message Index: JMXMPRepositoryMgmtMntrManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository/JMXMPRepositoryMgmtMntrManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JMXMPRepositoryMgmtMntrManager.java 21 Mar 2006 04:29:14 -0000 1.1 --- JMXMPRepositoryMgmtMntrManager.java 22 Mar 2006 14:20:45 -0000 1.2 *************** *** 41,48 **** protected JMXConnectorServer connectorServer=null; /** ! * Protected constructor to make sure this class will not be instantiated directly. ! */ ! protected JMXMPRepositoryMgmtMntrManager() { } --- 41,56 ---- protected JMXConnectorServer connectorServer=null; + /** ! *<p> ! * <i> ! * Do not use this constructor to instantiate JMXMPRepositoryMgmtMntrManager directly. Use ! * the factory method getMgmtMntrManager in MgmtMntrManager class to get the mgmt and mntr manager ! * instance. This constructor has been provided to make sure this should be ! * instantiable and accessible to the MgmtMntrManager class. ! * </i> ! * </p> ! */ ! public JMXMPRepositoryMgmtMntrManager() { } *************** *** 51,55 **** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@init(java.util.Map) */ ! public void init(java.util.Map mgmtMntrManagerConfigProps) { logger.trace("Entering init") ; --- 59,63 ---- * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@init(java.util.Map) */ ! protected void init(java.util.Map mgmtMntrManagerConfigProps) { logger.trace("Entering init") ; |
From: Suresh <sur...@us...> - 2006-03-22 14:21:12
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/repository/db4o Modified Files: Db4oRepository.java Log Message: no message Index: Db4oRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oRepository.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Db4oRepository.java 21 Mar 2006 04:29:32 -0000 1.3 --- Db4oRepository.java 22 Mar 2006 14:20:45 -0000 1.4 *************** *** 54,60 **** * Db4o container object. */ ! ObjectContainer container=null; ! ! protected Db4oRepository() { } --- 54,70 ---- * Db4o container object. */ ! private ObjectContainer container=null; ! ! /** ! *<p> ! * <i> ! * Do not use this constructor to instantiate Db4oRepository directly. Use ! * the factory method getRepository in Repository class to get the repository ! * instance. This constructor has been provided to make sure this should be ! * instantiable and accessible to the Repository class. ! * </i> ! * </p> ! */ ! public Db4oRepository() { } |
From: Suresh <sur...@us...> - 2006-03-22 14:21:12
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/repository Modified Files: Repository.java Log Message: no message Index: Repository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/Repository.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Repository.java 17 Mar 2006 05:13:48 -0000 1.2 --- Repository.java 22 Mar 2006 14:20:45 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.*; + import org.jmonks.batchserver.framework.repository.db4o.Db4oRepository; *************** *** 17,21 **** * This povides utility methods to logs the job statistics and persist job controllers, * transfer some information between the jobs and transfer some management and monitor ! * information between framework and server. * </p> * <p> --- 18,24 ---- * This povides utility methods to logs the job statistics and persist job controllers, * transfer some information between the jobs and transfer some management and monitor ! * information between framework and server. Repository make sure only one instance ! * of the implementation class will be created (implements the singleton pattern) ! * and will be used through out the system/job. * </p> * <p> *************** *** 23,27 **** * This declares an abstract method init with the protected access for the repository * implementors to inititalize the repository implementation. Implementors should implement ! * this method and make sure default constructor exist to enable the initialization of * this implementation from the factory method. * </p> --- 26,30 ---- * This declares an abstract method init with the protected access for the repository * implementors to inititalize the repository implementation. Implementors should implement ! * this method and make sure constructor is exist and accessible to enable the initialization of * this implementation from the factory method. * </p> *************** *** 32,38 **** public abstract class Repository { - private static Logger logger=Logger.getLogger(Repository.class); ! /** --- 35,45 ---- public abstract class Repository { private static Logger logger=Logger.getLogger(Repository.class); ! ! /** ! * Variable to hold the singleton instance of repository implementation ! * defined in framework configuration. ! */ ! private static Repository repository=null; /** *************** *** 52,104 **** * repository configuration in framework configuration file. * - * @param repositoryConfig Repository configuration object. - * * @throws ConfigurationException If repositoryClassName is missing or invalid * or it cannot be instantiated because of the lack of mandatory properties required * by the specific repository implementations. - * @throws IllegalArgumentException If input repositoryConfig is null. */ ! public static Repository getRepository(FrameworkConfig.RepositoryConfig repositoryConfig) { logger.trace("Entering getRepository"); ! ! if(repositoryConfig==null) ! throw new IllegalArgumentException("repository configuration object cannot be null."); ! ! String repositoryClassName=repositoryConfig.getRepositoryClassName(); ! if(repositoryClassName==null || "".equals(repositoryClassName)) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "repository class name is not defined in repository configuration"); ! logger.debug("repository class name = " + repositoryClassName); ! ! Repository repository=null; ! ! try ! { ! repository=(Repository)Class.forName(repositoryClassName).newInstance(); ! repository.init(repositoryConfig.getRepositoryConfigProperties()); ! logger.debug("created the repository implemenation class"); ! ! } ! catch(ClassNotFoundException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); ! } ! catch(InstantiationException exception) { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); } ! catch(IllegalAccessException exception) { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); } ! ! logger.trace("Exiting getRepository"); ! return repository; } --- 59,114 ---- * repository configuration in framework configuration file. * * @throws ConfigurationException If repositoryClassName is missing or invalid * or it cannot be instantiated because of the lack of mandatory properties required * by the specific repository implementations. */ ! public static synchronized Repository getRepository() { logger.trace("Entering getRepository"); ! if(repository==null) { ! FrameworkConfig.RepositoryConfig repositoryConfig=FrameworkConfig.getInstance().getRepositoryConfig(); ! ! if(repositoryConfig==null) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "repository configuration is not defined in framework configuration"); ! ! String repositoryClassName=repositoryConfig.getRepositoryClassName(); ! if(repositoryClassName==null || "".equals(repositoryClassName)) ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, "repository class name is not defined in repository configuration"); ! logger.debug("repository class name = " + repositoryClassName); ! ! try ! { ! repository=(Repository)Class.forName(repositoryClassName).newInstance(); ! repository.init(repositoryConfig.getRepositoryConfigProperties()); ! logger.debug("created the repository implemenation class"); ! } ! catch(ClassNotFoundException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); ! } ! catch(InstantiationException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); ! } ! catch(IllegalAccessException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); ! } } ! else { ! /** ! * Reposiotry instance has been initialized already. ! */ } ! logger.trace("Exiting getRepository " + (repository!=null)); ! return repository; } |
From: Suresh <sur...@us...> - 2006-03-22 14:21:12
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/config/db Modified Files: DBJobConfigFactory.java Log Message: no message Index: DBJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfigFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DBJobConfigFactory.java 21 Mar 2006 04:26:51 -0000 1.8 --- DBJobConfigFactory.java 22 Mar 2006 14:20:45 -0000 1.9 *************** *** 80,84 **** private static Logger logger=Logger.getLogger(DBJobConfigFactory.class); ! protected DBJobConfigFactory() { } --- 80,94 ---- private static Logger logger=Logger.getLogger(DBJobConfigFactory.class); ! /** ! *<p> ! * <i> ! * Do not use this constructor to instantiate DBJobConfigFactory directly. Use ! * the factory method getJobConfigFactory in JobConfigFactory class to get the config factory ! * instance. This constructor has been provided to make sure this should be ! * instantiable and accessible to the JobConfigFactory class. ! * </i> ! * </p> ! */ ! public DBJobConfigFactory() { } *************** *** 94,98 **** * @throws ConfigurationException If required properties are missing. */ ! public void init(Map configFactoryProps) { logger.trace("Entering init"); --- 104,108 ---- * @throws ConfigurationException If required properties are missing. */ ! protected void init(Map configFactoryProps) { logger.trace("Entering init"); |
From: Suresh <sur...@us...> - 2006-03-22 14:21:12
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/config/xml Modified Files: XMLJobConfigFactory.java Log Message: no message Index: XMLJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobConfigFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** XMLJobConfigFactory.java 21 Mar 2006 04:27:09 -0000 1.10 --- XMLJobConfigFactory.java 22 Mar 2006 14:20:45 -0000 1.11 *************** *** 75,80 **** private static Logger logger=Logger.getLogger(XMLJobConfigFactory.class); ! ! protected XMLJobConfigFactory() { } --- 75,90 ---- private static Logger logger=Logger.getLogger(XMLJobConfigFactory.class); ! ! /** ! *<p> ! * <i> ! * Do not use this constructor to instantiate XMLJobConfigFactory directly. Use ! * the factory method getJobConfigFactory in JobConfigFactory class to get the config factory ! * instance. This constructor has been provided to make sure this should be ! * instantiable and accessible to the JobConfigFactory class. ! * </i> ! * </p> ! */ ! public XMLJobConfigFactory() { } *************** *** 89,93 **** * @throws ConfigurationException If required properties are missing. */ ! public void init(Map configFactoryProps) { logger.trace("Entering init"); --- 99,103 ---- * @throws ConfigurationException If required properties are missing. */ ! protected void init(Map configFactoryProps) { logger.trace("Entering init"); |
From: Suresh <sur...@us...> - 2006-03-22 14:21:10
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/mgmtmntr Modified Files: JobStatus.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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MgmtMntrManager.java 21 Mar 2006 04:27:48 -0000 1.4 --- MgmtMntrManager.java 22 Mar 2006 14:20:45 -0000 1.5 *************** *** 26,35 **** public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; - /** - * Name of the job this manager is configured to. - */ - private String jobName; private static Logger logger=Logger.getLogger(MgmtMntrManager.class); /** * This factory method creates the correct implementation of MgmtMntrManager --- 26,34 ---- public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; private static Logger logger=Logger.getLogger(MgmtMntrManager.class); + + private static MgmtMntrManager mgmtMntrManager=null; + /** * This factory method creates the correct implementation of MgmtMntrManager *************** *** 48,57 **** * @return Returns the MgmtMntrManager implemenation. */ ! public static MgmtMntrManager getMgmtMntrManager(String jobName, FrameworkConfig.MgmtMntrConfig mgmtMntrconfig) { ! logger.trace("Entering getMgmtMntrManager " + jobName); ! if(jobName==null) ! throw new IllegalArgumentException("job name cannot be null to get the mgmt and mntr manager"); if(mgmtMntrconfig==null) --- 47,56 ---- * @return Returns the MgmtMntrManager implemenation. */ ! public static MgmtMntrManager getMgmtMntrManager(FrameworkConfig.MgmtMntrConfig mgmtMntrconfig) { ! logger.trace("Entering getMgmtMntrManager "); ! // if(jobName==null) ! // throw new IllegalArgumentException("job name cannot be null to get the mgmt and mntr manager"); if(mgmtMntrconfig==null) *************** *** 64,68 **** mmManager=(MgmtMntrManager)Class.forName(mgmtMntrManagerClassName).newInstance(); mmManager.init(mgmtMntrconfig.getMgmtMntrProperties()); ! mmManager.jobName=jobName; } catch(ClassNotFoundException exception) --- 63,67 ---- mmManager=(MgmtMntrManager)Class.forName(mgmtMntrManagerClassName).newInstance(); mmManager.init(mgmtMntrconfig.getMgmtMntrProperties()); ! //mmManager.jobName=jobName; } catch(ClassNotFoundException exception) *************** *** 103,108 **** * 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. * --- 102,109 ---- * 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 ! * with the jobName. * + * @param jobName Name of the job the controller belongs to. * @param controller Controller reference to be passed to the mbeans. * *************** *** 111,115 **** * @throws IllegalArgumentException If input parameter controller is null. */ ! public abstract boolean registerController(JobController controller); /** --- 112,116 ---- * @throws IllegalArgumentException If input parameter controller is null. */ ! public abstract boolean registerController(String jobName,JobController controller); /** *************** *** 125,136 **** public abstract boolean unregisterController(StatusCode controllerExitStatus); - /** - * Returns the job name. - * @return Returns the job name. - */ - public String getJobName() - { - return this.jobName; - } - } --- 126,128 ---- Index: JobStatus.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/JobStatus.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobStatus.java 3 Mar 2006 04:19:56 -0000 1.1 --- JobStatus.java 22 Mar 2006 14:20:45 -0000 1.2 *************** *** 1,17 **** 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; } } --- 1,53 ---- package org.jmonks.batchserver.framework.mgmtmntr; + /** + * <p> + * JobStatus class defines the available statuses of the jobs in the system as + * enums. + * </p> + * + * @author Suresh Pragada + * @version 1.0 + * @since 1.0 + */ public class JobStatus { ! /** ! * Status indicates that job is running. ! */ ! public static JobStatus RUNNING = new JobStatus("RUNNING"); ! /** ! * Status indictes that job is suspended. ! */ ! public static JobStatus SUSPENDED = new JobStatus("SUSPENDED"); ! /** ! * Status indicates the job is stopped. ! */ ! public static JobStatus STOPPED = new JobStatus("STOPPED"); ! /** ! * Status indicates the job is resumed. ! */ ! public static JobStatus RESUMED = new JobStatus("RESUMED"); ! ! /** ! * Varaible holds the status ID. ! */ ! private String statusID; ! ! /** ! * Constructor make sure all the constants have been defined inside this ! * class and takes the status ID. ! */ ! private JobStatus(String statusID) { + this.statusID=statusID; } ! ! /** ! * Returns the job status in string format. ! */ ! public String toString() { ! return this.statusID; } } |
From: Suresh <sur...@us...> - 2006-03-21 04:29:38
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13366 Modified Files: Db4oRepository.java Log Message: no message Index: Db4oRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oRepository.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Db4oRepository.java 17 Mar 2006 05:13:25 -0000 1.2 --- Db4oRepository.java 21 Mar 2006 04:29:32 -0000 1.3 *************** *** 55,58 **** --- 55,62 ---- */ ObjectContainer container=null; + + protected Db4oRepository() + { + } /** |
From: Suresh <sur...@us...> - 2006-03-21 04:29:18
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13319 Added Files: JMXMPRepositoryMgmtMntrManager.java Log Message: no message --- NEW FILE: JMXMPRepositoryMgmtMntrManager.java --- package org.jmonks.batchserver.framework.mgmtmntr.jmxmp.repository; import java.io.IOException; import java.util.HashMap; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServerFactory; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.JobContext; import org.jmonks.batchserver.framework.common.StatusCode; import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.mgmtmntr.*; /** * <p> * This is the concrete implementation of the MgmtMntrManager, which uses framework repository * as the lookup place to exchange the connector information between the client and server. * It uses the machine the job being run as a host machine to create the connector server and * the port will be chosen automatically by the implementation. *<br> * <pre> * <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.jmxmp.repository.JMXMPRepositoryMgmtMntrManager"> * </mgmt-mntr-config> * </pre> * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JMXMPRepositoryMgmtMntrManager extends MgmtMntrManager { private static Logger logger=Logger.getLogger(JMXMPRepositoryMgmtMntrManager.class); /** * JMX Messaging Protocol URL to be used to create the connector server. */ protected static final String JMXMP_SERVICE_URL = "service:jmx:jmxmp://"; protected JMXConnectorServer connectorServer=null; /** * Protected constructor to make sure this class will not be instantiated directly. */ protected JMXMPRepositoryMgmtMntrManager() { } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@init(java.util.Map) */ public void init(java.util.Map mgmtMntrManagerConfigProps) { logger.trace("Entering init") ; /** * This implementation does not require any properties in configuration file * for lookup information. */ logger.trace("Exiting init") ; } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@registerController(org.jmonks.batchserver.framework.controller.JobController) */ public boolean registerController(JobController controller) { logger.trace("Entering registerController") ; if(controller==null) throw new IllegalArgumentException("controller cannot be null for the registration"); boolean registered=false; try { JMXServiceURL jmxServiceURL=new JMXServiceURL(JMXMPRepositoryMgmtMntrManager.JMXMP_SERVICE_URL); MBeanServer mbeanServer=MBeanServerFactory.createMBeanServer(MgmtMntrManager.MBEAN_SERVER_NAME); connectorServer=JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, new HashMap(), mbeanServer); registered=JobContext.getReposiotry().registerJobMgmtMntrInfo(this.getJobName(), jmxServiceURL.toString()); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); registered=false; } logger.trace("Exiting registerController") ; return registered; } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@unregisterController(org.jmonks.batchserver.framework.common.StatusCode) */ public boolean unregisterController(StatusCode controllerExitStatus) { logger.trace("Entering unregisterController") ; if(controllerExitStatus==null) throw new IllegalArgumentException("controller exist status code cannot be null to unregister the controller"); boolean unregistered=false; if(connectorServer!=null) { try { connectorServer.stop(); unregistered=JobContext.getReposiotry().unregisterJobMgmtMntrInfo(this.getJobName()); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); unregistered=false; } } else unregistered=false; logger.trace("Exiting unregisterController") ; return unregistered; } } |
From: Suresh <sur...@us...> - 2006-03-21 04:28:35
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13015/repository Log Message: Directory /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository added to the repository |
From: Suresh <sur...@us...> - 2006-03-21 04:28:20
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12722/jmxmp Log Message: Directory /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp added to the repository |
From: Suresh <sur...@us...> - 2006-03-21 04:27:55
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12688 Modified Files: MgmtMntrManager.java Removed Files: DefaultMgmtMntrManager.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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MgmtMntrManager.java 17 Mar 2006 05:14:47 -0000 1.3 --- MgmtMntrManager.java 21 Mar 2006 04:27:48 -0000 1.4 *************** *** 1,48 **** 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; /** ! * 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.FrameworkConfig.MgmtMntrConfig config) { ! return null; } /** * Method to initialize the MgmtMntrManager with the properties defined ! * for this manager in framework configuration file. * * @param mgmtMntrConfig Properties defined for this manager as a map. --- 1,96 ---- package org.jmonks.batchserver.framework.mgmtmntr; ! import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.common.*; + /** * <p> ! * MgmtMntrManager defines the methods to be implemented by the concrete classes ! * to register and unregister the JMX connector servers, which allows the remote ! * clients to manage and monitor the job being run. This provides the factory method ! * to create the appropriate implementation based on the configuration ! * provided in framework configuration file. * </p> ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public abstract class MgmtMntrManager ! { ! public static final String MBEAN_SERVER_NAME = "DefaultMBeanServer"; ! ! public static final String JOB_MANAGER_MBEAN_NAME = "JobManagerMBean"; ! ! public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; ! /** ! * Name of the job this manager is configured to. ! */ ! private String jobName; + private static Logger logger=Logger.getLogger(MgmtMntrManager.class); /** ! * 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. ! * <br> * <pre> ! * <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.jmxmp.repository.JMXMPRepositoryMgmtMntrManager"> ! * <property key="mgmt-mntr-config-key">mgmt-mntr-config-value</property> ! * </mgmt-mntr-config> * </pre> * ! * @param jobName Name of the job this manager is configured to manage and monitor. ! * @param mgmtMntrConfig MgmtMntrConfig object represents the above shown config block from the framework-config.xml file. * * @return Returns the MgmtMntrManager implemenation. */ ! public static MgmtMntrManager getMgmtMntrManager(String jobName, FrameworkConfig.MgmtMntrConfig mgmtMntrconfig) { ! logger.trace("Entering getMgmtMntrManager " + jobName); ! ! if(jobName==null) ! throw new IllegalArgumentException("job name cannot be null to get the mgmt and mntr manager"); ! ! if(mgmtMntrconfig==null) ! throw new ConfigurationException(ConfigurationException.MGMT_MNTR_CONFIG, "mgmt and mntr configuration object cannot be null"); ! ! String mgmtMntrManagerClassName=mgmtMntrconfig.getMgmtMntrClassName(); ! MgmtMntrManager mmManager=null; ! try ! { ! mmManager=(MgmtMntrManager)Class.forName(mgmtMntrManagerClassName).newInstance(); ! mmManager.init(mgmtMntrconfig.getMgmtMntrProperties()); ! mmManager.jobName=jobName; ! } ! catch(ClassNotFoundException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.MGMT_MNTR_CONFIG, exception.getMessage()); ! } ! catch(InstantiationException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.MGMT_MNTR_CONFIG, exception.getMessage()); ! } ! catch(IllegalAccessException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! throw new ConfigurationException(ConfigurationException.MGMT_MNTR_CONFIG, exception.getMessage()); ! } ! logger.trace("Exiting getMgmtMntrManager"); ! return mmManager; } /** * Method to initialize the MgmtMntrManager with the properties defined ! * for this manager in framework configuration file. This method is provided ! * for the implementors to initialize the manager by getting the properties ! * defined in configuration file. * * @param mgmtMntrConfig Properties defined for this manager as a map. *************** *** 50,68 **** * @throws ConfigurationException If required properties of the implementation misses. */ ! protected abstract void init(FrameworkConfig.MgmtMntrConfig mgmtMntrConfig); /** ! * 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); /** --- 98,127 ---- * @throws ConfigurationException If required properties of the implementation misses. */ ! protected abstract void init(java.util.Map mgmtMntrManagerConfigProps); /** ! * 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. + * + * @return Returns true, if controller is registered properly, false, otherwise. + * + * @throws IllegalArgumentException If input parameter controller is null. */ ! public abstract boolean registerController(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. + * + * @return Returns true, if conroller is unregistered properly, false otherwise. + * + * @throws IllegalArgumentException If input parameter status code is null. */ ! public abstract boolean unregisterController(StatusCode controllerExitStatus); /** *************** *** 72,76 **** public String getJobName() { ! return null; } --- 131,135 ---- public String getJobName() { ! return this.jobName; } --- DefaultMgmtMntrManager.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-21 04:27:16
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12509 Modified Files: XMLJobConfigFactory.java Log Message: no message Index: XMLJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/xml/XMLJobConfigFactory.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLJobConfigFactory.java 17 Mar 2006 14:04:38 -0000 1.9 --- XMLJobConfigFactory.java 21 Mar 2006 04:27:09 -0000 1.10 *************** *** 76,79 **** --- 76,83 ---- private static Logger logger=Logger.getLogger(XMLJobConfigFactory.class); + protected XMLJobConfigFactory() + { + } + /** * This method initializes the factory by accepting the required properties *************** *** 85,89 **** * @throws ConfigurationException If required properties are missing. */ ! protected void init(Map configFactoryProps) { logger.trace("Entering init"); --- 89,93 ---- * @throws ConfigurationException If required properties are missing. */ ! public void init(Map configFactoryProps) { logger.trace("Entering init"); |
From: Suresh <sur...@us...> - 2006-03-21 04:26:56
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12353 Modified Files: DBJobConfigFactory.java Log Message: no message Index: DBJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfigFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DBJobConfigFactory.java 17 Mar 2006 14:04:58 -0000 1.7 --- DBJobConfigFactory.java 21 Mar 2006 04:26:51 -0000 1.8 *************** *** 79,82 **** --- 79,86 ---- private static Logger logger=Logger.getLogger(DBJobConfigFactory.class); + + protected DBJobConfigFactory() + { + } /** *************** *** 90,94 **** * @throws ConfigurationException If required properties are missing. */ ! protected void init(Map configFactoryProps) { logger.trace("Entering init"); --- 94,98 ---- * @throws ConfigurationException If required properties are missing. */ ! public void init(Map configFactoryProps) { logger.trace("Entering init"); |
From: Suresh <sur...@us...> - 2006-03-21 04:26:43
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12285 Modified Files: ConfigurationException.java framework-config.xml 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.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** framework-config.xml 17 Mar 2006 05:14:13 -0000 1.14 --- framework-config.xml 21 Mar 2006 04:26:37 -0000 1.15 *************** *** 19,23 **** <framework-logging-config framework-logging-level="DEBUG" job-logging-directory="/batchserver/logs" job-base-package-name="com.mycompany.batch" job-logging-level="INFO"/> ! <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.DefaultMgmtMntrManager"> <property key="port-range">15000-20000</property> </mgmt-mntr-config> --- 19,23 ---- <framework-logging-config framework-logging-level="DEBUG" job-logging-directory="/batchserver/logs" job-base-package-name="com.mycompany.batch" job-logging-level="INFO"/> ! <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.jmxmp.repository.DefaultMgmtMntrManager"> <property key="port-range">15000-20000</property> </mgmt-mntr-config> Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConfigurationException.java 14 Mar 2006 23:02:19 -0000 1.6 --- ConfigurationException.java 21 Mar 2006 04:26:36 -0000 1.7 *************** *** 45,48 **** --- 45,52 ---- */ public static final String REPOSITORY_CONFIG = "repository-config"; + /** + * Constant defines the source of repository config component. + */ + public static final String MGMT_MNTR_CONFIG = "mgmt-mntr-config"; |
From: Suresh <sur...@us...> - 2006-03-17 23:33:04
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7885 Modified Files: RepositoryTest.java Log Message: no message Index: RepositoryTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository/RepositoryTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RepositoryTest.java 17 Mar 2006 22:36:39 -0000 1.2 --- RepositoryTest.java 17 Mar 2006 23:32:59 -0000 1.3 *************** *** 14,17 **** --- 14,20 ---- import org.jmonks.batchserver.framework.JobStatistics; import org.jmonks.batchserver.framework.config.*; + import org.jmonks.batchserver.framework.controller.JobController; + import org.jmonks.batchserver.framework.controller.basic.BasicJobController; + import org.jmonks.batchserver.framework.controller.pool.PoolJobController; *************** *** 39,45 **** public static Test suite() { ! //TestSuite suite = new TestSuite(RepositoryTest.class); ! TestSuite suite=new TestSuite(); ! suite.addTest(new RepositoryTest("testJobDataTransfer")); return suite; } --- 42,48 ---- public static Test suite() { ! TestSuite suite = new TestSuite(RepositoryTest.class); ! //TestSuite suite=new TestSuite(); ! //suite.addTest(new RepositoryTest("testJobControllerHolder")); return suite; } *************** *** 178,181 **** --- 181,213 ---- public void testJobMgmtMntrInfoHolder() { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); + assertNotNull(repositoryConfig); + Repository repository=Repository.getRepository(repositoryConfig); + assertNotNull(repository); + + String jobName="process_file_abc"+Calendar.getInstance().getTimeInMillis(); + + Object object=repository.lookupJobMgmtMntrInfo(jobName); + assertNull(object); + boolean unregistered=repository.unregisterJobMgmtMntrInfo(jobName); + assertFalse(unregistered); + + boolean registered=repository.registerJobMgmtMntrInfo(jobName, Calendar.getInstance()); + assertTrue(registered); + Calendar cal1=(Calendar)repository.lookupJobMgmtMntrInfo(jobName); + assertNotNull(cal1); + unregistered=repository.unregisterJobMgmtMntrInfo(jobName); + assertTrue(unregistered); + + registered=repository.registerJobMgmtMntrInfo(jobName, Calendar.getInstance()); + assertTrue(registered); + registered=repository.registerJobMgmtMntrInfo(jobName, new ArrayList()); + assertTrue(registered); + ArrayList list=(ArrayList)repository.lookupJobMgmtMntrInfo(jobName); + assertNotNull(cal1); + unregistered=repository.unregisterJobMgmtMntrInfo(jobName); + assertTrue(unregistered); } *************** *** 183,186 **** --- 215,247 ---- public void testJobControllerHolder() { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); + assertNotNull(repositoryConfig); + Repository repository=Repository.getRepository(repositoryConfig); + assertNotNull(repository); + + String jobName="process_file_abc"+Calendar.getInstance().getTimeInMillis(); + + JobController controller=repository.loadController(jobName); + assertNull(controller); + boolean released=repository.releaseController(jobName); + assertFalse(released); + + boolean saved=repository.saveController(jobName, new PoolJobController(null)); + assertTrue(saved); + controller=(JobController)repository.loadController(jobName); + assertNotNull(controller); + released=repository.releaseController(jobName); + assertTrue(released); + + saved=repository.saveController(jobName, new PoolJobController(null)); + assertTrue(saved); + saved=repository.saveController(jobName, new BasicJobController()); + assertTrue(saved); + BasicJobController basicController=(BasicJobController)repository.loadController(jobName); + assertNotNull(basicController); + released=repository.releaseController(jobName); + assertTrue(released); } |
From: Suresh <sur...@us...> - 2006-03-17 22:36:46
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15958 Modified Files: RepositoryTest.java Log Message: no message Index: RepositoryTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository/RepositoryTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RepositoryTest.java 17 Mar 2006 05:16:09 -0000 1.1 --- RepositoryTest.java 17 Mar 2006 22:36:39 -0000 1.2 *************** *** 8,18 **** package org.jmonks.batchserver.framework.repository; import junit.framework.*; ! import java.lang.reflect.Constructor; ! import java.lang.reflect.InvocationTargetException; ! import java.util.Map; ! import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.*; ! import org.jmonks.batchserver.framework.controller.JobController; --- 8,18 ---- package org.jmonks.batchserver.framework.repository; + import java.util.ArrayList; + import java.util.Calendar; + import java.util.Date; import junit.framework.*; ! import org.jmonks.batchserver.framework.JobStatistics; import org.jmonks.batchserver.framework.config.*; ! *************** *** 39,43 **** public static Test suite() { ! TestSuite suite = new TestSuite(RepositoryTest.class); return suite; } --- 39,45 ---- public static Test suite() { ! //TestSuite suite = new TestSuite(RepositoryTest.class); ! TestSuite suite=new TestSuite(); ! suite.addTest(new RepositoryTest("testJobDataTransfer")); return suite; } *************** *** 80,82 **** --- 82,187 ---- } + /** + * Test method to test the logJobStatistics API of repository. + */ + public void testLogJobStatistics() + { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); + assertNotNull(repositoryConfig); + Repository repository=Repository.getRepository(repositoryConfig); + assertNotNull(repository); + JobStatistics statistics=new JobStatistics("process_file_xyz"); + statistics.setStartTime(Calendar.getInstance().getTime()); + statistics.setEndTime(Calendar.getInstance().getTime()); + statistics.setMaxMemeoryUsage(1000); + statistics.setRecordsProcessed(50000); + boolean logged=repository.logStatistics(statistics); + assertTrue(logged); + } + + /** + * Test method to test the getJobStatistics API of repository. + */ + public void testGetJobStatistics() + { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); + assertNotNull(repositoryConfig); + Repository repository=Repository.getRepository(repositoryConfig); + assertNotNull(repository); + + JobStatistics[] recvdStats=repository.getStatistics("not_valid_job_name"); + assertNotNull(recvdStats); + assertEquals(0,recvdStats.length); + + String jobName="process_"+Calendar.getInstance().getTimeInMillis(); + JobStatistics statistics1=this.getJobStatistics(jobName, Calendar.getInstance().getTime(), Calendar.getInstance().getTime() , 234, 5000); + JobStatistics statistics2=this.getJobStatistics(jobName, Calendar.getInstance().getTime(), Calendar.getInstance().getTime() , 236, 5004); + boolean logged=repository.logStatistics(statistics1); + assertTrue(logged); + logged=repository.logStatistics(statistics2); + assertTrue(logged); + + recvdStats=repository.getStatistics(jobName); + assertNotNull(recvdStats); + assertEquals(2,recvdStats.length); + for(int i=0;i<recvdStats.length;i++) + System.out.println(recvdStats[i]); + } + + private JobStatistics getJobStatistics(String jobName,Date startTime,Date endTime,int memory,int records) + { + JobStatistics statistics=new JobStatistics(jobName); + statistics.setStartTime(startTime); + statistics.setEndTime(endTime); + statistics.setMaxMemeoryUsage(memory); + statistics.setRecordsProcessed(records); + + return statistics; + } + + public void testJobDataTransfer() + { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig(); + assertNotNull(repositoryConfig); + Repository repository=Repository.getRepository(repositoryConfig); + assertNotNull(repository); + + String id1="first_data"; + String sourceJob="process_file_abc"; + String targetJob="process_file_xyz"; + + boolean sent=repository.sendDataToNextJob(id1, sourceJob, targetJob, Calendar.getInstance()); + assertTrue(sent); + Calendar cal1=(Calendar)repository.getDataFromPreviousJob(id1, sourceJob, targetJob); + assertNotNull(cal1); + boolean cleared=repository.clearDataTransferredToNextJob(sourceJob); + assertTrue(cleared); + Calendar cal2=(Calendar)repository.getDataFromPreviousJob(id1, sourceJob, targetJob); + assertNull(cal2); + + sent=repository.sendDataToNextJob(id1, sourceJob, targetJob, Calendar.getInstance()); + assertTrue(sent); + sent=repository.sendDataToNextJob(id1, sourceJob, targetJob, new ArrayList()); + assertTrue(sent); + ArrayList list=(ArrayList)repository.getDataFromPreviousJob(id1, sourceJob, targetJob); + assertNotNull(cal1); + cleared=repository.clearDataTransferredToNextJob(sourceJob); + assertTrue(cleared); + } + + public void testJobMgmtMntrInfoHolder() + { + + } + + public void testJobControllerHolder() + { + + } } |
From: Suresh <sur...@us...> - 2006-03-17 14:05:10
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13536 Modified Files: DBJobConfigFactory.java Log Message: no message Index: DBJobConfigFactory.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/db/DBJobConfigFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DBJobConfigFactory.java 14 Mar 2006 23:04:09 -0000 1.6 --- DBJobConfigFactory.java 17 Mar 2006 14:04:58 -0000 1.7 *************** *** 81,88 **** /** ! * This constructor initializes the factory by accepting the required properties ! * map as a parameter to the constructor. If it doesnt find any required properties * and values are not valid to initialize the factory, ! * throws ConfigurationException with the appropriate error code. * * @param configFactoryProps Map consists of all the properties defined for this factory. --- 81,88 ---- /** ! * This method initializes the factory by accepting the required properties ! * as a map. If it doesnt find any required properties * and values are not valid to initialize the factory, ! * throws ConfigurationException with the appropriate error message. * * @param configFactoryProps Map consists of all the properties defined for this factory. *************** *** 90,96 **** * @throws ConfigurationException If required properties are missing. */ ! public DBJobConfigFactory(Map configFactoryProps) { ! logger.trace("Entering constructor"); this.configFactoryProps=new HashMap(configFactoryProps); /** --- 90,96 ---- * @throws ConfigurationException If required properties are missing. */ ! protected void init(Map configFactoryProps) { ! logger.trace("Entering init"); this.configFactoryProps=new HashMap(configFactoryProps); /** *************** *** 114,118 **** } } ! logger.trace("Exiting constructor"); } --- 114,118 ---- } } ! logger.trace("Exiting init"); } |