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 Wed, 09 Apr 2003 07:22:51 GMT
costin      2003/04/09 00:22:50

  Modified:    modeler/src/java/org/apache/commons/modeler/mbeans
                        SimpleRemoteConnector.java
  Log:
  Bug in refreshing remote values
  
  Revision  Changes    Path
  1.3       +8 -6      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleRemoteConnector.java	8 Apr 2003 04:09:09 -0000	1.2
  +++ SimpleRemoteConnector.java	9 Apr 2003 07:22:50 -0000	1.3
  @@ -122,7 +122,7 @@
       // XXX Not used - allow translations
       String localDomain;
       String filter;
  -    
  +
       //
       long lastRefresh=0;
       long updateInterval=5000; // 5 sec - it's min time between updates
  @@ -276,7 +276,8 @@
                   String name=(String)it.next();
                   Attributes attrs=(Attributes)entries.get( name );
   
  -                MBeanProxy proxy=(MBeanProxy)mbeans.get(name);
  +                ObjectName oname=new ObjectName(name);
  +                MBeanProxy proxy=(MBeanProxy)mbeans.get(oname);
                   if( proxy==null ) {
                       log.debug( "New object " + name);
                       String code=attrs.getValue("modelerType");
  @@ -284,13 +285,14 @@
                           log.debug("Register " + name  + " " + code );
   
                       proxy= new MBeanProxy(this, code);
  -
  +                    mbeans.put( oname, proxy );
   
                       // Register
                       MBeanServer mserver=Registry.getRegistry().getMBeanServer();
  -                    ObjectName oname=new ObjectName(name);
  -                    mserver.registerMBean(proxy, oname);
  -                } 
  +                    if( ! mserver.isRegistered(oname ) ) {
  +                        mserver.registerMBean(proxy, oname);
  +                    }
  +                }
                   Iterator it2=attrs.keySet().iterator();
                   while( it2.hasNext() ) {
                       Object o=it2.next();
  
  
  

---------------------------------------------------------------------
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