tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1240108 - in /tomcat/trunk/java/org/apache/catalina: ./ core/ loader/ realm/ session/ startup/ valves/
Date Fri, 03 Feb 2012 12:10:33 GMT
Author: markt
Date: Fri Feb  3 12:10:32 2012
New Revision: 1240108

URL: http://svn.apache.org/viewvc?rev=1240108&view=rev
Log:
Refactor to remove circular dependencies

Modified:
    tomcat/trunk/java/org/apache/catalina/Container.java
    tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
    tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
    tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
    tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
    tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
    tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java
    tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java

Modified: tomcat/trunk/java/org/apache/catalina/Container.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Container.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Container.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Container.java Fri Feb  3 12:10:32 2012
@@ -161,6 +161,13 @@ public interface Container extends Lifec
 
 
     /**
+     * Obtain the domain under which this container will be / has been
+     * registered.
+     */
+    public String getDomain();
+
+
+    /**
      * Calculate the key properties string to be added to an object's
      * {@link ObjectName} to indicate that it is associated with this container.
      *

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Fri Feb  3 12:10:32 2012
@@ -60,7 +60,6 @@ import org.apache.catalina.Valve;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.ContextName;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.juli.logging.Log;
@@ -1407,7 +1406,13 @@ public abstract class ContainerBase exte
 
     @Override
     protected String getDomainInternal() {
-        return MBeanUtils.getDomain(this);
+
+        Container p = this.getParent();
+        if (p == null) {
+            return null;
+        } else {
+            return p.getDomain();
+        }
     }
 
 

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardEngine.java Fri Feb  3 12:10:32 2012
@@ -374,6 +374,13 @@ public class StandardEngine extends Cont
         return "type=Engine";
     }
 
+
+    @Override
+    protected String getDomainInternal() {
+        return getName();
+    }
+
+
     // ----------------------------------------------------------- Inner classes
     protected static final class NoopAccessLog implements AccessLog {
 

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Fri Feb  3 12:10:32 2012
@@ -57,7 +57,6 @@ import org.apache.catalina.InstanceListe
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Wrapper;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.security.SecurityUtil;
 import org.apache.catalina.util.InstanceSupport;
 import org.apache.juli.logging.Log;
@@ -1042,8 +1041,7 @@ public class StandardWrapper extends Con
         }
 
         if (isJspServlet) {
-            StringBuilder oname =
-                new StringBuilder(MBeanUtils.getDomain(getParent()));
+            StringBuilder oname = new StringBuilder(getDomain());
 
             oname.append(":type=JspMonitor,name=");
             oname.append(getName());

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Fri Feb  3 12:10:32 2012
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.loader;
 
 
@@ -53,7 +51,6 @@ import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Loader;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.naming.resources.DirContextURLStreamHandler;
 import org.apache.naming.resources.DirContextURLStreamHandlerFactory;
@@ -583,8 +580,7 @@ public class WebappLoader extends Lifecy
             if (!contextName.startsWith("/")) {
                 contextName = "/" + contextName;
             }
-            ObjectName cloname = new ObjectName(
-                    MBeanUtils.getDomain(container) +
+            ObjectName cloname = new ObjectName(container.getDomain() +
                     ":type=WebappClassLoader,context=" + contextName +
                     ",host=" + container.getParent().getName());
             Registry.getRegistry(null, null)
@@ -632,8 +628,7 @@ public class WebappLoader extends Lifecy
             if (!contextName.startsWith("/")) {
                 contextName = "/" + contextName;
             }
-            ObjectName cloname = new ObjectName(
-                    MBeanUtils.getDomain(container) +
+            ObjectName cloname = new ObjectName(container.getDomain() +
                     ":type=WebappClassLoader,context=" + contextName +
                     ",host=" + container.getParent().getName());
             Registry.getRegistry(null, null).unregisterComponent(cloname);
@@ -1145,7 +1140,7 @@ public class WebappLoader extends Lifecy
 
     @Override
     protected String getDomainInternal() {
-        return MBeanUtils.getDomain(container);
+        return container.getDomain();
     }
 
 

Modified: tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java Fri Feb  3 12:10:32 2012
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.realm;
 
 
@@ -48,7 +46,6 @@ import org.apache.catalina.core.Applicat
 import org.apache.catalina.deploy.LoginConfig;
 import org.apache.catalina.deploy.SecurityCollection;
 import org.apache.catalina.deploy.SecurityConstraint;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.MD5Encoder;
 import org.apache.juli.logging.Log;
@@ -1320,7 +1317,7 @@ public abstract class RealmBase extends 
 
     @Override
     public String getDomainInternal() {
-        return MBeanUtils.getDomain(container);
+        return container.getDomain();
     }
 
     protected String realmPath = "/realm0";

Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Fri Feb  3 12:10:32 2012
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.session;
 
 
@@ -41,7 +39,6 @@ import org.apache.catalina.Engine;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.Manager;
 import org.apache.catalina.Session;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.SessionIdGenerator;
 import org.apache.juli.logging.Log;
@@ -1256,7 +1253,7 @@ public abstract class ManagerBase extend
 
     @Override
     public String getDomainInternal() {
-        return MBeanUtils.getDomain(container);
+        return container.getDomain();
     }
 
     // ----------------------------------------- PropertyChangeListener Methods

Modified: tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/FailedContext.java Fri Feb  3 12:10:32 2012
@@ -53,7 +53,6 @@ import org.apache.catalina.deploy.Filter
 import org.apache.catalina.deploy.LoginConfig;
 import org.apache.catalina.deploy.NamingResources;
 import org.apache.catalina.deploy.SecurityConstraint;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.CharsetMapper;
 import org.apache.catalina.util.ContextName;
 import org.apache.catalina.util.LifecycleMBeanBase;
@@ -122,7 +121,14 @@ public class FailedContext extends Lifec
 
 
     @Override
-    protected String getDomainInternal() { return MBeanUtils.getDomain(this); }
+    protected String getDomainInternal() {
+        Container p = getParent();
+        if (p == null) {
+            return null;
+        } else {
+            return p.getDomain();
+        }
+    }
 
 
     @Override

Modified: tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java?rev=1240108&r1=1240107&r2=1240108&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ValveBase.java Fri Feb  3 12:10:32 2012
@@ -30,7 +30,6 @@ import org.apache.catalina.Valve;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.res.StringManager;
@@ -308,6 +307,11 @@ public abstract class ValveBase extends 
 
     @Override
     public String getDomainInternal() {
-        return MBeanUtils.getDomain(getContainer());
+        Container c = getContainer();
+        if (c == null) {
+            return null;
+        } else {
+            return c.getDomain();
+        }
     }
 }



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


Mime
View raw message