tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1043437 - in /tomcat/trunk/java/org/apache/coyote: AbstractProtocolHandler.java LocalStrings.properties ajp/AjpAprProtocol.java ajp/AjpProtocol.java http11/Http11AprProtocol.java http11/Http11NioProtocol.java http11/Http11Protocol.java
Date Wed, 08 Dec 2010 14:36:26 GMT
Author: markt
Date: Wed Dec  8 14:36:26 2010
New Revision: 1043437

URL: http://svn.apache.org/viewvc?rev=1043437&view=rev
Log:
Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
Move MBean registration from start() to init(). More MBean refactoring expected

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
    tomcat/trunk/java/org/apache/coyote/LocalStrings.properties
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java Wed Dec  8 14:36:26 2010
@@ -349,6 +349,23 @@ public abstract class AbstractProtocolHa
             getLog().info(sm.getString("abstractProtocolHandler.init",
                     getName()));
 
+        if (this.domain != null) {
+            try {
+                tpOname = new ObjectName(domain + ":" +
+                        "type=ThreadPool,name=" + getName());
+                Registry.getRegistry(null, null).registerComponent(endpoint,
+                        tpOname, null);
+            } catch (Exception e) {
+                getLog().error(sm.getString(
+                        "abstractProtocolHandler.mbeanRegistrationFailed",
+                        tpOname, getName()), e);
+            }
+            rgOname=new ObjectName(domain +
+                    ":type=GlobalRequestProcessor,name=" + getName());
+            Registry.getRegistry(null, null).registerComponent(getHandler(),
+                    rgOname, null );
+        }
+
         endpoint.setName(getName());
 
         try {
@@ -418,9 +435,9 @@ public abstract class AbstractProtocolHa
                     getName()), e);
         }
         
-        if( tpOname!=null )
+        if (tpOname != null)
             Registry.getRegistry(null, null).unregisterComponent(tpOname);
-        if( rgOname != null )
+        if (rgOname != null)
             Registry.getRegistry(null, null).unregisterComponent(rgOname);
     }
 }

Modified: tomcat/trunk/java/org/apache/coyote/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/LocalStrings.properties?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/LocalStrings.properties Wed Dec  8 14:36:26 2010
@@ -17,6 +17,7 @@ abstractProtocolHandler.getAttribute=Get
 abstractProtocolHandler.setAttribute=Set attribute [{0}] with value [{1}]
 abstractProtocolHandler.init=Initializing ProtocolHandler [{0}]
 abstractProtocolHandler.initError=Failed to initialize end point associated with ProtocolHandler
[{0}]
+abstractProtocolHandler.mbeanRegistrationFailed=Failed to register MBean [{0}] for ProtocolHandler
[{1}]
 abstractProtocolHandler.pause=Pausing ProtocolHandler [{0}]
 abstractProtocolHandler.pauseError=Failed to pause end point associated with ProtocolHandler
[{0}]
 abstractProtocolHandler.resume=Resuming ProtocolHandler [{0}]

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Wed Dec  8 14:36:26 2010
@@ -88,21 +88,6 @@ public class AjpAprProtocol extends Abst
 
     @Override
     public void start() throws Exception {
-        if (this.domain != null ) {
-            try {
-                tpOname = new ObjectName
-                    (domain + ":" + "type=ThreadPool,name=" + getName());
-                Registry.getRegistry(null, null)
-                    .registerComponent(endpoint, tpOname, null );
-            } catch (Exception e) {
-                log.error("Can't register threadpool" );
-            }
-            rgOname = new ObjectName
-                (domain + ":type=GlobalRequestProcessor,name=" + getName());
-            Registry.getRegistry(null, null).registerComponent
-                (cHandler.global, rgOname, null);
-        }
-
         try {
             endpoint.start();
         } catch (Exception ex) {

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java Wed Dec  8 14:36:26 2010
@@ -88,21 +88,6 @@ public class AjpProtocol extends Abstrac
 
     @Override
     public void start() throws Exception {
-        if (this.domain != null ) {
-            try {
-                tpOname = new ObjectName
-                    (domain + ":" + "type=ThreadPool,name=" + getName());
-                Registry.getRegistry(null, null)
-                    .registerComponent(endpoint, tpOname, null );
-            } catch (Exception e) {
-                log.error("Can't register threadpool" );
-            }
-            rgOname = new ObjectName
-                (domain + ":type=GlobalRequestProcessor,name=" + getName());
-            Registry.getRegistry(null, null).registerComponent
-                (cHandler.global, rgOname, null);
-        }
-
         try {
             endpoint.start();
         } catch (Exception ex) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Wed Dec  8 14:36:26
2010
@@ -81,21 +81,6 @@ public class Http11AprProtocol extends A
 
     @Override
     public void start() throws Exception {
-        if( this.domain != null ) {
-            try {
-                tpOname=new ObjectName
-                    (domain + ":" + "type=ThreadPool,name=" + getName());
-                Registry.getRegistry(null, null)
-                .registerComponent(endpoint, tpOname, null );
-            } catch (Exception e) {
-                log.error("Can't register threadpool" );
-            }
-            rgOname=new ObjectName
-                (domain + ":type=GlobalRequestProcessor,name=" + getName());
-            Registry.getRegistry(null, null).registerComponent
-                ( cHandler.global, rgOname, null );
-        }
-
         try {
             endpoint.start();
         } catch (Exception ex) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Dec  8 14:36:26
2010
@@ -83,21 +83,6 @@ public class Http11NioProtocol extends A
 
     @Override
     public void start() throws Exception {
-        if( this.domain != null ) {
-            try {
-                tpOname=new ObjectName
-                    (domain + ":" + "type=ThreadPool,name=" + getName());
-                Registry.getRegistry(null, null)
-                .registerComponent(endpoint, tpOname, null );
-            } catch (Exception e) {
-                log.error("Can't register threadpool" );
-            }
-            rgOname=new ObjectName
-                (domain + ":type=GlobalRequestProcessor,name=" + getName());
-            Registry.getRegistry(null, null).registerComponent
-                ( cHandler.global, rgOname, null );
-        }
-
         try {
             endpoint.start();
         } catch (Exception ex) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1043437&r1=1043436&r2=1043437&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Wed Dec  8 14:36:26 2010
@@ -86,21 +86,6 @@ public class Http11Protocol extends Abst
 
     @Override
     public void start() throws Exception {
-        if (this.domain != null) {
-            try {
-                tpOname = new ObjectName
-                    (domain + ":" + "type=ThreadPool,name=" + getName());
-                Registry.getRegistry(null, null)
-                    .registerComponent(endpoint, tpOname, null );
-            } catch (Exception e) {
-                log.error("Can't register endpoint");
-            }
-            rgOname=new ObjectName
-                (domain + ":type=GlobalRequestProcessor,name=" + getName());
-            Registry.getRegistry(null, null).registerComponent
-                ( cHandler.global, rgOname, null );
-        }
-
         try {
             endpoint.start();
         } catch (Exception ex) {



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


Mime
View raw message