tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1240333 - in /tomcat/trunk/java/org/apache/catalina: core/StandardService.java deploy/NamingResources.java mbeans/ContainerMBean.java mbeans/MBeanFactory.java
Date Fri, 03 Feb 2012 20:11:19 GMT
Author: markt
Date: Fri Feb  3 20:11:19 2012
New Revision: 1240333

URL: http://svn.apache.org/viewvc?rev=1240333&view=rev
Log:
Use new interface where appropriate

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardService.java
    tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
    tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java
    tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1240333&r1=1240332&r2=1240333&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Fri Feb  3 20:11:19 2012
@@ -26,6 +26,7 @@ import javax.management.ObjectName;
 import org.apache.catalina.Container;
 import org.apache.catalina.Engine;
 import org.apache.catalina.Executor;
+import org.apache.catalina.JmxEnabled;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Server;
@@ -520,8 +521,8 @@ public class StandardService extends Lif
 
         // Initialize any Executors
         for (Executor executor : findExecutors()) {
-            if (executor instanceof LifecycleMBeanBase) {
-                ((LifecycleMBeanBase) executor).setDomain(getDomain());
+            if (executor instanceof JmxEnabled) {
+                ((JmxEnabled) executor).setDomain(getDomain());
             }
             executor.init();
         }

Modified: tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java?rev=1240333&r1=1240332&r2=1240333&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/NamingResources.java Fri Feb  3 20:11:19
2012
@@ -32,6 +32,7 @@ import javax.naming.NamingException;
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
+import org.apache.catalina.JmxEnabled;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Server;
@@ -1075,8 +1076,8 @@ public class NamingResources extends Lif
         // Use the same domain as our associated container if we have one
         Object c = getContainer();
 
-        if (c instanceof LifecycleMBeanBase) {
-            return ((LifecycleMBeanBase) c).getDomain();
+        if (c instanceof JmxEnabled) {
+            return ((JmxEnabled) c).getDomain();
         }
 
         return null;

Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java?rev=1240333&r1=1240332&r2=1240333&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java Fri Feb  3 20:11:19 2012
@@ -29,6 +29,7 @@ import javax.management.modelmbean.Inval
 
 import org.apache.catalina.Container;
 import org.apache.catalina.ContainerListener;
+import org.apache.catalina.JmxEnabled;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Valve;
@@ -37,7 +38,6 @@ import org.apache.catalina.core.Standard
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.startup.HostConfig;
-import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.valves.ValveBase;
 import org.apache.tomcat.util.modeler.BaseModelMBean;
 
@@ -170,7 +170,11 @@ public class ContainerMBean extends Base
             throw new MBeanException(e);
         }
 
-        return ((LifecycleMBeanBase)valve).getObjectName().toString();
+        if (valve instanceof JmxEnabled) {
+            return ((JmxEnabled)valve).getObjectName().toString();
+        } else {
+            return null;
+        }
     }
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java?rev=1240333&r1=1240332&r2=1240333&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java Fri Feb  3 20:11:19 2012
@@ -44,7 +44,6 @@ import org.apache.catalina.realm.UserDat
 import org.apache.catalina.session.StandardManager;
 import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.startup.HostConfig;
-import org.apache.catalina.util.LifecycleMBeanBase;
 
 
 /**
@@ -674,7 +673,7 @@ public class MBeanFactory {
      *
      * @return  The MBean name of the {@link Valve} that was created or
      *          <code>null</code> if the {@link Valve} does not implement
-     *          {@link LifecycleMBeanBase}.
+     *          {@link JmxEnabled}.
      */
     public String createValve(String className, String parent)
             throws Exception {
@@ -925,7 +924,7 @@ public class MBeanFactory {
         Container container = getParentContainerFromChild(oname);
         Valve[] valves = container.getPipeline().getValves();
         for (int i = 0; i < valves.length; i++) {
-            ObjectName voname = ((LifecycleMBeanBase) valves[i]).getObjectName();
+            ObjectName voname = ((JmxEnabled) valves[i]).getObjectName();
             if (voname.equals(oname)) {
                 container.getPipeline().removeValve(valves[i]);
             }



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


Mime
View raw message