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

2020-04-06 Thread Mark Thomas
On 06/04/2020 12:41, Rémy Maucherat wrote:
> On Mon, Apr 6, 2020 at 1:36 PM  > 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 mailto:r...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



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

2020-04-06 Thread Rémy Maucherat
On Mon, Apr 6, 2020 at 1:36 PM  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 
> 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 {
>  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 @@
>
>  
>
> +  
> +
> +  
> +Move SocketProperties mbean to its own type rather
> than
> +use a subType to improve robustness with tools. (remm)
> +  
> +
> +  
>  
>  
>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


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

2020-04-06 Thread remm
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 
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 {
 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 @@
   
 
   
+  
+
+  
+Move SocketProperties mbean to its own type rather than
+use a subType to improve robustness with tools. (remm)
+  
+
+  
 
 
   


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