Browse Source

Prevent <ejbjar> Borland implementation

from being blocked by java2iiop warning messages
PR: 19385
Submitted by: Benoit Moussaud (benoit dot moussaud at criltelecom dot com)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274680 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
1a12c40a4c
3 changed files with 40 additions and 13 deletions
  1. +4
    -0
      WHATSNEW
  2. +7
    -1
      docs/manual/OptionalTasks/BorlandEJBTasks.html
  3. +29
    -12
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java

+ 4
- 0
WHATSNEW View File

@@ -161,6 +161,10 @@ Fixed bugs:
of FileUtils#createTempFile instead of the destination dir of fixcrlf.
Bugzilla Report 20870.

* <ejbjar> implementation for Borland.
Prevent the task from being blocked by error messages coming from java2iiop.
Bugzilla Report 19385.

Other changes:
--------------
* Six new Clearcase tasks added.


+ 7
- 1
docs/manual/OptionalTasks/BorlandEJBTasks.html View File

@@ -89,6 +89,12 @@
</td>
<td align="center" valign="middle" width="62">No, defaults to 4</td>
</tr>
<tr>
<td valign="top" width="63">java2iiopParams </td>
<td valign="top" width="915">If filled, the params are added to the java2iiop command (ex: -no_warn_missing_define)</td>
<td align="center" valign="middle" width="62">no</td>
</tr>

</table>

<h3>Examples</h3>
@@ -109,7 +115,7 @@ The verify phase is turned on and the generate client phase as well.
</pre>

<h3>&nbsp;</h3>
<p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2001-2003 Apache Software Foundation. All rights
Reserved.</p>

</body>


+ 29
- 12
src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -136,6 +136,9 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
/** Instance variable that determines whether the debug mode is on */
private boolean java2iiopdebug = false;

/** store additional param for java2iiop command used to build EJB Stubs */
private String java2iioparams = null;

/** Instance variable that determines whetger the client jar file is generated */
private boolean generateclient = false;

@@ -212,6 +215,16 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
this.version = version;
}

/**
* If filled, the params are added to the java2iiop command.
* (ex: -no_warn_missing_define)
* @param params additional params for java2iiop
*/
public void setJava2iiopParams(String params) {
this.java2iioparams = params;
}


protected DescriptorHandler getBorlandDescriptorHandler(final File srcDir) {
DescriptorHandler handler =
new DescriptorHandler(getTask(), srcDir) {
@@ -405,7 +418,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
//debug ?
if (java2iiopdebug) {
commandline.createArgument().setValue("-VBJdebug");
} // end of if ()
}
//set the classpath
commandline.createArgument().setValue("-VBJclasspath");
commandline.createArgument().setPath(getCombinedClasspath());
@@ -413,6 +426,13 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
commandline.createArgument().setValue("-list_files");
//no TIE classes
commandline.createArgument().setValue("-no_tie");
if ( java2iioparams != null) {
log("additional "+java2iioparams +" to java2iiop " ,0);
commandline.createArgument().setValue(java2iioparams);
}

//root dir
commandline.createArgument().setValue("-root_dir");
commandline.createArgument().setValue(getConfig().srcDir.getAbsolutePath());
@@ -421,7 +441,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
//add the home class
while (ithomes.hasNext()) {
commandline.createArgument().setValue(ithomes.next().toString());
} // end of while ()
}

try {
log("Calling java2iiop", Project.MSG_VERBOSE);
@@ -456,8 +476,8 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
String home = toClass(clazz);
homes.add(home);
log(" Home " + home, Project.MSG_VERBOSE);
} // end of if ()
} // end of while ()
}
}

buildBorlandStubs(homes.iterator());

@@ -513,15 +533,12 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String javafile;
while ((javafile = reader.readLine()) != null) {
log("buffer:" + javafile, Project.MSG_DEBUG);
if (javafile.endsWith(".java")) {
String classfile = toClassFile(javafile);
String key = classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1);
log(" generated : " + classfile, Project.MSG_DEBUG);
log(" key : " + key, Project.MSG_DEBUG);
_genfiles.put(key, new File(classfile));
} // end of if ()
} // end of while ()
}
}
reader.close();
} catch (Exception e) {
String msg = "Exception while parsing java2iiop output. Details: " + e.toString();
@@ -533,8 +550,8 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String s = reader.readLine();
if (s != null) {
log("[java2iiop] " + s, Project.MSG_DEBUG);
} // end of if ()
log("[java2iiop] " + s, Project.MSG_ERR);
}
}
}


Loading…
Cancel
Save