[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/config BasicJobControllerConfig
Brought to you by:
suresh_pragada
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26520/config Modified Files: BasicJobControllerConfig.java FrameworkConfig.java JobControllerConfig.java PoolJobControllerConfig.java Log Message: no message Index: BasicJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/BasicJobControllerConfig.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BasicJobControllerConfig.java 14 Mar 2006 05:45:25 -0000 1.7 --- BasicJobControllerConfig.java 14 Sep 2006 05:04:33 -0000 1.8 *************** *** 11,16 **** package org.jmonks.batchserver.framework.config; import java.util.HashMap; - import java.util.Iterator; import java.util.Map; import org.apache.log4j.Logger; --- 11,16 ---- package org.jmonks.batchserver.framework.config; + import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; *************** *** 25,32 **** public abstract class BasicJobControllerConfig extends JobControllerConfig { - /** - * Common configuration property prefix for basic job controller. - */ - protected final static String CONFIG_PROPERTY_PREFIX = "basic-job-controller-"; /** --- 25,28 ---- *************** *** 57,61 **** /** ! * Gets the map contains the properties required by basic job processor. * * @return Returns the map contains the properties required by basic job processor. --- 53,57 ---- /** ! * Gets the unmodifiable map contains the properties required by basic job processor. * * @return Returns the map contains the properties required by basic job processor. *************** *** 63,108 **** public Map getBasicJobProcessorConfigProperties() { ! return this.basicJobProcessorConfigProps; ! } ! ! ! /** ! * Returns the common property prefix of basic job cotroller. ! * ! * @return Returns the common property prefix. ! */ ! protected String getJobControllerConfigPropertyPrefix() ! { ! return BasicJobControllerConfig.CONFIG_PROPERTY_PREFIX; } - - /** - * Override the properties controller and controller sub componenets. - * JobControllerConfig provides the implementation of overriding common controller - * properties and controller specific properties. So, this will override - * the properties of controller sub componenents like basic job processor. - * - * @param newProps Map contains new properties. - */ - public void overrideConfigProperties(Map newProps) - { - logger.trace("Entering overrideConfigProperties"); - super.overrideConfigProperties(newProps); - /** - * Override basic job processor config properites. - */ - for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) - { - String key=(String)iterator.next(); - if(key.startsWith("basic-job-processor-")) - { - this.basicJobProcessorConfigProps.put(key, newProps.get(key)); - logger.debug("Overriden the property " + key + " with " + newProps.get(key)); - } - } - logger.trace("Exiting overrideConfigProperties"); - } - /** * Returns the number of basic job processor instances needs to be run to process this job. --- 59,65 ---- public Map getBasicJobProcessorConfigProperties() { ! return Collections.unmodifiableMap(this.basicJobProcessorConfigProps); } /** * Returns the number of basic job processor instances needs to be run to process this job. Index: JobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/JobControllerConfig.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JobControllerConfig.java 14 Mar 2006 05:45:25 -0000 1.6 --- JobControllerConfig.java 14 Sep 2006 05:04:34 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- package org.jmonks.batchserver.framework.config; + import java.util.Collections; import java.util.HashMap; import java.util.Iterator; *************** *** 59,63 **** /** ! * Gets the map contains the properties required by the controller. * * @return Returns the properites in a map. --- 60,64 ---- /** ! * Gets the unmodifiable map contains the properties required by the controller. * * @return Returns the properites in a map. *************** *** 65,130 **** public Map getJobControllerConfigProperties() { ! return this.jobControllerConfigProps; ! } ! ! /** ! * Overrides all the configuration properties defined for the controller by ! * the new properties in the incoming map. This identifies the properties needs to be ! * modified by getting the prefix for this controller by calling the method ! * <b>getJobControllerConfigPropertyPrefix</b> on the controller specific config. ! * If any property defined newProps starting with controller config prefix, ! * doesnt exist in controller defined props, it will add that property to the ! * controller map. This also overrides the properties common to the controller ! * which starts with "job-controller-". This will be used to override some common ! * properties like "job-controller-restart". ! * ! * @param newProps Map contains the new properties. ! */ ! public void overrideConfigProperties(Map newProps) ! { ! logger.trace("Entering overrideConfigProperties"); ! if(newProps==null ) ! return; ! /** ! * Override controller common properties like restart of the controller. ! */ ! for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) ! { ! String key=(String)iterator.next(); ! if(key.startsWith("job-controller-")) ! { ! this.jobControllerConfigProps.put(key, newProps.get(key)); ! logger.debug("Overriden the property " + key + " with " + newProps.get(key)); ! } ! } ! /** ! * Override controller specific properties by getting the prefix from ! * specific controller. ! */ ! String configPrefix=this.getJobControllerConfigPropertyPrefix(); ! if(configPrefix==null) ! configPrefix=""; ! ! for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) ! { ! String key=(String)iterator.next(); ! ! if(key.startsWith(configPrefix)) ! { ! this.jobControllerConfigProps.put(key, newProps.get(key)); ! logger.debug("Overriden the property " + key + " with " + newProps.get(key)); ! } ! ! } ! logger.trace("Entering overrideConfigProperties"); } - - /** - * Gets the common prefix all the properties of this controller cann be identified with. - * Each controller can have different properties. This defines the common prefix of all those - * properties. - * - * @return Returns the prefix of all the properties. - */ - protected abstract String getJobControllerConfigPropertyPrefix(); } --- 66,70 ---- public Map getJobControllerConfigProperties() { ! return Collections.unmodifiableMap(this.jobControllerConfigProps); } } Index: FrameworkConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/FrameworkConfig.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FrameworkConfig.java 29 Aug 2006 02:01:32 -0000 1.11 --- FrameworkConfig.java 14 Sep 2006 05:04:33 -0000 1.12 *************** *** 12,15 **** --- 12,16 ---- import java.io.IOException; import java.io.InputStream; + import java.util.Collections; import java.util.HashMap; import java.util.Map; *************** *** 50,54 **** * Declaration of XML file holds the framework configuration. */ ! private static final String FRAMEWORK_CONFIG_FILE = "/org/jmonks/batchserver/framework/config/framework-config.xml"; /** --- 51,55 ---- * Declaration of XML file holds the framework configuration. */ ! private static final String FRAMEWORK_CONFIG_FILE = "framework-config.xml"; /** *************** *** 93,97 **** try { ! InputStream configFileStream=FrameworkConfig.class.getResourceAsStream(FrameworkConfig.FRAMEWORK_CONFIG_FILE); if(configFileStream==null) throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, "Framework configuration file " + --- 94,98 ---- try { ! InputStream configFileStream=FrameworkConfig.class.getClassLoader().getResourceAsStream(FrameworkConfig.FRAMEWORK_CONFIG_FILE); if(configFileStream==null) throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, "Framework configuration file " + *************** *** 105,109 **** documentBuilderFactory.setValidating(true); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema"); ! InputStream xsdStream=FrameworkConfig.class.getResourceAsStream("framework-config.xsd"); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",xsdStream); --- 106,110 ---- documentBuilderFactory.setValidating(true); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema"); ! InputStream xsdStream=FrameworkConfig.class.getClassLoader().getResourceAsStream("framework-config.xsd"); documentBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",xsdStream); *************** *** 333,342 **** /** ! * 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() { ! return this.jobConfigFactoryProperties; } --- 334,344 ---- /** ! * Returns the unmodifiable 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() { ! return Collections.unmodifiableMap(this.jobConfigFactoryProperties); } *************** *** 577,581 **** /** ! * Returns the map consist of the properties needed by the defined job connectors. * * @return Returns the properties in a map. --- 579,583 ---- /** ! * Returns the unmodifiable map consist of the properties needed by the defined job connectors. * * @return Returns the properties in a map. *************** *** 583,587 **** public Map getJobConnectorConfigProperties() { ! return this.jobConnectorConfigProperties; } --- 585,589 ---- public Map getJobConnectorConfigProperties() { ! return Collections.unmodifiableMap(this.jobConnectorConfigProperties); } *************** *** 676,680 **** /** ! * 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. --- 678,682 ---- /** ! * Returns all the properties required by the repository class to interact with the repsoitory in a unmodifiable map. * * @return Returns the properties required by repository class in a map. *************** *** 682,686 **** public Map getRepositoryConfigProperties() { ! return this.repositoryConfigProperties; } --- 684,688 ---- public Map getRepositoryConfigProperties() { ! return Collections.unmodifiableMap(this.repositoryConfigProperties); } Index: PoolJobControllerConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/PoolJobControllerConfig.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PoolJobControllerConfig.java 14 Mar 2006 05:45:25 -0000 1.7 --- PoolJobControllerConfig.java 14 Sep 2006 05:04:34 -0000 1.8 *************** *** 11,16 **** package org.jmonks.batchserver.framework.config; import java.util.HashMap; - import java.util.Iterator; import java.util.Map; import org.apache.log4j.Logger; --- 11,16 ---- package org.jmonks.batchserver.framework.config; + import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; *************** *** 29,37 **** { /** - * Common pool controller property prefix. - */ - protected final static String CONFIG_PROPERTY_PREFIX = "pool-job-controller-"; - - /** * Pool job loader class name. */ --- 29,32 ---- *************** *** 76,80 **** /** ! * Gets the map contains the properties needed by pool job loader. * * @return Returns the map contains the properties. --- 71,75 ---- /** ! * Gets the unmodifiable map contains the properties needed by pool job loader. * * @return Returns the map contains the properties. *************** *** 82,86 **** public Map getPoolJobLoaderConfigProperties() { ! return this.poolJobLoaderConfigProps; } --- 77,81 ---- public Map getPoolJobLoaderConfigProperties() { ! return Collections.unmodifiableMap(this.poolJobLoaderConfigProps); } *************** *** 96,100 **** /** ! * Gets the map contains the properties needed by pool job processor. * * @return Returns the map contains properties. --- 91,95 ---- /** ! * Gets the unmodifiable map contains the properties needed by pool job processor. * * @return Returns the map contains properties. *************** *** 102,106 **** public Map getPoolJobProcessorConfigProperties() { ! return this.poolJobProcessorConfigProps; } --- 97,101 ---- public Map getPoolJobProcessorConfigProperties() { ! return Collections.unmodifiableMap(this.poolJobProcessorConfigProps); } *************** *** 116,120 **** /** ! * Gets the map contains properties needed by the pool class. * * @return Returns the map contains properties. --- 111,115 ---- /** ! * Gets the unmodifiable map contains properties needed by the pool class. * * @return Returns the map contains properties. *************** *** 122,193 **** public Map getPoolConfigProperties() { ! return this.poolConfigProps; ! } ! ! /** ! * Gets the common pool controller property prefix. ! * ! * @return Returns the common property prefix. ! */ ! protected String getJobControllerConfigPropertyPrefix() ! { ! return PoolJobControllerConfig.CONFIG_PROPERTY_PREFIX; ! } ! ! /** ! * Override the properties controller and controller sub componenets. ! * JobControllerConfig provides the implementation of overriding common controller ! * properties and controller specific properties. So, this will override ! * the properties of controller sub componenents like pool job processor, ! * pool job loader and job pool. ! * ! * @param newProps Map contains new properties. ! */ ! public void overrideConfigProperties(Map newProps) ! { ! super.overrideConfigProperties(newProps); ! logger.trace("Entering overrideConfigProperties"); ! if(newProps==null ) ! return; ! ! /** ! * Override pool job loader properties. ! */ ! for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) ! { ! String key=(String)iterator.next(); ! if(key.startsWith("pool-job-loader-")) ! { ! this.poolJobLoaderConfigProps.put(key, newProps.get(key)); ! logger.debug("Overriden the property " + key + " with " + newProps.get(key)); ! } ! } ! /** ! * Override pool job processor properties. ! */ ! for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) ! { ! String key=(String)iterator.next(); ! if(key.startsWith("pool-job-processor-")) ! { ! this.poolJobProcessorConfigProps.put(key, newProps.get(key)); ! logger.debug("Overriden the property " + key + " with " + newProps.get(key)); ! } ! } ! /** ! * Override pool job loader properties. ! */ ! for(Iterator iterator=newProps.keySet().iterator();iterator.hasNext();) ! { ! String key=(String)iterator.next(); ! if(key.startsWith("job-pool-")) ! { ! this.poolConfigProps.put(key, newProps.get(key)); ! logger.debug("Overriden the property " + key + " with " + newProps.get(key)); ! } ! } ! logger.trace("Exiting overrideConfigProperties"); } ! /** * Returns the number of instances of pool job processors needs to be created to process this job. --- 117,123 ---- public Map getPoolConfigProperties() { ! return Collections.unmodifiableMap(this.poolConfigProps); } ! /** * Returns the number of instances of pool job processors needs to be created to process this job. |