Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 541   Methods: 24
NCLOC: 284   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
BorlandDeploymentTool.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 
 56   
 package org.apache.tools.ant.taskdefs.optional.ejb;
 57   
 
 58   
 
 59   
 import java.io.BufferedReader;
 60   
 import java.io.File;
 61   
 import java.io.IOException;
 62   
 import java.io.InputStream;
 63   
 import java.io.InputStreamReader;
 64   
 import java.io.OutputStream;
 65   
 import java.util.Hashtable;
 66   
 import java.util.Iterator;
 67   
 import java.util.Vector;
 68   
 import org.apache.tools.ant.BuildException;
 69   
 import org.apache.tools.ant.Project;
 70   
 import org.apache.tools.ant.taskdefs.ExecTask;
 71   
 import org.apache.tools.ant.taskdefs.Execute;
 72   
 import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
 73   
 import org.apache.tools.ant.taskdefs.Java;
 74   
 import org.apache.tools.ant.types.Commandline;
 75   
 import org.apache.tools.ant.types.Path;
 76   
 
 77   
 
 78   
 /**
 79   
  * BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and 4.5.1
 80   
  * This task generates and compiles the stubs and skeletons for all ejb described into the
 81   
  * Deployement Descriptor, builds the jar file including the support files and verify
 82   
  * whether the produced jar is valid or not.
 83   
  * The supported options are:
 84   
  * <ul>
 85   
  * <li>debug  (boolean)    : turn on the debug mode for generation of stubs and skeletons (default:false)</li>
 86   
  * <li>verify (boolean)    : turn on the verification at the end of the jar production    (default:true) </li>
 87   
  * <li>verifyargs (String) : add optional argument to verify command (see vbj com.inprise.ejb.util.Verify)</li>
 88   
  * <li>basdtd (String)     : location of the BAS DTD </li>
 89   
  * <li>generateclient (boolean) : turn on the client jar file generation </li>
 90   
  * <li>version (int)       : tell what is the borland appserver version 4 or 5 </li>
 91   
  * </ul>
 92   
  *
 93   
  *<PRE>
 94   
  *
 95   
  *      &lt;ejbjar srcdir=&quot;${build.classes}&quot;  basejarname=&quot;vsmp&quot;  descriptordir=&quot;${rsc.dir}/hrmanager&quot;&gt;
 96   
  *        &lt;borland destdir=&quot;tstlib&quot;&gt;
 97   
  *          &lt;classpath refid=&quot;classpath&quot; /&gt;
 98   
  *        &lt;/borland&gt;
 99   
  *        &lt;include name=&quot;**\ejb-jar.xml&quot;/&gt;
 100   
  *        &lt;support dir=&quot;${build.classes}&quot;&gt;
 101   
  *          &lt;include name=&quot;demo\smp\*.class&quot;/&gt;
 102   
  *          &lt;include name=&quot;demo\helper\*.class&quot;/&gt;
 103   
  *         &lt;/support&gt;
 104   
  *     &lt;/ejbjar&gt;
 105   
  *</PRE>
 106   
  * @author     <a href="mailto:benoit.moussaud@criltelecom.com">Benoit Moussaud</a>
 107   
  *
 108   
  */
 109   
 public class BorlandDeploymentTool extends GenericDeploymentTool  implements ExecuteStreamHandler
 110   
 {
 111   
     public static final String PUBLICID_BORLAND_EJB
 112   
     = "-//Inprise Corporation//DTD Enterprise JavaBeans 1.1//EN";
 113   
 
 114   
     protected static final String DEFAULT_BAS45_EJB11_DTD_LOCATION
 115   
     = "/com/inprise/j2ee/xml/dtds/ejb-jar.dtd";
 116   
 
 117   
     protected static final String DEFAULT_BAS_DTD_LOCATION
 118   
     = "/com/inprise/j2ee/xml/dtds/ejb-inprise.dtd";
 119   
 
 120   
     protected static final String BAS_DD = "ejb-inprise.xml";
 121   
     protected static final String BES_DD = "ejb-borland.xml";
 122   
 
 123   
 
 124   
     /** Java2iiop executable **/
 125   
     protected static final String JAVA2IIOP = "java2iiop";
 126   
 
 127   
     /** Verify class */
 128   
     protected static final String VERIFY = "com.inprise.ejb.util.Verify";
 129   
 
 130   
     /** Instance variable that stores the suffix for the borland jarfile. */
 131   
     private String jarSuffix = "-ejb.jar";
 132   
 
 133   
     /** Instance variable that stores the location of the borland DTD file. */
 134   
     private String borlandDTD;
 135   
 
 136   
     /** Instance variable that determines whether the debug mode is on */
 137   
     private boolean java2iiopdebug = false;
 138   
 
 139   
     /** Instance variable that determines whetger the client jar file is generated */
 140   
     private boolean generateclient = false;
 141   
 
 142   
     /** Borland Entreprise Server = version 5 */
 143   
     static final int    BES       = 5;
 144   
     /** Borland Application Server or Inprise Applcation Server  = version 4 */
 145   
     static final int    BAS       = 4;
 146   
 
 147   
     /** borland appserver version 4 or 5 */
 148   
     private int version = BAS;
 149   
 
 150   
 
 151   
     /** Instance variable that determines whether it is necessary to verify the produced jar */
 152   
     private boolean verify     = true;
 153   
     private String  verifyArgs = "";
 154   
 
 155   
     private Hashtable _genfiles = new Hashtable();
 156   
 
 157   
     /**
 158   
      * set the debug mode for java2iiop (default false)
 159   
      **/
 160  0
     public void setDebug(boolean debug) {
 161  0
         this.java2iiopdebug = debug;
 162   
     }
 163   
 
 164   
     /**
 165   
      * set the verify  mode for the produced jar (default true)
 166   
      **/
 167  0
     public void setVerify(boolean verify) {
 168  0
         this.verify = verify;
 169   
     }
 170   
 
 171   
 
 172   
     /**
 173   
      * Setter used to store the suffix for the generated borland jar file.
 174   
      * @param inString the string to use as the suffix.
 175   
      */
 176  0
     public void setSuffix(String inString) {
 177  0
         this.jarSuffix = inString;
 178   
     }
 179   
 
 180   
 
 181   
     /**
 182   
      * sets some additional args to send to verify command
 183   
      * @param args addtions command line parameters
 184   
      */
 185  0
     public void setVerifyArgs(String args) {
 186  0
         this.verifyArgs = args;
 187   
     }
 188   
 
 189   
     /**
 190   
      * Setter used to store the location of the borland DTD. This can be a file on the system
 191   
      * or a resource on the classpath.
 192   
      * @param inString the string to use as the DTD location.
 193   
      */
 194  0
     public void setBASdtd(String inString) {
 195  0
         this.borlandDTD = inString;
 196   
     }
 197   
 
 198   
 
 199   
     /**
 200   
      * setter used to store whether the task will include the generate client task.
 201   
      * (see : BorlandGenerateClient task)
 202   
      */
 203  0
     public void setGenerateclient(boolean b) {
 204  0
         this.generateclient = b;
 205   
     }
 206   
 
 207   
     /**
 208   
      * setter used to store the borland appserver version [4 or 5]
 209   
      * @param version app server version 4 or 5
 210   
      */
 211  0
     public void setVersion(int version) {
 212  0
         this.version = version;
 213   
     }
 214   
 
 215  0
     protected DescriptorHandler getBorlandDescriptorHandler(final File srcDir) {
 216  0
         DescriptorHandler handler =
 217   
             new DescriptorHandler(getTask(), srcDir) {
 218  0
                     protected void processElement() {
 219  0
                         if (currentElement.equals("type-storage")) {
 220   
                             // Get the filename of vendor specific descriptor
 221  0
                             String fileNameWithMETA = currentText;
 222   
                             //trim the META_INF\ off of the file name
 223  0
                             String fileName
 224   
                                 = fileNameWithMETA.substring(META_DIR.length(),
 225   
                                     fileNameWithMETA.length());
 226  0
                             File descriptorFile = new File(srcDir, fileName);
 227   
 
 228  0
                             ejbFiles.put(fileNameWithMETA, descriptorFile);
 229   
                         }
 230   
                     }
 231   
                 };
 232  0
         handler.registerDTD(PUBLICID_BORLAND_EJB,
 233   
                             borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTD);
 234   
 
 235  0
         for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
 236  0
             EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next();
 237  0
             handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
 238   
         }
 239  0
         return handler;
 240   
     }
 241   
 
 242   
     /**
 243   
      * Add any vendor specific files which should be included in the
 244   
      * EJB Jar.
 245   
      */
 246  0
     protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) {
 247   
 
 248   
         //choose the right vendor DD
 249  0
         if ( !(version == BES || version == BAS)) {
 250  0
             throw new BuildException("version "+version+" is not supported");
 251   
         }
 252   
 
 253  0
         String dd = ( version == BES ? BES_DD : BAS_DD);
 254   
 
 255  0
         log("vendor file : "+ddPrefix + dd,Project.MSG_DEBUG);
 256   
 
 257  0
         File borlandDD = new File(getConfig().descriptorDir, ddPrefix + dd);
 258  0
         if (borlandDD.exists()) {
 259  0
             log("Borland specific file found " + borlandDD,  Project.MSG_VERBOSE);
 260  0
             ejbFiles.put(META_DIR + dd ,  borlandDD);
 261   
         } else {
 262  0
             log("Unable to locate borland deployment descriptor. It was expected to be in " +
 263   
                 borlandDD.getPath(), Project.MSG_WARN);
 264  0
             return;
 265   
         }
 266   
     }
 267   
 
 268   
     /**
 269   
      * Get the vendor specific name of the Jar that will be output. The modification date
 270   
      * of this jar will be checked against the dependent bean classes.
 271   
      */
 272  0
     File getVendorOutputJarFile(String baseName) {
 273  0
         return new File(getDestDir(), baseName +  jarSuffix);
 274   
     }
 275   
 
 276   
     /**
 277   
      * Verify the produced jar file by invoking the Borland verify tool
 278   
      * @param sourceJar java.io.File representing the produced jar file
 279   
      */
 280  0
     private void verifyBorlandJar(File sourceJar) {
 281  0
         if ( version == BAS) {
 282  0
             verifyBorlandJarV4(sourceJar);
 283  0
             return ;
 284   
         }
 285  0
         if ( version == BES ) {
 286  0
             verifyBorlandJarV5(sourceJar);
 287  0
             return;
 288   
         }
 289  0
         log("verify jar skipped because the version is invalid ["+version+"]",Project.MSG_WARN);
 290   
     }
 291   
 
 292   
     /**
 293   
      * Verify the produced jar file by invoking the Borland iastool tool
 294   
      * @param sourceJar java.io.File representing the produced jar file
 295   
      */
 296  0
     private void verifyBorlandJarV5(File sourceJar) {
 297  0
         log("verify BES " + sourceJar, Project.MSG_INFO);
 298  0
         try {
 299  0
             org.apache.tools.ant.taskdefs.ExecTask execTask = null;
 300  0
             execTask = (ExecTask) getTask().getProject().createTask("exec");
 301  0
             execTask.setDir(new File("."));
 302  0
             execTask.setExecutable("iastool");
 303   
             //classpath
 304  0
             if (getCombinedClasspath() != null)  {
 305  0
                 execTask.createArg().setValue("-VBJclasspath");
 306  0
                 execTask.createArg().setValue(getCombinedClasspath().toString());
 307   
             }
 308   
 
 309  0
             if (java2iiopdebug) {
 310  0
                 execTask.createArg().setValue("-debug");
 311   
             }
 312  0
             execTask.createArg().setValue("-verify");
 313  0
             execTask.createArg().setValue("-src");
 314   
             // ejb jar file to verfiy
 315  0
             execTask.createArg().setValue(sourceJar.getPath());
 316  0
             log("Calling iastool", Project.MSG_VERBOSE);
 317  0
             execTask.execute();
 318   
         } catch (Exception e) {
 319   
             // Have to catch this because of the semantics of calling main()
 320  0
             String msg = "Exception while calling generateclient Details: "
 321   
                 + e.toString();
 322  0
             throw new BuildException(msg, e);
 323   
         }
 324   
     }
 325   
 
 326   
     /**
 327   
      * Verify the produced jar file by invoking the Borland verify tool
 328   
      * @param sourceJar java.io.File representing the produced jar file
 329   
      */
 330  0
     private void verifyBorlandJarV4(File sourceJar) {
 331  0
         org.apache.tools.ant.taskdefs.Java javaTask = null;
 332  0
         log("verify BAS " + sourceJar, Project.MSG_INFO);
 333  0
         try  {
 334  0
             String args = verifyArgs;
 335  0
             args += " " + sourceJar.getPath();
 336   
 
 337  0
             javaTask = (Java) getTask().getProject().createTask("java");
 338  0
             javaTask.setTaskName("verify");
 339  0
             javaTask.setClassname(VERIFY);
 340  0
             Commandline.Argument arguments = javaTask.createArg();
 341  0
             arguments.setLine(args);
 342  0
             Path classpath = getCombinedClasspath();
 343  0
             if (classpath != null)  {
 344  0
                 javaTask.setClasspath(classpath);
 345  0
                 javaTask.setFork(true);
 346   
             }
 347   
 
 348  0
             log("Calling " + VERIFY + " for " + sourceJar.toString(),
 349   
                 Project.MSG_VERBOSE);
 350  0
             javaTask.execute();
 351   
         } catch (Exception e) {
 352   
             //TO DO : delete the file if it is not a valid file.
 353  0
             String msg = "Exception while calling " + VERIFY + " Details: "
 354   
                 + e.toString();
 355  0
             throw new BuildException(msg, e);
 356   
         }
 357   
     }
 358   
 
 359   
 
 360   
     /**
 361   
      * Generate the client jar corresponding to the jar file passed as paremeter
 362   
      * the method uses the BorlandGenerateClient task.
 363   
      * @param sourceJar java.io.File representing the produced jar file
 364   
      */
 365  0
     private void generateClient(File sourceJar) {
 366  0
         getTask().getProject().addTaskDefinition("internal_bas_generateclient",
 367   
             org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient.class);
 368   
 
 369  0
         org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null;
 370  0
         log("generate client for " + sourceJar, Project.MSG_INFO);
 371  0
         try {
 372  0
             gentask = (BorlandGenerateClient) getTask().getProject().createTask("internal_bas_generateclient");
 373  0
             gentask.setEjbjar(sourceJar);
 374  0
             gentask.setDebug(java2iiopdebug);
 375  0
             Path classpath = getCombinedClasspath();
 376  0
             if (classpath != null) {
 377  0
                 gentask.setClasspath(classpath);
 378   
             }
 379  0
             gentask.setVersion(version);
 380  0
             gentask.setTaskName("generate client");
 381  0
             gentask.execute();
 382   
         } catch (Exception e) {
 383   
             //TO DO : delete the file if it is not a valid file.
 384  0
             String msg = "Exception while calling " + VERIFY + " Details: "
 385   
                 + e.toString();
 386  0
             throw new BuildException(msg, e);
 387   
         }
 388   
     }
 389   
 
 390   
     /**
 391   
      * Generate stubs & sketelton for each home found into the DD
 392   
      * Add all the generate class file into the ejb files
 393   
      * @param ithomes : iterator on home class
 394   
      */
 395  0
     private void buildBorlandStubs(Iterator ithomes) {
 396  0
         Execute execTask = null;
 397   
 
 398  0
         execTask = new Execute(this);
 399  0
         Project project = getTask().getProject();
 400  0
         execTask.setAntRun(project);
 401  0
         execTask.setWorkingDirectory(project.getBaseDir());
 402   
 
 403  0
         Commandline commandline = new Commandline();
 404  0
         commandline.setExecutable(JAVA2IIOP);
 405   
         //debug ?
 406  0
         if (java2iiopdebug) {
 407  0
             commandline.createArgument().setValue("-VBJdebug");
 408   
         } // end of if ()
 409   
         //set the classpath
 410  0
         commandline.createArgument().setValue("-VBJclasspath");
 411  0
         commandline.createArgument().setPath(getCombinedClasspath());
 412   
         //list file
 413  0
         commandline.createArgument().setValue("-list_files");
 414   
         //no TIE classes
 415  0
         commandline.createArgument().setValue("-no_tie");
 416   
         //root dir
 417  0
         commandline.createArgument().setValue("-root_dir");
 418  0
         commandline.createArgument().setValue(getConfig().srcDir.getAbsolutePath());
 419   
         //compiling order
 420  0
         commandline.createArgument().setValue("-compile");
 421   
         //add the home class
 422  0
         while (ithomes.hasNext()) {
 423  0
             commandline.createArgument().setValue(ithomes.next().toString());
 424   
         } // end of while ()
 425   
 
 426  0
         try {
 427  0
             log("Calling java2iiop", Project.MSG_VERBOSE);
 428  0
             log(commandline.describeCommand(), Project.MSG_DEBUG);
 429  0
             execTask.setCommandline(commandline.getCommandline());
 430  0
             int result = execTask.execute();
 431  0
             if (result != 0) {
 432  0
                 String msg = "Failed executing java2iiop (ret code is "
 433   
                     + result + ")";
 434  0
                 throw new BuildException(msg, getTask().getLocation());
 435   
             }
 436   
         } catch (java.io.IOException e) {
 437  0
             log("java2iiop exception :" + e.getMessage(), Project.MSG_ERR);
 438  0
             throw new BuildException(e, getTask().getLocation());
 439   
         }
 440   
     }
 441   
 
 442   
     /**
 443   
      * Method used to encapsulate the writing of the JAR file. Iterates over the
 444   
      * filenames/java.io.Files in the Hashtable stored on the instance variable
 445   
      * ejbFiles.
 446   
      */
 447  0
     protected void writeJar(String baseName, File jarFile, Hashtable files, String publicId)
 448   
         throws BuildException {
 449   
         //build the home classes list.
 450  0
         Vector homes = new Vector();
 451  0
         Iterator it = files.keySet().iterator();
 452  0
         while (it.hasNext()) {
 453  0
             String clazz = (String) it.next();
 454  0
             if (clazz.endsWith("Home.class")) {
 455   
                 //remove .class extension
 456  0
                 String home = toClass(clazz);
 457  0
                 homes.add(home);
 458  0
                 log(" Home " + home, Project.MSG_VERBOSE);
 459   
             } // end of if ()
 460   
         } // end of while ()
 461   
 
 462  0
         buildBorlandStubs(homes.iterator());
 463   
 
 464   
         //add the gen files to the collection
 465  0
         files.putAll(_genfiles);
 466   
 
 467  0
         super.writeJar(baseName, jarFile, files, publicId);
 468   
 
 469  0
         if (verify) {
 470  0
             verifyBorlandJar(jarFile);
 471   
         }
 472   
 
 473  0
         if (generateclient) {
 474  0
             generateClient(jarFile);
 475   
         }
 476   
     }
 477   
 
 478   
     /**
 479   
      * convert a class file name : A/B/C/toto.class
 480   
      * into    a class name: A.B.C.toto
 481   
      */
 482  0
     private String toClass(String filename) {
 483   
         //remove the .class
 484  0
         String classname = filename.substring(0, filename.lastIndexOf(".class"));
 485  0
         classname = classname.replace('\\', '.');
 486  0
         return classname;
 487   
     }
 488   
 
 489   
     /**
 490   
      * convert a file name : A/B/C/toto.java
 491   
      * into    a class name: A/B/C/toto.class
 492   
      */
 493  0
     private  String toClassFile(String filename) {
 494   
         //remove the .class
 495  0
         String classfile = filename.substring(0, filename.lastIndexOf(".java"));
 496  0
         classfile = classfile + ".class";
 497  0
         return classfile;
 498   
     }
 499   
 
 500   
     // implementation of org.apache.tools.ant.taskdefs.ExecuteStreamHandler interface
 501   
 
 502  0
     public void start() throws IOException  { }
 503  0
     public void stop()  {  }
 504  0
     public void setProcessInputStream(OutputStream param1) throws IOException   { }
 505   
 
 506   
     /**
 507   
      *
 508   
      * @param is
 509   
      * @exception java.io.IOException
 510   
      */
 511  0
     public void setProcessOutputStream(InputStream is) throws IOException {
 512  0
         try {
 513  0
             BufferedReader reader = new BufferedReader(new InputStreamReader(is));
 514  0
             String javafile;
 515  0
             while ((javafile = reader.readLine()) != null) {
 516  0
                 log("buffer:" + javafile, Project.MSG_DEBUG);
 517  0
                 if (javafile.endsWith(".java")) {
 518  0
                     String classfile = toClassFile(javafile);
 519  0
                     String key = classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1);
 520  0
                     log(" generated : " + classfile, Project.MSG_DEBUG);
 521  0
                     log(" key       : " + key, Project.MSG_DEBUG);
 522  0
                     _genfiles.put(key, new File(classfile));
 523   
                 } // end of if ()
 524   
             } // end of while ()
 525  0
             reader.close();
 526   
         } catch (Exception e) {
 527  0
             String msg = "Exception while parsing  java2iiop output. Details: " + e.toString();
 528  0
             throw new BuildException(msg, e);
 529   
         }
 530   
     }
 531   
 
 532  0
     public void setProcessErrorStream(InputStream is) throws IOException {
 533  0
         BufferedReader reader = new BufferedReader(new InputStreamReader(is));
 534  0
         String s = reader.readLine();
 535  0
         if (s != null) {
 536  0
             log("[java2iiop] " + s, Project.MSG_DEBUG);
 537   
         } // end of if ()
 538   
     }
 539   
 }
 540   
 
 541