Review Request for 6876135: Add PlatformLoggingMXBean to eliminate the dependency on JMX from logging

Alan Bateman Alan.Bateman at Sun.COM
Thu Oct 22 07:35:59 PDT 2009


Mandy Chung wrote:
> Fixed 6876135: Add PlatformLoggingMXBean to eliminate the dependency 
> on JMX from logging
>
> Webrev at:
>  http://cr.openjdk.java.net/~mchung/6876135/webrev.00/
>
> A new java.lang.management.ManagementFactory.getPlatformMXBeans method 
> was added to provide a generic way to obtain platform MXBeans in JDK 7 
> (see 6610094).  All existing MXBean interfaces were modified to extend 
> the new java.lang.management.PlatformManagedObject.  
> java.util.logging.LoggingMXBean was one of them but that introduced a 
> new dependency on JMX from logging.
>
> To eliminate such dependency, we revert 
> java.util.logging.LoggingMXBean change to JDK 6 version.  Add a new 
> java.util.logging.PlatformLoggingMXBean interface to extend 
> LoggingMXBean and java.lang.managmenet.PlatformManagedObject.  The 
> PlatformLoggingMXBean will be part of the management module and not in 
> the logging module.  Also the logging mxbean will not be created and 
> registered in the platform MBeanServer if the logging module doesn't 
> exist.
>
> Thanks
> Mandy
>
This looks good to me. A couple of comments:

- I notice in ManagementFactoryHelper that you are using 
ObjectName.valueOf. I assume this will need to change due to the 
back-port of JSR 255.

- In j.u.logging.Loggging I wonder if some imports can be removed.

- Copyright date range in PlatformLoggingMXBean should be 2009.

- The re-work of the logging proxy looks good and eliminates the use of 
the reflection. It might be useful to move LoggingProxyImpl isn't isn't 
own package - that would make it easier to assign to the "logging" 
module without needing to list the class explicitly.

-Alan.


More information about the serviceability-dev mailing list