tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java
Date Fri, 25 Jan 2002 23:15:09 GMT
amyroh      02/01/25 15:15:09

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        MBeanUtils.java
  Log:
  Add sequence parameter to MBean object names for Valves
  so it returns unique names for each Valve Mbean
  
  Revision  Changes    Path
  1.16      +33 -12    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
  
  Index: MBeanUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MBeanUtils.java	24 Jan 2002 19:26:11 -0000	1.15
  +++ MBeanUtils.java	25 Jan 2002 23:15:09 -0000	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
1.15 2002/01/24 19:26:11 craigmcc Exp $
  - * $Revision: 1.15 $
  - * $Date: 2002/01/24 19:26:11 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v
1.16 2002/01/25 23:15:09 amyroh Exp $
  + * $Revision: 1.16 $
  + * $Date: 2002/01/25 23:15:09 $
    *
    * ====================================================================
    *
  @@ -106,7 +106,7 @@
    *
    * @author Craig R. McClanahan
    * @author Amy Roh
  - * @version $Revision: 1.15 $ $Date: 2002/01/24 19:26:11 $
  + * @version $Revision: 1.16 $ $Date: 2002/01/25 23:15:09 $
    */
   
   public class MBeanUtils {
  @@ -144,6 +144,14 @@
       private static MBeanServer mserver = createServer();
   
   
  +    /**
  +     * The sequence number for Valve
  +     */
  +    private static int contextValveSequence = 0;
  +    private static int hostValveSequence = 0;
  +    private static int engineValveSequence = 0;
  +
  +
       // --------------------------------------------------------- Static Methods
   
   
  @@ -1019,13 +1027,21 @@
   
           if (container instanceof Engine) {
               Service service = ((Engine)container).getService();
  -            name = new ObjectName(domain + ":type=Valve,service=" +
  -                              service.getName());  //FIX ME - add sequence #
  +            Integer sequenceInt = new Integer(engineValveSequence);
  +            String sequenceStr = sequenceInt.toString();
  +            name = new ObjectName(domain + ":type=Valve,sequence=" +
  +                                sequenceStr + ",service=" +
  +                                service.getName());
  +            engineValveSequence++;
           } else if (container instanceof Host) {
               Service service = ((Engine)container.getParent()).getService();
  -            name = new ObjectName(domain + ":type=Valve,host=" +
  -                              container.getName() + ",service=" +
  -                              service.getName());  //FIX ME - add sequence #
  +            Integer sequenceInt = new Integer(hostValveSequence);
  +            String sequenceStr = sequenceInt.toString();
  +            name = new ObjectName(domain + ":type=Valve,sequence=" +
  +                                sequenceStr + ",host=" +
  +                                container.getName() + ",service=" +
  +                                service.getName());
  +            hostValveSequence++;
           } else if (container instanceof Context) {
               String path = ((Context)container).getPath();
               if (path.length() < 1) {
  @@ -1033,9 +1049,14 @@
               }
               Host host = (Host) container.getParent();
               Service service = ((Engine)container.getParent()).getService();
  -            name = new ObjectName(domain + ":type=Valve,path=" + path +
  -                              ",host=" + host.getName() + ",service=" +
  -                              service.getName());  //FIX ME - add sequence #
  +            Integer sequenceInt = new Integer(contextValveSequence);
  +            String sequenceStr = sequenceInt.toString();
  +            name = new ObjectName(domain + ":type=Valve,sequence=" +
  +                                sequenceStr + ",path=" +
  +                                path + ",host=" +
  +                                host.getName() + ",service=" +
  +                                service.getName());
  +            contextValveSequence++;
           }
   
           return (name);
  
  
  

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