admin@glassfish.java.net

Re: V3 MBeanServer now "wrapped", AMX automatic

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 18 Mar 2008 16:26:48 -0700

Forgot to mention--

If this change causes any immediate issues, it can be quickly reversed
by comment-swapping these two lines in
org.glassfish.admin.mbeanserver.AppserverMBeanServerFactory:

         //officialMBeanServer =
ManagementFactory.getPlatformMBeanServer();
         officialMBeanServer = AppserverMBeanServer.getInstance();

Lloyd

On Mar 18, 2008, at 4:22 PM, Lloyd L Chambers wrote:
> With mixed feelings I've committed a code change we've discussed on
> and off for some time:
>
> The AMX MBeans now load ON DEMAND in an MBeanServer of their own,
> NOT the Platform MBeanServer (call this the "Official" MBS). When a
> request comes in for an AMX MBean (query or otherwise), all the AMX
> MBeans are loaded at that time.
>
> Downsides:
>
> - The JDK PlatformMXBeans (JMX domain java.lang) load only in the
> Platform MBeanServer; we'll have to create proxies to them if we
> want them in the Offical MBS.
>
> - To get the Official MBeanServer requires using @Inject eg:
> import org.glassfish.admin.mbeanserver.AppserverMBeanServerFactory;
> @Inject(name= AppserverMBeanServerFactory.OFFICIAL_MBEANSERVER)
> private MBeanServer mMBeanServer;
>
> ....
>
> There is minimal use of the MBeanServer currently; such use needs to
> do the right thing and use @Inject to obtain the correct
> MBeanServer. I've used grep to find the call sites that
> (incorrectly) assume getPlatformMBeanServer:
>
> MB2:code lloyd$ grep -r getPlatformMBeanServer .
> ./admin/addon/src/main/java/net/munnangi/addon/.svn/text-base/
> RuntimeMBeanCageBuilder.java.svn-base:
> MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
> ./admin/addon/src/main/java/net/munnangi/addon/
> RuntimeMBeanCageBuilder.java:
> MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
> ./admin/runtime/mgmt-infra/src/main/java/org/glassfish/admin/runtime/
> mgmtinfra/.svn/text-base/RuntimeMBeanCageBuilder.java.svn-
> base: MBeanServer mbs =
> ManagementFactory.getPlatformMBeanServer();
> ./admin/runtime/mgmt-infra/src/main/java/org/glassfish/admin/runtime/
> mgmtinfra/RuntimeMBeanCageBuilder.java:
> MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
> ./admingui/core/src/main/java/org/glassfish/admingui/util/.svn/text-
> base/AMXRoot.java.svn-base:
> MBeanServer mMBeanServer =
> ManagementFactory.getPlatformMBeanServer();
> ./admingui/core/src/main/java/org/glassfish/admingui/util/
> AMXRoot.java:
> MBeanServer mMBeanServer =
> ManagementFactory.getPlatformMBeanServer();
>
>
>
> Lloyd
>
> ---
> Lloyd L Chambers
> lloyd.chambers_at_sun.com
> Sun Microsystems, Inc
>
>
>