Package org.springframework.jmx.export

Examples of org.springframework.jmx.export.MBeanExporter


            new MutablePropertyValues(properties)));
    this.context.registerBeanDefinition("endpoint1", new RootBeanDefinition(
        TestEndpoint.class));
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        ObjectNameManager.getInstance(getObjectName("test-domain", "endpoint1",
            true, this.context).toString()
            + ",key1=value1,key2=value2")));
  }
View Full Code Here


    this.context.setParent(parent);
    parent.refresh();
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        getObjectName("endpoint1", this.context)));

    parent.close();
  }
View Full Code Here

        EndpointAutoConfiguration.class,
        EndpointMBeanExportAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(EndpointMBeanExporter.class));
    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertFalse(mbeanExporter.getServer()
        .queryNames(getObjectName("*", "*,*", this.context), null).isEmpty());
  }
View Full Code Here

        ManagedEndpoint.class, EndpointMBeanExportAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(EndpointMBeanExporter.class));

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertTrue(mbeanExporter.getServer()
        .queryNames(getObjectName("*", "*,*", this.context), null).isEmpty());
  }
View Full Code Here

        EndpointMBeanExportAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(EndpointMBeanExporter.class));

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertTrue(mbeanExporter.getServer()
        .queryNames(getObjectName("*", "*,*", this.context), null).isEmpty());
  }
View Full Code Here

        EndpointAutoConfiguration.class,
        EndpointMBeanExportAutoConfiguration.class);
    this.context.refresh();
    this.context.getBean(EndpointMBeanExporter.class);

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        ObjectNameManager.getInstance(getObjectName("test-domain",
            "healthEndpoint", this.context).toString()
            + ",key1=value1,key2=value2")));
  }
View Full Code Here

      }

      // JMX managed resources
      final MBeanServer jmxServer = findInstance(MBeanServer.class);
      if (jmxServer != null) {
        final MBeanExporter exporter = new MBeanExporter();
        exporter.setServer(jmxServer);
        for (final Map.Entry<ObjectName, Object> resourceEntry : _managedResources.entrySet()) {
          exporter.registerManagedResource(resourceEntry.getValue(), resourceEntry.getKey());
        }
      }

      _status.set(Status.RUNNING);
View Full Code Here

  private void registerJmx() {

    if (_objectName != null && _jmxServer != null) {
      unregisterFromJmx();
      final MBeanExporter exporter = new MBeanExporter();
      exporter.setServer(_jmxServer);
      exporter.registerManagedResource(this, _objectName);
    }
  }
View Full Code Here

    try {
      MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
      ObjectName objectName = createObjectName();
      if (objectName != null) {
        MBeanExporter exporter = new MBeanExporter();
        exporter.setServer(jmxServer);
        exporter.registerManagedResource(this, objectName);
      }
    } catch (SecurityException e) {
      s_logger.warn("No permissions for platform MBean server - JMX will not be available", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.jmx.export.MBeanExporter

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.