geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx JMXKernel.java
Date Thu, 13 Nov 2003 04:19:39 GMT
djencks     2003/11/12 20:19:39

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/jmx
                        JMXKernel.java
  Log:
  Added helper method to get the kernel's MBeanServerId
  
  Revision  Changes    Path
  1.2       +22 -1     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXKernel.java
  
  Index: JMXKernel.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXKernel.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JMXKernel.java	8 Sep 2003 04:38:34 -0000	1.1
  +++ JMXKernel.java	13 Nov 2003 04:19:39 -0000	1.2
  @@ -62,6 +62,10 @@
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ServiceNotFoundException;
  +import javax.management.MBeanException;
  +import javax.management.AttributeNotFoundException;
  +import javax.management.InstanceNotFoundException;
  +import javax.management.ReflectionException;
   import javax.management.loading.MLet;
   
   import org.apache.commons.logging.Log;
  @@ -86,6 +90,23 @@
   
       public MBeanServer getMBeanServer() {
           return server;
  +    }
  +
  +    public String getMBeanServerId() {
  +        try {
  +            return (String)server.getAttribute(ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate"),
"MBeanServerId");
  +        } catch (MBeanException e) {
  +            log.info(e);
  +        } catch (AttributeNotFoundException e) {
  +            log.info(e);
  +        } catch (InstanceNotFoundException e) {
  +            log.info(e);
  +        } catch (ReflectionException e) {
  +            log.info(e);
  +        } catch (MalformedObjectNameException e) {
  +            log.info(e);
  +        }
  +        throw new RuntimeException("could not get the MBeanServerId");
       }
   
       public Set bootMLet(URL mletURL) throws ServiceNotFoundException {
  
  
  

Mime
View raw message