jmx-dev RFR: 8065213 Specify and implement PlatformMBeanProvider for looking for all platform MBeans

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Tue Feb 3 13:49:49 UTC 2015


Looks good!

-JB-

On 3.2.2015 14:16, shanliang wrote:
> Hi,
>
> Hope this is last time :)
>     http://cr.openjdk.java.net/~sjiang/JDK-8065213/02/
>
> 1)
> Mandy Chung wrote:
>> You may want to consider using limited doPrivileged (that can be done
>> in the second phase).
> Done as in ManagementFactory:
> 878             // get all providers
> 879             List<PlatformMBeanProvider> providers
> 880                 =
> AccessController.doPrivileged((PrivilegedAction<List<PlatformMBeanProvider>>)
> () -> {
> 881                     List<PlatformMBeanProvider> all = new
> ArrayList<>();
> 882                     for (PlatformMBeanProvider provider :
> ServiceLoader.loadInstalled(PlatformMBeanProvider.class)) {
> 883                         all.add(provider);
> 884                     }
> 885                     all.add(new DefaultPlatformMBeanProvider());
> 886                     return all;
> 887                 },
> 888                 null,
> 889                 new FilePermission("<<ALL FILES>>", "read"),
> 890                 new
> RuntimePermission("sun.management.spi.PlatformMBeanProvider"));
>
> 2)
> The modification to Flag is removed, we get another solution to know
> whether commercial feature is enabled.
>
> 3) some mis minors modifications.
>
> Thanks,
> Shanliang
>
>



More information about the jmx-dev mailing list