You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Burt Beckwith <bu...@yahoo.com> on 2001/09/10 06:24:57 UTC

[PATCH] Making WeblogicDeploymentTool threadsafe for tasks

Hi all,
 
I've been working on making our build process more efficient so I
thought using <parallel> in 1.4 would help a lot.  It did, but creating
EJB jars simultaneously didn't work because the java task called by
<ejbjar> to run weblogic.ejbc uses the same default working directory
for each of the concurrent tasks, so they stomp on each other.  I added
an optional "workdir" attribute to WeblogicDeploymentTool to handle
this.
 
We use Weblogic 5.1 - this change should probably be made more generic
so it works on other deployment types.
 
I've attached the patches for the java file and the documentation.
 
Burt
 
 
 
Index: WeblogicDeploymentTool.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optio
nal/ejb/WeblogicDeploymentTool.java,v
retrieving revision 1.30
diff -u -r1.30 WeblogicDeploymentTool.java
--- WeblogicDeploymentTool.java            2001/07/19 14:09:38      1.30
+++ WeblogicDeploymentTool.java          2001/09/10 04:05:47
@@ -133,6 +133,13 @@
     private Path wlClasspath = null;
 
     /**
+     * Optional working directory for ejbc.  If not specified,
+     * defaults to the Java task default, which is the project's
+     * base directory.
+     */
+    private File workDir;
+
+          /**
      * Get the classpath to the weblogic classpaths
      */
     public Path createWLClasspath() {
@@ -146,6 +153,10 @@
         this.wlClasspath = wlClasspath;
     }
 
+    public void setWorkdir(File workDir) {
+        this.workDir = workDir;
+    }
+
     /**
      * The compiler (switch <code>-compiler</code>) to use
      */
@@ -417,6 +428,9 @@
                     ejbcClassName = COMPILER_EJB11;
                 }
             }
+
+            if (workDir != null) {
+                javaTask.setDir(workDir);
                  
             javaTask.setClassname(ejbcClassName);
             javaTask.createArg().setLine(additionalArgs);
 
 
 
 
 
Index: ejb.html
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/docs/manual/OptionalTasks/ejb.html,v
retrieving revision 1.8
diff -u -r1.8 ejb.html
--- ejb.html        2001/08/05 09:31:23      1.8
+++ ejb.html     2001/09/10 04:18:48
@@ -930,6 +930,12 @@
                      Use this if you prefer to run ejbc at deployment
time.</td>
     <td valign="top" align="center">No.</td>
   </tr>
+  <tr>
+    <td valign="top">workDir</td>
+    <td valign="top">Working directory where weblogic.ejbc will create
the temporary ejbcgen directory.
+                     Useful for running concurrent tasks inside
&lt;parallel&gt; blocks.</td>
+    <td valign="top" align="center">No, defaults to project base
dir.</td>
+  </tr>
 </table>
 
 <p>The weblogic nested element itself supports two nested elements
&lt;classpath&gt; and