You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/04/06 11:36:31 UTC

[tomcat] branch master updated: Use a separate mbean type for SocketProperties

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 14406c0  Use a separate mbean type for SocketProperties
14406c0 is described below

commit 14406c0b49c29fd05dd8f707b62ece38429e16f8
Author: remm <re...@apache.org>
AuthorDate: Mon Apr 6 13:36:10 2020 +0200

    Use a separate mbean type for SocketProperties
    
    A subType seems to not be handled well by some tools so it's likely more
    robust to avoid it. Inspired by BZ64314, and similarly I cannot see the
    mbean in visualvm.
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
 test/org/apache/catalina/mbeans/TestRegistration.java | 5 ++---
 webapps/docs/changelog.xml                            | 8 ++++++++
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index ba30767..23a2c16 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -1131,7 +1131,7 @@ public abstract class AbstractEndpoint<S,U> {
             Registry.getRegistry(null, null).registerComponent(this, oname, null);
 
             ObjectName socketPropertiesOname = new ObjectName(domain +
-                    ":type=ThreadPool,name=\"" + getName() + "\",subType=SocketProperties");
+                    ":type=SocketProperties,name=\"" + getName() + "\"");
             socketProperties.setObjectName(socketPropertiesOname);
             Registry.getRegistry(null, null).registerComponent(socketProperties, socketPropertiesOname, null);
 
diff --git a/test/org/apache/catalina/mbeans/TestRegistration.java b/test/org/apache/catalina/mbeans/TestRegistration.java
index 2049f81..bffd2c5 100644
--- a/test/org/apache/catalina/mbeans/TestRegistration.java
+++ b/test/org/apache/catalina/mbeans/TestRegistration.java
@@ -135,9 +135,8 @@ public class TestRegistration extends TomcatBaseTest {
                 + ObjectName.quote(ADDRESS),
         "Tomcat:type=ThreadPool,name="
                 + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" + port),
-        "Tomcat:type=ThreadPool,name="
-                + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" + port) +
-                ",subType=SocketProperties",
+        "Tomcat:type=SocketProperties,name="
+                + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" + port),
         };
     }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8f2bf49..02bda5e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -64,6 +64,14 @@
       </scode>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        Move <code>SocketProperties</code> mbean to its own type rather than
+        use a subType to improve robustness with tools. (remm)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 10.0.0-M4 (markt)" rtext="release in progress">
   <subsection name="Catalina">


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


Re: [tomcat] branch master updated: Use a separate mbean type for SocketProperties

Posted by Mark Thomas <ma...@apache.org>.
On 06/04/2020 12:41, Rémy Maucherat wrote:
> On Mon, Apr 6, 2020 at 1:36 PM <remm@apache.org
> <ma...@apache.org>> wrote:
> 
>     This is an automated email from the ASF dual-hosted git repository.
> 
>     remm pushed a commit to branch master
>     in repository https://gitbox.apache.org/repos/asf/tomcat.git
> 
> 
>     The following commit(s) were added to refs/heads/master by this push:
>          new 14406c0  Use a separate mbean type for SocketProperties
>     14406c0 is described below
> 
>     commit 14406c0b49c29fd05dd8f707b62ece38429e16f8
>     Author: remm <remm@apache.org <ma...@apache.org>>
>     AuthorDate: Mon Apr 6 13:36:10 2020 +0200
> 
>         Use a separate mbean type for SocketProperties
> 
>         A subType seems to not be handled well by some tools so it's
>     likely more
>         robust to avoid it. Inspired by BZ64314, and similarly I cannot
>     see the
>         mbean in visualvm.
> 
> 
> Should I backport this ?
> Although it is a breaking change (in theory), the mbean name used
> doesn't seem very reliable in tools.

I don't recall why I used a subType for that.

I think in this case the risk of breakage is outweighed by the benefits
of making the MBean accessible to more/most tools.

Mark


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


Re: [tomcat] branch master updated: Use a separate mbean type for SocketProperties

Posted by Rémy Maucherat <re...@apache.org>.
On Mon, Apr 6, 2020 at 1:36 PM <re...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> remm pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>      new 14406c0  Use a separate mbean type for SocketProperties
> 14406c0 is described below
>
> commit 14406c0b49c29fd05dd8f707b62ece38429e16f8
> Author: remm <re...@apache.org>
> AuthorDate: Mon Apr 6 13:36:10 2020 +0200
>
>     Use a separate mbean type for SocketProperties
>
>     A subType seems to not be handled well by some tools so it's likely
> more
>     robust to avoid it. Inspired by BZ64314, and similarly I cannot see the
>     mbean in visualvm.
>

Should I backport this ?
Although it is a breaking change (in theory), the mbean name used doesn't
seem very reliable in tools.

Rémy


> ---
>  java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
>  test/org/apache/catalina/mbeans/TestRegistration.java | 5 ++---
>  webapps/docs/changelog.xml                            | 8 ++++++++
>  3 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
> b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
> index ba30767..23a2c16 100644
> --- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
> +++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
> @@ -1131,7 +1131,7 @@ public abstract class AbstractEndpoint<S,U> {
>              Registry.getRegistry(null, null).registerComponent(this,
> oname, null);
>
>              ObjectName socketPropertiesOname = new ObjectName(domain +
> -                    ":type=ThreadPool,name=\"" + getName() +
> "\",subType=SocketProperties");
> +                    ":type=SocketProperties,name=\"" + getName() + "\"");
>              socketProperties.setObjectName(socketPropertiesOname);
>              Registry.getRegistry(null,
> null).registerComponent(socketProperties, socketPropertiesOname, null);
>
> diff --git a/test/org/apache/catalina/mbeans/TestRegistration.java
> b/test/org/apache/catalina/mbeans/TestRegistration.java
> index 2049f81..bffd2c5 100644
> --- a/test/org/apache/catalina/mbeans/TestRegistration.java
> +++ b/test/org/apache/catalina/mbeans/TestRegistration.java
> @@ -135,9 +135,8 @@ public class TestRegistration extends TomcatBaseTest {
>                  + ObjectName.quote(ADDRESS),
>          "Tomcat:type=ThreadPool,name="
>                  + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" +
> port),
> -        "Tomcat:type=ThreadPool,name="
> -                + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" +
> port) +
> -                ",subType=SocketProperties",
> +        "Tomcat:type=SocketProperties,name="
> +                + ObjectName.quote("http-" + type + "-" + ADDRESS + "-" +
> port),
>          };
>      }
>
> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
> index 8f2bf49..02bda5e 100644
> --- a/webapps/docs/changelog.xml
> +++ b/webapps/docs/changelog.xml
> @@ -64,6 +64,14 @@
>        </scode>
>      </changelog>
>    </subsection>
> +  <subsection name="Coyote">
> +    <changelog>
> +      <fix>
> +        Move <code>SocketProperties</code> mbean to its own type rather
> than
> +        use a subType to improve robustness with tools. (remm)
> +      </fix>
> +    </changelog>
> +  </subsection>
>  </section>
>  <section name="Tomcat 10.0.0-M4 (markt)" rtext="release in progress">
>    <subsection name="Catalina">
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>