Package javax.management

Examples of javax.management.MBeanServerInvocationHandler


      Object proxy = wr.get();
      if (type.isInstance(proxy))
    return type.cast(proxy);
  }
  InvocationHandler handler =
      new MBeanServerInvocationHandler(mbsc, name);
  T proxy = JMX.newMXBeanProxy(mbsc, name, type);
  objectNameToProxy.put(name, new WeakReference<Object>(proxy));
  return proxy;
    }
View Full Code Here


    synchronized ObjectName mxbeanToObjectName(Object mxbean) {
        if (mxbean instanceof Proxy) {
      InvocationHandler ih = Proxy.getInvocationHandler(mxbean);
      if (ih instanceof MBeanServerInvocationHandler) {
                MBeanServerInvocationHandler mbsih =
                        (MBeanServerInvocationHandler) ih;
                if (mbsih.getMBeanServerConnection().equals(mbsc))
                    return mbsih.getObjectName();
            }
            return null;
        } else
            return mxbeanToObjectName.get(mxbean);
    }
View Full Code Here

        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

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

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

      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

      if (this.useStrictCasing) {
        // Use the JDK's own MBeanServerInvocationHandler,
        // in particular for native MXBean support on Java 6.
        if (JdkVersion.isAtLeastJava16()) {
          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

    throws OpenDataException {
        String wrong;
        if (mxbean instanceof Proxy) {
            InvocationHandler ih = Proxy.getInvocationHandler(mxbean);
            if (ih instanceof MBeanServerInvocationHandler) {
                MBeanServerInvocationHandler mbsih =
                        (MBeanServerInvocationHandler) ih;
                if (mbsih.getMBeanServerConnection().equals(mbsc))
                    return mbsih.getObjectName();
                else
                    wrong = "proxy for a different MBeanServer";
            } else
                wrong = "not a JMX proxy";
        } else {
View Full Code Here

        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

    synchronized ObjectName mxbeanToObjectName(Object mxbean) {
        if (mxbean instanceof Proxy) {
            InvocationHandler ih = Proxy.getInvocationHandler(mxbean);
            if (ih instanceof MBeanServerInvocationHandler) {
                MBeanServerInvocationHandler mbsih =
                        (MBeanServerInvocationHandler) ih;
                if (mbsih.getMBeanServerConnection().equals(mbsc))
                    return mbsih.getObjectName();
            }
            return null;
        } else
            return mxbeanToObjectName.get(mxbean);
    }
View Full Code Here

TOP

Related Classes of javax.management.MBeanServerInvocationHandler

Copyright © 2018 www.massapicom. 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.