commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant MLETTask.java
Date Thu, 26 Dec 2002 18:08:11 GMT
costin      2002/12/26 10:08:11

  Modified:    modeler/src/java/org/apache/commons/modeler/ant
                        MLETTask.java
  Log:
  Consistent names, removed debugging println, refactored Arg.
  
  Revision  Changes    Path
  1.2       +13 -26    jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant/MLETTask.java
  
  Index: MLETTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ant/MLETTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MLETTask.java	12 Nov 2002 22:46:09 -0000	1.1
  +++ MLETTask.java	26 Dec 2002 18:08:11 -0000	1.2
  @@ -55,6 +55,9 @@
   package org.apache.commons.modeler.ant;
   
   import org.apache.tools.ant.*;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.logging.Log;
  +
   import javax.management.*;
   import javax.management.ObjectName;
   import javax.management.MBeanServer;
  @@ -74,34 +77,17 @@
    *
    */
   public class MLETTask extends Task {
  -
  +    private static Log log = LogFactory.getLog(MLETTask.class);
       String code;
       String archive;
       String codebase;
  -    String name;
  +    String objectName;
   
       Vector args;
   
       // ant specific
       String loaderRef; // class loader ref
   
  -
  -    public static class Arg {
  -        String type;
  -        String value;
  -
  -        public Arg() {
  -        }
  -
  -        public void setType(String type) {
  -            this.type = type;
  -        }
  -
  -        public void setValue(String value) {
  -            this.value = value;
  -        }
  -    }
  -
       public MLETTask() {
       }
   
  @@ -124,7 +110,7 @@
       }
   
       public void setName(String name) {
  -        this.name = name;
  +        this.objectName = name;
       }
   
       public void execute() throws BuildException {
  @@ -139,16 +125,17 @@
                       server=MBeanServerFactory.createMBeanServer();
                       MLet mlet=new MLet( new URL[0], this.getClass().getClassLoader());
                       server.registerMBean(mlet, defaultLoader);
  -                    System.out.println("Creating mbean server and loader "+ mlet +
  -                            " " + this.getClass().getClassLoader());
  +                    if( log.isDebugEnabled())
  +                        log.debug("Creating mbean server and loader "+ mlet +
  +                                " " + this.getClass().getClassLoader());
                   }
                   project.addReference("jmx.server", server);
                   // Create the MLet object
               }
   
  -            System.out.println("Using Mserver " + server );
  +            if( log.isDebugEnabled()) log.debug("Using Mserver " + server );
   
  -            ObjectName oname=new ObjectName( name );
  +            ObjectName oname=new ObjectName( objectName );
               if( args==null ) {
                   // XXX Use the loader ref, if any
                   server.createMBean(code, oname, defaultLoader);
  @@ -160,8 +147,8 @@
                       Arg arg=(Arg)args.elementAt(i);
                       if( arg.type==null )
                           arg.type="java.lang.String";
  -                    sigA[i]=arg.type;
  -                    argsA[i]=arg.value;
  +                    sigA[i]=arg.getType();
  +                    argsA[i]=arg.getValue();
                       // XXX Deal with not string types - IntrospectionUtils
                   }
                   server.createMBean(code, oname, defaultLoader, argsA, sigA );
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message