tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1240111 - in /tomcat/trunk/java/org/apache/catalina: Service.java connector/Connector.java core/StandardServer.java core/StandardService.java
Date Fri, 03 Feb 2012 12:12:36 GMT
Author: markt
Date: Fri Feb  3 12:12:35 2012
New Revision: 1240111

URL: http://svn.apache.org/viewvc?rev=1240111&view=rev
Log:
More refactoring to remove some cyclic dependencies

Modified:
    tomcat/trunk/java/org/apache/catalina/Service.java
    tomcat/trunk/java/org/apache/catalina/connector/Connector.java
    tomcat/trunk/java/org/apache/catalina/core/StandardServer.java
    tomcat/trunk/java/org/apache/catalina/core/StandardService.java

Modified: tomcat/trunk/java/org/apache/catalina/Service.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Service.java?rev=1240111&r1=1240110&r2=1240111&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Service.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Service.java Fri Feb  3 12:12:35 2012
@@ -91,9 +91,15 @@ public interface Service extends Lifecyc
      */
     public void setParentClassLoader(ClassLoader parent);
 
-    // --------------------------------------------------------- Public Methods
+    /**
+     * Obtain the domain under which this container will be / has been
+     * registered.
+     */
+    public String getDomain();
 
 
+    // --------------------------------------------------------- Public Methods
+
     /**
      * Add a new Connector to the set of defined Connectors, and associate it
      * with this Service's Container.

Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1240111&r1=1240110&r2=1240111&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Fri Feb  3 12:12:35 2012
@@ -27,7 +27,6 @@ import org.apache.catalina.LifecycleExce
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Service;
 import org.apache.catalina.core.AprLifecycleListener;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.coyote.Adapter;
 import org.apache.coyote.ProtocolHandler;
@@ -1049,7 +1048,12 @@ public class Connector extends Lifecycle
 
     @Override
     protected String getDomainInternal() {
-        return MBeanUtils.getDomain(getService());
+        Service s = getService();
+        if (s == null) {
+            return null;
+        } else {
+            return service.getDomain();
+        }
     }
 
     @Override

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardServer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardServer.java?rev=1240111&r1=1240110&r2=1240111&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardServer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardServer.java Fri Feb  3 12:12:35 2012
@@ -36,7 +36,6 @@ import org.apache.catalina.Server;
 import org.apache.catalina.Service;
 import org.apache.catalina.deploy.NamingResources;
 import org.apache.catalina.mbeans.MBeanFactory;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.startup.Catalina;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.ServerInfo;
@@ -859,7 +858,7 @@ public final class StandardServer extend
         if (services.length > 0) {
             Service service = services[0];
             if (service != null) {
-                domain = MBeanUtils.getDomain(service);
+                domain = service.getDomain();
             }
         }
         return domain;

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=1240111&r1=1240110&r2=1240111&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Fri Feb  3 12:12:35 2012
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.catalina.core;
 
 
@@ -33,7 +31,6 @@ import org.apache.catalina.LifecycleStat
 import org.apache.catalina.Server;
 import org.apache.catalina.Service;
 import org.apache.catalina.connector.Connector;
-import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -598,10 +595,25 @@ public class StandardService extends Lif
         support.firePropertyChange("parentClassLoader", oldParentClassLoader,
                                    this.parentClassLoader);
     }
+
     @Override
     protected String getDomainInternal() {
+        String domain = null;
+        Container engine = getContainer();
+
+        // Use the engine name first
+        if (engine != null) {
+            domain = engine.getName();
+        }
+
+        // No engine or no engine name, use the service name
+        if (domain == null) {
+            domain = getName();
+        }
 
-        return MBeanUtils.getDomain(this);
+        // No service name, return null which will trigger the use of the
+        // default
+        return domain;
     }
 
     @Override



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


Mime
View raw message