dev@glassfish.java.net

[HEADS-UP] Monitoring Mbean object name change (and question)

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 18 Oct 2005 14:52:03 -0700

I'm in the process of fixing 6323606 ("enormous log files while
running AMX unit tests (but not from AMX)") by aligning the object
names of the JSR77 (registered by Tomcat) and Monitoring mbeans for
servlets and web modules, in order to allow AMX to derive corresponding
mbeans for its own purposes.

While the JSR77 object names will be left intact, the Monitoring
object names for servlets and web modules will need to be modified in
such a way that their name component also includes the context root at
which the "enclosing" web module has been deployed.

Please let Lloyd and I know if you are aware of any BC issues this may
cause (please notice that changing the object names of the Monitoring
mbeans in question will not affect the dotted names of their associated
nodes).

This change will also affect the object names of the Monitoring mbeans
for servlet-based web service endpoints.

One of the places I need to modify is the reconfigureMonitoring()
method inside:

/cvs/glassfish/admin/ws-mgmt/src/java/com/sun/enterprise/admin/
wsmgmt/lifecycle/AppServWSMonitorLifeCycleProvider.java

which takes an argument of type
com.sun.enterprise.config.serverbeans.WebServiceEndpoint.
How can I reliably determine the context root of a servlet-based
endpoint given an instance of WebServiceEndpoint?
I assume the following code will work:

    WebServiceEndpoint ep = ...;
    String ctxRoot = null;

    BundleDescriptor bd = ep.getBundleDescriptor();
    if (bd instanceof WebBundleDescriptor) {
        ctxRoot = ((WebBundleDescriptor) bd).getContextRoot();
    }

Can someone confirm?

Thanks,


Jan