Examples of MBeanExporter


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

Examples of org.springframework.jmx.export.MBeanExporter

    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

Examples of org.springframework.jmx.export.MBeanExporter

        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

Examples of org.springframework.jmx.export.MBeanExporter

        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

Examples of org.springframework.jmx.export.MBeanExporter

        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

Examples of org.springframework.jmx.export.MBeanExporter

        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

Examples of org.springframework.jmx.export.MBeanExporter

      }

      // 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

Examples of org.springframework.jmx.export.MBeanExporter

  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

Examples of org.springframework.jmx.export.MBeanExporter

    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

Examples of org.weakref.jmx.MBeanExporter

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
        server = injector.getInstance(TestingHttpServer.class);

        testMBean = injector.getInstance(TestMBean.class);
        testMBeanName = new ObjectName(generatedNameOf(TestMBean.class));
        MBeanExporter exporter = new MBeanExporter(platformMBeanServer);
        exporter.export(testMBeanName.toString(), testMBean);

        JMXConnector connect = JMXConnectorFactory.connect(
                new JMXServiceURL("service:jmx:" + server.getBaseUrl()),
                ImmutableMap.of(JMXConnector.CREDENTIALS, new String[] {"foo", "bar"}));
        mbeanServerConnection = connect.getMBeanServerConnection();
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.