Package javax.management

Examples of javax.management.NotCompliantMBeanException


        {
            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, 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

        control.verify();
    }

    @Test
    public void testRepeatManageManagedEndpoint() throws Exception {
        doTestManageManagedEndpoint(new NotCompliantMBeanException());
    }
View Full Code Here

        doTestManageManagedEndpoint(new NotCompliantMBeanException());
    }

    @Test
    public void testManageManagedEndpointWithUndeclaredThrowable() throws Exception {
        Exception ncmbe = new NotCompliantMBeanException();
        doTestManageManagedEndpoint(new UndeclaredThrowableException(ncmbe));
    }
View Full Code Here

        doTestManageManagedEndpoint(new UndeclaredThrowableException(ncmbe));
    }

    @Test
    public void testManageManagedEndpointWithInvocationTargetException() throws Exception {
        Exception ncmbe = new NotCompliantMBeanException();
        InvocationTargetException ite = new InvocationTargetException(ncmbe);
        doTestManageManagedEndpoint(new UndeclaredThrowableException(ite));
    }
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

        implements DynamicMBean2, MBeanRegistration {

    <T> MBeanSupport(T resource, Class<T> mbeanInterface)
            throws NotCompliantMBeanException {
        if (mbeanInterface == null)
            throw new NotCompliantMBeanException("Null MBean interface");
        if (!mbeanInterface.isInstance(resource)) {
            final String msg =
                "Resource class " + resource.getClass().getName() +
                " is not an instance of " + mbeanInterface.getName();
            throw new NotCompliantMBeanException(msg);
        }
        this.resource = resource;
        MBeanIntrospector<M> introspector = getMBeanIntrospector();
        this.perInterface = introspector.getPerInterface(mbeanInterface);
        this.mbeanInfo = introspector.getMBeanInfo(resource, perInterface);
View Full Code Here

    private MBeanAnalyzer(Class<?> mbeanInterface,
            MBeanIntrospector<M> introspector)
            throws NotCompliantMBeanException {
        if (!mbeanInterface.isInterface()) {
            throw new NotCompliantMBeanException("Not an interface: " +
                    mbeanInterface.getName());
        }

        try {
            initMaps(mbeanInterface, introspector);
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.