tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager JMXProxyServlet.java
Date Mon, 03 Nov 2003 22:22:43 GMT
remm        2003/11/03 14:22:43

  Modified:    webapps/manager/WEB-INF/classes/org/apache/catalina/manager
                        JMXProxyServlet.java
  Log:
  - Make output compatible with Ant task.
  - Bug 24250.
  - Submitted by Peter Rossbach.
  
  Revision  Changes    Path
  1.5       +20 -13    jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/JMXProxyServlet.java
  
  Index: JMXProxyServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/manager/WEB-INF/classes/org/apache/catalina/manager/JMXProxyServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JMXProxyServlet.java	17 Apr 2003 19:45:46 -0000	1.4
  +++ JMXProxyServlet.java	3 Nov 2003 22:22:43 -0000	1.5
  @@ -128,7 +128,7 @@
           String qryString= request.getQueryString();
   
           if( mBeanServer==null ) {
  -            writer.println("Error: No mbean server");
  +            writer.println("Error - No mbean server");
               return;
           }
   
  @@ -158,28 +158,35 @@
               String type=registry.getType(oname, att);
               Object valueObj=registry.convertValue(type, val );
               mBeanServer.setAttribute( oname, new Attribute(att, valueObj));
  -            writer.println("Result: ok");
  +            writer.println("OK - Attribute set");
           } catch( Exception ex ) {
  -            writer.println("Error: " + ex.toString());
  +            writer.println("Error - " + ex.toString());
           }
       }
   
       public void listBeans( PrintWriter writer, String qry )
       {
  +
  +        Set names = null;
           try {
  -            Set names=mBeanServer.queryNames(new ObjectName(qry), null);
  -            writer.println("MbeanCount: " + names.size());
  +            names=mBeanServer.queryNames(new ObjectName(qry), null);
  +            writer.println("OK - Number of results: " + names.size());
               writer.println();
  +        } catch (Exception e) {
  +            writer.println("Error - " + e.toString());
  +            return;
  +        }
   
  -            Iterator it=names.iterator();
  -            while( it.hasNext()) {
  -                ObjectName oname=(ObjectName)it.next();
  +        Iterator it=names.iterator();
  +        while( it.hasNext()) {
  +            ObjectName oname=(ObjectName)it.next();
  +            writer.println( "Name: " + oname.toString());
   
  -                writer.println( "Name: " + oname.toString());
  +            try {
                   MBeanInfo minfo=mBeanServer.getMBeanInfo(oname);
                   // can't be null - I thinl
                   String code=minfo.getClassName();
  -                if( "org.apache.commons.modeler.BaseModelMBean".equals( code ) ) {
  +                if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
                       code=(String)mBeanServer.getAttribute(oname, "modelerType");
                   }
                   writer.println("modelerType: " + code);
  @@ -209,10 +216,10 @@
                       String valueString=value.toString();
                       writer.println( attName + ": " + escape(valueString));
                   }
  -                writer.println();
  +            } catch (Exception e) {
  +                // Ignore
               }
  -        } catch (Exception e) {
  -            e.printStackTrace();
  +            writer.println();
           }
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message