tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/common JkMX.java
Date Fri, 09 Aug 2002 20:53:21 GMT
costin      2002/08/09 13:53:21

  Modified:    jk/java/org/apache/jk/common JkMX.java
  Log:
  Update to match the fixes in DynamicMBeanProxy.
  
  Register JkMain as an mbean.
  
  Revision  Changes    Path
  1.6       +6 -17     jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java
  
  Index: JkMX.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JkMX.java	8 Aug 2002 18:19:53 -0000	1.5
  +++ JkMX.java	9 Aug 2002 20:53:21 -0000	1.6
  @@ -63,6 +63,7 @@
   import java.util.*;
   
   import org.apache.jk.core.*;
  +import org.apache.jk.server.JkMain;
   
   import javax.management.*;
   
  @@ -103,20 +104,6 @@
       public String getHost() {
           return host;
       }
  -    
  -    public void createMBean( Object proxy, String name ) {
  -        try {
  -            DynamicMBeanProxy mbean=new DynamicMBeanProxy();
  -            mbean.setReal( proxy );
  -            if( name!=null ) {
  -                mbean.setName( name );
  -            }
  -
  -            mbean.registerMBean( "jk2" );
  -        } catch( Throwable t ) {
  -            log.error( "Error creating mbean ", t );
  -        }
  -    }
   
       /* ==================== Start/stop ==================== */
       ObjectName serverName=null;
  @@ -205,15 +192,17 @@
               try {
                   Class c=Class.forName( "org.apache.log4j.jmx.HierarchyDynamicMBean" );
                   Object o=c.newInstance();
  -                log.info("Registering the root hierarchy for JMX ");
  +                log.info("Registering the JMX hierarchy for Log4J ");
                   mserver.registerMBean(o, new ObjectName("log4j:hierarchy=default"));
               } catch( Throwable t ) {
                   log.info("Can't enable log4j mx");
               }
   
  +            DynamicMBeanProxy.createMBean( JkMain.getJkMain(), "jk2", "name=JkMain" );

  +            
               for( int i=0; i< wEnv.getHandlerCount(); i++ ) {
                   JkHandler h=wEnv.getHandler( i );
  -                createMBean( h, h.getName() );
  +                DynamicMBeanProxy.createMBean( h, "jk2", "name=" + h.getName() );
               }
               
           } catch( Throwable t ) {
  @@ -223,7 +212,7 @@
   
       public void addHandlerCallback( JkHandler w ) {
           if( w!=this ) {
  -            createMBean( w, w.getName() );
  +            DynamicMBeanProxy.createMBean( w, "jk2", "name=" + w.getName() );
           }
       }
   
  
  
  

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


Mime
View raw message