|Summary:||Support consistent Jmx object naming strategy across managed resources|
|Product:||Tomcat Modules||Reporter:||Alex Franken <alexfranken>|
|Component:||jdbc-pool||Assignee:||Tomcat Developers Mailing List <dev>|
Description Alex Franken 2012-06-20 19:20:53 UTC
Tomcat JDBC Pool Versions tested: 7.0.27 & 7.0.28 More of an inquiry. Let me preface by saying we have recently adopted this pool and are very pleased so far. Currently, Jmx managed resources like ConnectionPool and SlowQueryReportJmx are registered under the same domain (i.e. tomcat.jdbc). Some users may want to employ an alternate object naming strategy. With DataSource#createObjectName it is relatively easy to change the ConnectionPool ObjectName (i.e. subclass). However, with SlowQueryReportJmx, due to a static getObjectName method, it requires overriding additional methods which is less desirable. It appears that ConnectionPool has a constant POOL_JMX_TYPE_PREFIX. SlowQueryReportJmx appears to use this but DataSource does not? Is there any reason that the SlowQueryReportJmx#getObjectName method is static? What about registering an object naming strategy with the pool that the various components would use, facilitating consistency? This would mitigate the need to override just to alter the ObjectName. Reference: Spring MBean exporters and their ObjectNamingStrategy interface. Thanks.
Comment 1 Filip Hanik 2012-06-26 19:09:08 UTC
Fixed in r1354173 I'll consider a naming strategy for when we refactor jdbc-pool, but that will be in Tomcat trunk (8)