Author: markt
Date: Sat Nov 25 10:37:02 2006
New Revision: 479161

URL: http://svn.apache.org/viewvc?view=rev&rev=479161
Log:
Code clean up in o.a.c.mbeans
 - Removed unused code and imports
 - Corrected use of deprecated code

Modified:
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java?view=diff&rev=479161&r1=479160&r2=479161
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
 Sat Nov 25 10:37:02 2006
@@ -55,7 +55,6 @@
 import org.apache.catalina.valves.RequestDumperValve;
 import org.apache.catalina.valves.ValveBase;
 import org.apache.commons.modeler.BaseModelMBean;
-import org.apache.commons.modeler.Registry;
 
 
 /**
@@ -76,12 +75,6 @@
      */
     private static MBeanServer mserver = MBeanUtils.createServer();
 
-    /**
-     * The configuration information registry for our managed beans.
-     */
-    private static Registry registry = MBeanUtils.createRegistry();
-
-
     // ----------------------------------------------------------- Constructors
 
 
@@ -448,7 +441,6 @@
 
          // Create a new JAASRealm instance
         JAASRealm realm = new JAASRealm();
-        realm.setAppName(appName);
         realm.setUserClassNames(userClassNames);
         realm.setRoleClassNames(roleClassNames);
         if("true".equals(useContextClassLoader) ||
@@ -918,7 +910,6 @@
 
         // Acquire a reference to the component to be removed
         ObjectName oname = new ObjectName(name);
-        Server server = ServerFactory.getServer();
         Service service = getService(oname);
         String port = oname.getKeyProperty("port");
         //String address = oname.getKeyProperty("address");
@@ -1108,7 +1099,6 @@
         // Acquire a reference to the component to be removed
         ObjectName oname = new ObjectName(name);
         ContainerBase container = getParentContainerFromChild(oname);
-        String sequence = oname.getKeyProperty("seq");
         Valve[] valves = (Valve[])container.getValves();
         for (int i = 0; i < valves.length; i++) {
             ObjectName voname = ((ValveBase) valves[i]).getObjectName();

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java?view=diff&rev=479161&r1=479160&r2=479161
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java
 Sat Nov 25 10:37:02 2006
@@ -740,10 +740,6 @@
                     IntrospectionUtils.getProperty(connector, "address");
                 Integer port = (Integer)
                     IntrospectionUtils.getProperty(connector, "port");
-                Service service = connector.getService();
-                String serviceName = null;
-                if (service != null)
-                    serviceName = service.getName();
                 StringBuffer sb = new StringBuffer(domain);
                 sb.append(":type=Connector");
                 sb.append(",port=" + port);
@@ -779,7 +775,6 @@
 
         ObjectName name = null;
         Host host = (Host)context.getParent();
-        Service service = ((Engine)host.getParent()).getService();
         String path = context.getPath();
         if (path.length() < 1)
             path = "/";
@@ -817,8 +812,6 @@
             if (path.length() < 1)
                 path = "/";
             Host host = (Host) ((Context)container).getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Environment" + 
                         ",resourcetype=Context,path=" + path + 
                         ",host=" + host.getName() +
@@ -855,8 +848,6 @@
             if (path.length() < 1)
                 path = "/";
             Host host = (Host) ((Context)container).getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Resource" +
                         ",resourcetype=Context,path=" + path + 
                         ",host=" + host.getName() +
@@ -896,8 +887,6 @@
             if (path.length() < 1)
                 path = "/";
             Host host = (Host) ((Context)container).getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=ResourceLink" +
                         ",resourcetype=Context,path=" + path + 
                         ",host=" + host.getName() +
@@ -966,8 +955,6 @@
         throws MalformedObjectNameException {
 
         ObjectName name = null;
-        Engine engine = (Engine)host.getParent();
-        Service service = engine.getService();
         name = new ObjectName(domain + ":type=Host,host=" +
                               host.getName());
         return (name);
@@ -992,11 +979,8 @@
         Container container = loader.getContainer();
 
         if (container instanceof Engine) {
-            Service service = ((Engine)container).getService();
             name = new ObjectName(domain + ":type=Loader");
         } else if (container instanceof Host) {
-            Engine engine = (Engine) container.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Loader,host=" +
                               container.getName());
         } else if (container instanceof Context) {
@@ -1005,8 +989,6 @@
                 path = "/";
             }
             Host host = (Host) container.getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Loader,path=" + path +
                               ",host=" + host.getName());
         }
@@ -1033,11 +1015,8 @@
         Container container = manager.getContainer();
 
         if (container instanceof Engine) {
-            Service service = ((Engine)container).getService();
             name = new ObjectName(domain + ":type=Manager");
         } else if (container instanceof Host) {
-            Engine engine = (Engine) container.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Manager,host=" +
                               container.getName());
         } else if (container instanceof Context) {
@@ -1046,8 +1025,6 @@
                 path = "/";
             }
             Host host = (Host) container.getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Manager,path=" + path +
                               ",host=" + host.getName());
         }
@@ -1080,8 +1057,6 @@
             if (path.length() < 1)
                 path = "/";
             Host host = (Host) ((Context)container).getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=NamingResources" + 
                         ",resourcetype=Context,path=" + path + 
                         ",host=" + host.getName());
@@ -1129,11 +1104,8 @@
         Container container = realm.getContainer();
 
         if (container instanceof Engine) {
-            Service service = ((Engine)container).getService();
             name = new ObjectName(domain + ":type=Realm");
         } else if (container instanceof Host) {
-            Engine engine = (Engine) container.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Realm,host=" +
                               container.getName());
         } else if (container instanceof Context) {
@@ -1142,8 +1114,6 @@
                 path = "/";
             }
             Host host = (Host) container.getParent();
-            Engine engine = (Engine) host.getParent();
-            Service service = engine.getService();
             name = new ObjectName(domain + ":type=Realm,path=" + path +
                               ",host=" + host.getName());
         }
@@ -1292,7 +1262,6 @@
                                valve);
         }        
         if (container instanceof Engine) {
-            Service service = ((Engine)container).getService();
             String local="";
             int seq = getSeq(local);
             String ext="";
@@ -1302,7 +1271,6 @@
             name = new ObjectName(domain + ":type=Valve,name=" + className + 
                                     ext + local );
         } else if (container instanceof Host) {
-            Service service = ((Engine)container.getParent()).getService();
             String local=",host=" +container.getName();
             int seq = getSeq(local);
             String ext="";
@@ -1317,7 +1285,6 @@
                 path = "/";
             }
             Host host = (Host) container.getParent();
-            Service service = ((Engine) host.getParent()).getService();
             String local=",path=" + path + ",host=" +
                     host.getName();
             int seq = getSeq(local);

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java?view=diff&rev=479161&r1=479160&r2=479161
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java
 Sat Nov 25 10:37:02 2006
@@ -19,7 +19,6 @@
 
 
 import javax.management.MBeanException;
-import javax.management.MBeanServer;
 import javax.management.RuntimeOperationsException;
 
 import org.apache.commons.modeler.BaseModelMBean;
@@ -35,11 +34,6 @@
 
 public class StandardEngineMBean extends BaseModelMBean {
 
-    /**
-     * The <code>MBeanServer</code> for this application.
-     */
-    private static MBeanServer mserver = MBeanUtils.createServer();
-    
     // ----------------------------------------------------------- Constructors
 
 

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java?view=diff&rev=479161&r1=479160&r2=479161
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java
 Sat Nov 25 10:37:02 2006
@@ -20,7 +20,6 @@
 
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanException;
-import javax.management.MBeanServer;
 import javax.management.RuntimeOperationsException;
 import org.apache.catalina.Server;
 import org.apache.catalina.ServerFactory;
@@ -37,15 +36,6 @@
  */
 
 public class StandardServerMBean extends BaseModelMBean {
-
-
-    // ------------------------------------------------------- Static Variables
-
-
-    /**
-     * The <code>MBeanServer</code> for this application.
-     */
-    private static MBeanServer mserver = MBeanUtils.createServer();
 
 
     // ----------------------------------------------------------- Constructors

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java?view=diff&rev=479161&r1=479160&r2=479161
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java
 Sat Nov 25 10:37:02 2006
@@ -19,7 +19,6 @@
 
 
 import javax.management.MBeanException;
-import javax.management.MBeanServer;
 import javax.management.RuntimeOperationsException;
 
 import org.apache.commons.modeler.BaseModelMBean;
@@ -34,11 +33,6 @@
  */
 
 public class StandardServiceMBean extends BaseModelMBean {
-
-    /**
-     * The <code>MBeanServer</code> for this application.
-     */
-    private static MBeanServer mserver = MBeanUtils.createServer();
     
     // ----------------------------------------------------------- Constructors
 



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

Reply via email to