Package javax.management

Examples of javax.management.AttributeList.asList()


            if (attributeList != null && attributes.length == attributeList.size()) {

                Map<Object, Object> pluginDefinition = new HashMap<Object, Object>();

                for (Attribute attribute : attributeList.asList()) {
                    pluginDefinition.put(attribute.getName(), attribute.getValue());
                }
                answer.put((String) pluginDefinition.get("Name"), pluginDefinition);
            }
View Full Code Here


    AttributeList attr = ManagementFactory.getPlatformMBeanServer().getAttributes(
        runtime.getObjectName(), new String[]{"SystemProperties"});
    List<Result> results = new JmxResultProcessor(
        query,
        runtime,
        attr.asList(),
        runtime.getClassName()).getResults();

    assertThat(results.size()).isGreaterThan(2);

    Optional<Result> result = from(results).firstMatch(new ByAttributeName("SystemProperties.java.version"));
View Full Code Here

    AttributeList attr = ManagementFactory.getPlatformMBeanServer().getAttributes(
        memory.getObjectName(), new String[]{"HeapMemoryUsage"});
    List<Result> results = new JmxResultProcessor(
        query,
        memory,
        attr.asList(),
        memory.getClassName()).getResults();

    assertThat(results).hasSize(1);

    Result result = results.get(0);
View Full Code Here

      for (int i = 0; i < attrs.length; i++) {
        attrNames[i] = attrs[i].getName();
      }
      try {
        AttributeList attributes = connection.getAttributes(name, attrNames);
        for (Attribute attribute : attributes.asList()) {
          output(name.getCanonicalName() + "%" + attribute.getName(), attribute.getValue());
        }
      } catch (Exception e) {
        log.error("error getting " + name + ":" + e.getMessage(), e);
      }
View Full Code Here

      if (attributes.size() > 0) {
        log.debug("Executing queryName [{}] from query [{}]", queryName.getCanonicalName(), query);

        AttributeList al = mbeanServer.getAttributes(queryName, attributes.toArray(new String[attributes.size()]));

        results = new JmxResultProcessor(query, oi, al.asList(), info.getClassName()).getResults();
      }
    } catch (UnmarshalException ue) {
      if ((ue.getCause() != null) && (ue.getCause() instanceof ClassNotFoundException)) {
        log.debug("Bad unmarshall, continuing. This is probably ok and due to something like this: "
            + "http://ehcache.org/xref/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html#52", ue.getMessage());
View Full Code Here

        AttributeList attributes;
        try {
            attributes = mbsc.getAttributes(
                new ObjectName("java.lang:type=OperatingSystem"),
                new String[]{"OpenFileDescriptorCount", "MaxFileDescriptorCount"});
            List<Attribute> attrList = attributes.asList();
            long openFdCount = (Long)attrList.get(0).getValue();
            long maxFdCount = (Long)attrList.get(1).getValue();
            long[] fdCounts = { openFdCount, maxFdCount};
            return fdCounts;
        } catch (Exception e) {
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.