axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: xml-axis/java/tools/org/apache/axis/tools/ant/axis AdminClientTask.java
Date Wed, 11 Sep 2002 23:01:07 GMT
stevel      2002/09/11 16:01:06

  Modified:    java/tools axis-tasks.properties build.xml
               java/tools/org/apache/axis/tools/ant/axis
                        AdminClientTask.java
  Log:
  testing out the admin client. We now give a detailed (maybe too detailed :) dump when things
go wrong during deployment.
  
  Revision  Changes    Path
  1.3       +1 -1      xml-axis/java/tools/axis-tasks.properties
  
  Index: axis-tasks.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/tools/axis-tasks.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- axis-tasks.properties	5 Sep 2002 06:23:49 -0000	1.2
  +++ axis-tasks.properties	11 Sep 2002 23:01:06 -0000	1.3
  @@ -1,6 +1,6 @@
   #properties file for taskdefing the public Axis taskdefs
   
  -axis-wsdl2java=org.apache.axis.tools.ant.wsdl.Wsdl2JavaAntTask
  +axis-wsdl2java=org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask
   axis-java2wsdl=org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask
   axis-admin=org.apache.axis.tools.ant.axis.AdminClientTask
   
  
  
  
  1.10      +4 -3      xml-axis/java/tools/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/tools/build.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- build.xml	10 Sep 2002 18:54:41 -0000	1.9
  +++ build.xml	11 Sep 2002 23:01:06 -0000	1.10
  @@ -52,12 +52,13 @@
         location="${tools.build.dir}/${componentName}" />
       <echo message="Removing ${dir.to.clean}" />
       <delete dir="${dir.to.clean}" />
  -    <delete file="${build.lib}/axis-ant.jar"/>
  +    <delete file="${build.lib}/axis-ant.jar" failonerror="false"/>
   </target>
   
   <target name="copy" depends="setenv"/>
   
  -<target name="compile" depends="copy" unless="axis-ant.present">
  +<target name="compile" depends="copy" unless="axis-ant.present"
  +  description="compile everthing and make the JARs">
     <echo message="Compiling tools.*"/>
     <mkdir dir="${tools.build.dir}"/>
       <!-- build my ForEach task -->
  @@ -101,7 +102,7 @@
     </jar>
   </target>
   
  -<target name="test" unless="axis-ant.present">
  +<target name="test" unless="axis-ant.present" description="tests">
      <ant antfile="${tools.dir}/test.xml" /> 
   </target>
   
  
  
  
  1.3       +23 -10    xml-axis/java/tools/org/apache/axis/tools/ant/axis/AdminClientTask.java
  
  Index: AdminClientTask.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/tools/org/apache/axis/tools/ant/axis/AdminClientTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AdminClientTask.java	5 Sep 2002 21:06:10 -0000	1.2
  +++ AdminClientTask.java	11 Sep 2002 23:01:06 -0000	1.3
  @@ -56,6 +56,7 @@
   
   import org.apache.tools.ant.*;
   import org.apache.axis.client.AdminClient;
  +import org.apache.axis.AxisFault;
   
   import java.util.LinkedList;
   import java.util.Iterator;
  @@ -280,22 +281,34 @@
           }
   
           //now create a client and invoke it
  +        AdminClient admin = new AdminClient();
  +        String result = null;
           try {
  -            AdminClient admin = new AdminClient();
  -            String result = admin.process(args);
  -
  +            result = admin.process(args);
               if (result != null) {
                   log(result);
               } else {
  -                String text = "Something seems to have gone wrong";
  -                if (failOnError) {
  -                    throw new BuildException(text);
  -                } else {
  -                    log(text, Project.MSG_ERR);
  -                }
  +                logOrThrow(getTaskName() + " got a null response");
               }
  +        } catch (AxisFault fault) {
  +            log(fault.dumpToString(), Project.MSG_ERR);
  +            logOrThrow(getTaskName()
  +                    +" failed with  "
  +                    + fault.getFaultCode().toString()
  +                    + " "+ fault.getFaultString());
  +        } catch(BuildException e) {
  +            throw e;
           } catch (Exception e) {
  -            throw new BuildException("While calling the AdminClient", e);
  +            throw new BuildException("Exception in "+getTaskName(),e);
  +        }
  +
  +    }
  +
  +    private void logOrThrow(String text) throws BuildException {
  +        if (failOnError) {
  +            throw new BuildException(text);
  +        } else {
  +            log(text, Project.MSG_ERR);
           }
       }
   
  
  
  

Mime
View raw message