Examples of MBeanServerInvocationHandler


Examples of javax.management.MBeanServerInvocationHandler

      if (this.useStrictCasing) {
        // Use the JDK's own MBeanServerInvocationHandler,
        // in particular for native MXBean support on Java 6.
        if (JmxUtils.isMXBeanSupportAvailable()) {
          this.invocationHandler =
              new MBeanServerInvocationHandler(this.serverToUse, this.objectName,
                  (this.managementInterface != null && JMX.isMXBeanInterface(this.managementInterface)));
        }
        else {
          this.invocationHandler = new MBeanServerInvocationHandler(this.serverToUse, this.objectName);
        }
      }
      else {
        // Non-strict casing can only be achieved through custom
        // invocation handling. Only partial MXBean support available!
View Full Code Here

Examples of javax.management.MBeanServerInvocationHandler

      if (this.useStrictCasing) {
        // Use the JDK's own MBeanServerInvocationHandler,
        // in particular for native MXBean support on Java 6.
        if (JmxUtils.isMXBeanSupportAvailable()) {
          this.invocationHandler =
              new MBeanServerInvocationHandler(this.serverToUse, this.objectName,
                  (this.managementInterface != null && JMX.isMXBeanInterface(this.managementInterface)));
        }
        else {
          this.invocationHandler = new MBeanServerInvocationHandler(this.serverToUse, this.objectName);
        }
      }
      else {
        // Non-strict casing can only be achieved through custom
        // invocation handling. Only partial MXBean support available!
View Full Code Here

Examples of javax.management.MBeanServerInvocationHandler

        final Proxy p = (Proxy) proxy;
        final InvocationHandler handler =
                Proxy.getInvocationHandler(proxy);
        if (!(handler instanceof MBeanServerInvocationHandler))
            throw new IllegalArgumentException("not a JMX Proxy");
        final MBeanServerInvocationHandler h =
                (MBeanServerInvocationHandler)handler;
        final ObjectName name = h.getObjectName();
        final MBeanServerConnection mbs = h.getMBeanServerConnection();
        final boolean isMXBean = h.isMXBean();
        final T newProxy;
        if (isMXBean)
            newProxy = JMX.newMXBeanProxy(mbs,name,mbeanInterface,true);
        else
            newProxy = JMX.newMBeanProxy(mbs,name,mbeanInterface,true);
View Full Code Here

Examples of javax.management.MBeanServerInvocationHandler

        ObjectName on;
        on = (ObjectName) mbs.getAttribute(moduleName, "Product");
        check("ObjectName attribute value", on.equals(productName));

        ProductMXBean productProxy = moduleProxy.getProduct();
        MBeanServerInvocationHandler mbsih = (MBeanServerInvocationHandler)
                Proxy.getInvocationHandler(productProxy);
        check("ObjectName in proxy", mbsih.getObjectName().equals(productName));

        mbs.setAttribute(moduleName, new Attribute("Product", product2Name));
        ProductMXBean product2Proxy = module.getProduct();
        mbsih = (MBeanServerInvocationHandler)
                Proxy.getInvocationHandler(product2Proxy);
        check("Proxy after setAttribute",
                mbsih.getObjectName().equals(product2Name));

        moduleProxy.setProduct(productProxy);
        ProductMXBean productProxyAgain = module.getProduct();
        mbsih = (MBeanServerInvocationHandler)
                Proxy.getInvocationHandler(productProxyAgain);
        check("Proxy after proxied set",
                mbsih.getObjectName().equals(productName));

        MBeanServer mbs2 = MBeanServerFactory.createMBeanServer();
        ProductMXBean productProxy2 =
                JMX.newMXBeanProxy(mbs2, productName, ProductMXBean.class);
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.