Commit in lcsim/src/org/lcsim/job on MAIN
JobControlManager.java+21-201.3 -> 1.4


lcsim/src/org/lcsim/job
JobControlManager.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- JobControlManager.java	10 Sep 2008 21:06:52 -0000	1.3
+++ JobControlManager.java	10 Sep 2008 22:41:14 -0000	1.4
@@ -45,7 +45,7 @@
     List<Driver> driverExec;
     List<File> inputFiles;
     Map<String,String> availableDrivers = new HashMap<String,String>();
-    int maxRun = -1;
+    int maxEvents = -1;
 
     JobControlManager()
     {
@@ -72,7 +72,7 @@
     	}
     	try {
     		loop.setLCIORecordSource(new LCIOEventSource("test",inputFiles));
-    		loop.loop(maxRun,null);
+    		loop.loop(maxEvents,null);
     	} catch (Exception x) {
     		throw new RuntimeException(x);
     	}    	
@@ -120,8 +120,8 @@
         	Element controlElement = control.getChild("numberOfEvents");
         	if (controlElement != null)
         	{
-        		maxRun = Integer.valueOf(controlElement.getText());
-        		System.out.println("set maxRun <" + maxRun + ">");
+        		maxEvents = Integer.valueOf(controlElement.getText());
+        		System.out.println("set maxEvents <" + maxEvents + ">");
         	}
         }
         
@@ -129,18 +129,18 @@
         List<Element> drivers = root.getChild("drivers").getChildren("driver");
         
         // process list of drivers
-        for (Element driver : drivers) {
-        	
+        for (Element driver : drivers) 
+        {        
         	// get the name of driver
         	String name = driver.getAttributeValue("name");
         	
         	String type = driver.getAttributeValue("type");
 
         	// translate from short name if applicable
-                if (availableDrivers.get(type) != null)
-                {
-                    type = availableDrivers.get(type);
-                }
+        	if (availableDrivers.get(type) != null)
+        	{
+        		type = availableDrivers.get(type);
+        	}
 
         	// get the class of driver
         	Class driverClass;
@@ -172,31 +172,31 @@
         	List<Element> parameters = driver.getChildren();
         	
         	// process the parameters
-        	for (Element parameter : parameters) {
-        		
+        	for (Element parameter : parameters) 
+        	{        	
         		// get parameter name
         		String pname = parameter.getName();
         		
         		// find the correct property descriptor for this parameter
         		PropertyDescriptor propFind = null;
-        		for (PropertyDescriptor prop : beaninfo.getPropertyDescriptors()) {
-        			if (prop.getName().equals(pname)) {
+        		for (PropertyDescriptor prop : beaninfo.getPropertyDescriptors()) 
+        		{
+        			if (prop.getName().equals(pname)) 
+        			{
         				propFind = prop;
         				break;
         			}
         		}
         		        	        		
         		// found a valid property?
-        		if (propFind != null) {
-        			        	
+        		if (propFind != null) 
+        		{        			        	
         			// get the class of the property
         			Class propertyType = propFind.getPropertyType();
         		
         			// create Object for next Driver parameter
         			//System.out.println("converting: " + propFind.getName());
-        			Object nextParameter = convertParameter(parameter.getText(), propertyType);        		        		
-        		    
-        			// TODO: use set property
+        			Object nextParameter = convertParameter(parameter.getText(), propertyType);        		        		        		   
         			
         			// if got a valid parameter value, then invoke the setter with its value
         			if (nextParameter != null) {
@@ -351,7 +351,8 @@
     // add a driver with associated name
     private void addDriver(String name, Driver driver) 
     {
-    	if (driverMap.containsKey(name)) {
+    	if (driverMap.containsKey(name)) 
+    	{
     		throw new RuntimeException("ERROR: duplicate driver name: " + name);
     	}
     	driverMap.put(name, driver);
CVSspam 0.2.8