Package javax.management

Examples of javax.management.NotCompliantMBeanException


        throw new NotCompliantMBeanException("You can't create mbeans under the reserved domain '" + name.getDomain() + "'");
    }

    public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException,
            InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException {
        throw new NotCompliantMBeanException("You can't create mbeans under the reserved domain '" + name.getDomain() + "'");
    }
View Full Code Here


        Calculator calculatorMBean = new CalculatorImpl();
        ObjectName objectName = new ObjectName("hivemind:module=test");

        // Training
        server.registerMBean(calculatorMBean, objectName);
        serverControl.setThrowable(new NotCompliantMBeanException("Not compliant"));
        replayControls();

        // Registration must fail since the bean is not mbean compliant and a management
        // interface is not provided
        MBeanRegistry mbeanRegistry = new MBeanRegistryImpl(errorHandler, log, server,
View Full Code Here

        Calculator calculatorMBean = new CalculatorImpl();
        ObjectName objectName = new ObjectName("hivemind:module=test");

        // Training
        server.registerMBean(calculatorMBean, objectName);
        serverControl.setThrowable(new NotCompliantMBeanException("Not compliant"));

        server.registerMBean(null, objectName);
        // Matcher must match both method calls, it's not possible to
        // define multiple matchers
        serverControl.setMatcher(new ArgumentsMatcher()
View Full Code Here

        {
            if (attribute.getName().equals(memberAttribute.getName()))
            {
                if (!attribute.getType().equals(memberAttribute.getType()))
                {
                    throw new NotCompliantMBeanException(exceptionMsg);
                }
                if (attribute.isReadable() && memberAttribute.isReadable())
                {
                    if (attribute.isIs() != memberAttribute.isIs())
                    {
                        throw new NotCompliantMBeanException(exceptionMsg);
                    }
                }

                return list.indexOf(memberAttribute);
            }
View Full Code Here

        {
            if (attribute.getName().equals(memberAttribute.getName()))
            {
                if (!attribute.getType().equals(memberAttribute.getType()))
                {
                    throw new NotCompliantMBeanException(exceptionMsg);
                }
                if (attribute.isReadable() && memberAttribute.isReadable())
                {
                    if (attribute.isIs() != memberAttribute.isIs())
                    {
                        throw new NotCompliantMBeanException(exceptionMsg);
                    }
                }

                return list.indexOf(memberAttribute);
            }
View Full Code Here

    Class<?> targetClass = AopUtils.getTargetClass(bean);
    if (targetClass != bean.getClass()) {
      Class<?> ifc = JmxUtils.getMXBeanInterface(targetClass);
      if (ifc != null) {
        if (!ifc.isInstance(bean)) {
          throw new NotCompliantMBeanException("Managed bean [" + bean +
              "] has a target class with an MXBean interface but does not expose it in the proxy");
        }
        return new StandardMBean(bean, ((Class<Object>) ifc), true);
      }
      else {
        ifc = JmxUtils.getMBeanInterface(targetClass);
        if (ifc != null) {
          if (!ifc.isInstance(bean)) {
            throw new NotCompliantMBeanException("Managed bean [" + bean +
                "] has a target class with an MBean interface but does not expose it in the proxy");
          }
          return new StandardMBean(bean, ((Class<Object>) ifc));
        }
      }
View Full Code Here

    Class targetClass = AopUtils.getTargetClass(bean);
    if (targetClass != bean.getClass()) {
      Class ifc = JmxUtils.getMXBeanInterface(targetClass);
      if (ifc != null) {
        if (!(ifc.isInstance(bean))) {
          throw new NotCompliantMBeanException("Managed bean [" + bean +
              "] has a target class with an MXBean interface but does not expose it in the proxy");
        }
        return new StandardMBean(bean, ifc, true);
      }
      else {
        ifc = JmxUtils.getMBeanInterface(targetClass);
        if (ifc != null) {
          if (!(ifc.isInstance(bean))) {
            throw new NotCompliantMBeanException("Managed bean [" + bean +
                "] has a target class with an MBean interface but does not expose it in the proxy");
          }
          return new StandardMBean(bean, ifc);
        }
      }
View Full Code Here

        {
            if (attribute.getName().equals(memberAttribute.getName()))
            {
                if (!attribute.getType().equals(memberAttribute.getType()))
                {
                    throw new NotCompliantMBeanException(exceptionMsg);
                }
                if (attribute.isReadable() && memberAttribute.isReadable())
                {
                    if (attribute.isIs() != memberAttribute.isIs())
                    {
                        throw new NotCompliantMBeanException(exceptionMsg);
                    }
                }

                return list.indexOf(memberAttribute);
            }
View Full Code Here

    Class targetClass = AopUtils.getTargetClass(bean);
    if (targetClass != bean.getClass()) {
      Class ifc = JmxUtils.getMXBeanInterface(targetClass);
      if (ifc != null) {
        if (!(ifc.isInstance(bean))) {
          throw new NotCompliantMBeanException("Managed bean [" + bean +
              "] has a target class with an MXBean interface but does not expose it in the proxy");
        }
        return new StandardMBean(bean, ifc, true);
      }
      else {
        ifc = JmxUtils.getMBeanInterface(targetClass);
        if (ifc != null) {
          if (!(ifc.isInstance(bean))) {
            throw new NotCompliantMBeanException("Managed bean [" + bean +
                "] has a target class with an MBean interface but does not expose it in the proxy");
          }
          return new StandardMBean(bean, ifc);
        }
      }
View Full Code Here

    public static void testCreation(Class c)
  throws NotCompliantMBeanException {
  // Check if the class is a concrete class
  final int mods = c.getModifiers();
  if (Modifier.isAbstract(mods) || Modifier.isInterface(mods)) {
      throw new
    NotCompliantMBeanException("MBean class must be concrete");
  }

  // Check if the MBean has a public constructor
  final Constructor[] consList = c.getConstructors();    
  if (consList.length == 0) {
      throw new
        NotCompliantMBeanException("MBean class must have public constructor");
  }
    }
View Full Code Here

TOP

Related Classes of javax.management.NotCompliantMBeanException

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.