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/mbeans SimpleRemoteConnector.java
Date Tue, 08 Apr 2003 04:09:09 GMT
costin      2003/04/07 21:09:09

  Modified:    modeler/src/java/org/apache/commons/modeler/mbeans
                        SimpleRemoteConnector.java
  Log:
  Fix bug in loading the attribute value. Deal with non-existing local classes
  
  Revision  Changes    Path
  1.2       +23 -12    jakarta-commons/modeler/src/java/org/apache/commons/modeler/mbeans/SimpleRemoteConnector.java
  
  Index: SimpleRemoteConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/mbeans/SimpleRemoteConnector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleRemoteConnector.java	7 Apr 2003 07:17:34 -0000	1.1
  +++ SimpleRemoteConnector.java	8 Apr 2003 04:09:09 -0000	1.2
  @@ -121,7 +121,8 @@
   
       // XXX Not used - allow translations
       String localDomain;
  -
  +    String filter;
  +    
       //
       long lastRefresh=0;
       long updateInterval=5000; // 5 sec - it's min time between updates
  @@ -197,6 +198,13 @@
           this.statusPath = statusPath;
       }
   
  +    public String getFilter() {
  +        return filter;
  +    }
  +
  +    public void setFilter(String filter) {
  +        this.filter = filter;
  +    }
   
       /* ==================== Start/stop ==================== */
   
  @@ -253,8 +261,11 @@
           try {
               int cnt=0;
               // connect to apache, get a list of mbeans
  +            if( filter==null ) {
  +                filter=domain + ":*";
  +            }
   
  -            InputStream is=getStream( "qry=" + domain + ":*");
  +            InputStream is=getStream( "qry=" + filter);
               if( is==null ) return;
   
               Manifest mf=new Manifest(is);
  @@ -267,7 +278,7 @@
   
                   MBeanProxy proxy=(MBeanProxy)mbeans.get(name);
                   if( proxy==null ) {
  -                    log.info( "Unknown object " + name);
  +                    log.debug( "New object " + name);
                       String code=attrs.getValue("modelerType");
                       if(log.isDebugEnabled())
                           log.debug("Register " + name  + " " + code );
  @@ -279,15 +290,15 @@
                       MBeanServer mserver=Registry.getRegistry().getMBeanServer();
                       ObjectName oname=new ObjectName(name);
                       mserver.registerMBean(proxy, oname);
  -                } else {
  -                    Iterator it2=attrs.keySet().iterator();
  -                    while( it2.hasNext() ) {
  -                        String att=(String)it2.next();
  -                        if( "modelerType".equals( att )) continue;
  -                        String val=attrs.getValue(att);
  -                        proxy.update(att, val);
  -                        cnt++;
  -                    }
  +                } 
  +                Iterator it2=attrs.keySet().iterator();
  +                while( it2.hasNext() ) {
  +                    Object o=it2.next();
  +                    String att=(o==null) ? null : o.toString();
  +                    if( "modelerType".equals( att )) continue;
  +                    String val=attrs.getValue(att);
  +                    proxy.update(att, val);
  +                    cnt++;
                   }
               }
               log.info( "Refreshing attributes " + cnt);
  
  
  

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


Mime
View raw message