Print

Print


Commit in lcsim/src/org/lcsim/job on MAIN
JobControlManager.java+19-71.50 -> 1.51
few minor changes

lcsim/src/org/lcsim/job
JobControlManager.java 1.50 -> 1.51
diff -u -r1.50 -r1.51
--- JobControlManager.java	31 Mar 2011 23:19:28 -0000	1.50
+++ JobControlManager.java	1 Apr 2011 22:32:02 -0000	1.51
@@ -79,7 +79,7 @@
  * which it should be discarded.  If the {@link #run()} method is called twice on 
  * the same manager, a fatal exception will be thrown.
  *   
- * @version $Id: JobControlManager.java,v 1.50 2011/03/31 23:19:28 jeremy Exp $
+ * @version $Id: JobControlManager.java,v 1.51 2011/04/01 22:32:02 jeremy Exp $
  * @author Jeremy McCormick
  */
 public class JobControlManager
@@ -347,10 +347,12 @@
 	
 	/**
 	 * Add a variable definition to be substituted into the job's XML file.
+	 * This method is public so that caller's not using the CL can still
+	 * define necessary variables for the steering file.
 	 * @param key The variable name.
 	 * @param value The variable's value.
 	 */
-	private void addVariableDefinition(String key, String value)
+	public void addVariableDefinition(String key, String value)
 	{
 	    if (verbose)
 	    {
@@ -483,7 +485,7 @@
 	}
 	
 	/**
-	 * Setup method from a <code>File</code>.
+	 * Setup job parameters from a <code>File</code>.
 	 * @param file
 	 */
 	public void setup(File file)
@@ -497,10 +499,18 @@
 			throw new RuntimeException(x);
 		}
 	}
+	
+	/**
+	 * Setup job parameters from an embedded resource.
+	 * This method calls {@link #setup(InputStream)}.
+	 */
+	public void setup(String resourceURL)
+	{
+	    setup(this.getClass().getResourceAsStream(resourceURL));
+	}
 
 	/**
 	 * Setup job parameters from an <code>InputStream</code> with XML text.	 
-	 * This could easily be used to load from a resource stream in a jar file.
 	 * @param in The XML input stream.
 	 */
 	public void setup(InputStream in)
@@ -532,9 +542,11 @@
 	}
 	
 	/**
-     * The primary setup method.  The other setup methods,
-     * {@link #setup(InputStream)} and {@link #setup(File)} both call
-     * this.  
+     * Setup the job parameters from an XML Document.  Though it isn't
+     * publically accessible, this method contains the primary logic for setting
+     * up job parameters from an XML file.  The other setup methods, namely,
+     * {@link #setup(InputStream)}, {@link #setup(String)} and {@link #setup(File)}, 
+     * all eventually call this method.  
      * @param doc The lcsim recon XML document describing the job.
      */
     private void setup(Document doc)
CVSspam 0.2.8