1 23 24 29 30 package com.sun.enterprise.admin.jmx; 31 32 import javax.management.MBeanServer ; 33 import javax.management.MBeanServerDelegate ; 34 import com.sun.jmx.mbeanserver.JmxMBeanServer; 35 import com.sun.jmx.interceptor.ForwardingMBeanServerInterceptor; 36 37 41 public class AppServerMBeanServerBuilder extends javax.management.MBeanServerBuilder { 42 43 44 public AppServerMBeanServerBuilder() { 45 } 46 47 58 59 public MBeanServer newMBeanServer(String defaultDomain, 60 MBeanServer outer, 61 MBeanServerDelegate delegate) { 62 JmxMBeanServer jmxMBS = (JmxMBeanServer)JmxMBeanServer.newMBeanServer(defaultDomain,outer,delegate, 63 true); 64 ForwardingMBeanServerInterceptor appServerInterceptor = 65 new AppServerMBeanServerInterceptor(); 66 try { 67 appServerInterceptor.insertFirst(jmxMBS); 68 } catch(Exception e) { 69 e.printStackTrace(); 70 } 71 return jmxMBS; 72 } 73 74 101 public MBeanServerDelegate newMBeanServerDelegate() { 102 return JmxMBeanServer.newMBeanServerDelegate(); 103 } 104 } 105 | Popular Tags |