amyroh      02/04/15 13:57:06

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        MBeanFactory.java
  Log:
  Minor changes to be consistent with MBeanUtils.createObjectNames().
  
  Revision  Changes    Path
  1.25      +40 -61    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
  
  Index: MBeanFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- MBeanFactory.java 9 Apr 2002 23:54:35 -0000       1.24
  +++ MBeanFactory.java 15 Apr 2002 20:57:06 -0000      1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v
 1.24 2002/04/09 23:54:35 amyroh Exp $
  - * $Revision: 1.24 $
  - * $Date: 2002/04/09 23:54:35 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v
 1.25 2002/04/15 20:57:06 amyroh Exp $
  + * $Revision: 1.25 $
  + * $Date: 2002/04/15 20:57:06 $
    *
    * ====================================================================
    *
  @@ -117,7 +117,7 @@
    * <code>org.apache.catalina.core.StandardServer</code> component.</p>
    *
    * @author Amy Roh
  - * @version $Revision: 1.24 $ $Date: 2002/04/09 23:54:35 $
  + * @version $Revision: 1.25 $ $Date: 2002/04/15 20:57:06 $
    */
   
   public class MBeanFactory extends BaseModelMBean {
  @@ -196,18 +196,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("StandardContext")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               ((StandardContext)context).addValve(accessLogger);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               ((StandardEngine)engine).addValve(accessLogger);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               ((StandardHost)host).addValve(accessLogger);
           }
  @@ -348,7 +347,6 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  @@ -385,19 +383,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        // String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setLogger(fileLogger);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setLogger(fileLogger);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setLogger(fileLogger);
           }
  @@ -493,19 +489,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        // String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setRealm(realm);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setRealm(realm);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setRealm(realm);
           }
  @@ -535,19 +529,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        // String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setRealm(realm);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setRealm(realm);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setRealm(realm);
           }
  @@ -577,19 +569,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        // String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setRealm(realm);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setRealm(realm);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setRealm(realm);
           }
  @@ -619,18 +609,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("StandardContext")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               ((StandardContext)context).addValve(valve);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               ((StandardEngine)engine).addValve(valve);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               ((StandardHost)host).addValve(valve);
           }
  @@ -660,18 +649,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("StandardContext")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               ((StandardContext)context).addValve(valve);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               ((StandardEngine)engine).addValve(valve);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               ((StandardHost)host).addValve(valve);
           }
  @@ -701,18 +689,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("StandardContext")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               ((StandardContext)context).addValve(valve);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               ((StandardEngine)engine).addValve(valve);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               ((StandardHost)host).addValve(valve);
           }
  @@ -742,18 +729,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        String tname = findObjectName(type);
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("StandardContext")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               ((StandardContext)context).addValve(valve);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               ((StandardEngine)engine).addValve(valve);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               ((StandardHost)host).addValve(valve);
           }
  @@ -948,20 +934,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        // String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        //if (tname.equals("StandardContext")) {
  -        if (tname.equals("Context")) {        
  +        if (type.equals("Context")) {        
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setLogger(logger);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setLogger(logger);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setLogger(logger);
           }
  @@ -991,19 +974,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        //String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setLogger(logger);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setLogger(logger);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setLogger(logger);
           }
  @@ -1032,19 +1013,17 @@
           // Add the new instance to its parent component
           ObjectName pname = new ObjectName(parent);
           String type = pname.getKeyProperty("type");
  -        //String tname = findObjectName(type);
  -        String tname = type;
           Server server = ServerFactory.getServer();
           Service service = server.findService(pname.getKeyProperty("service"));
           Engine engine = (Engine) service.getContainer();
  -        if (tname.equals("Context")) {
  +        if (type.equals("Context")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               Context context =
                       (Context) host.findChild(pname.getKeyProperty("path"));
               context.setRealm(realm);
  -        } else if (tname.equals("Engine")) {
  +        } else if (type.equals("Engine")) {
               engine.setRealm(realm);
  -        } else if (tname.equals("Host")) {
  +        } else if (type.equals("Host")) {
               Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
               host.setRealm(realm);
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to