Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeType.keySet()


public class JmxInstanceTest extends TestCase {
    public void testJMXInstanceStatics() {
        CompositeType it = JmxInstance.INSTANCE;
        Assert.assertEquals(
            new HashSet<String>(Arrays.asList(AdminServiceMBean.INSTANCE)),
            it.keySet());

        TabularType tt = JmxInstance.INSTANCE_TABLE;
        Assert.assertEquals("Instances", tt.getTypeName());
    }
View Full Code Here


        final Map<String, Object> attrMap = new TreeMap<String, Object>();
        attrMap.put(Constants.PROP_RESOURCE_TYPE, Constants.TYPE_ATTRIBUTES);
        result.put(Constants.RSRC_ATTRIBUTES, attrMap);

        final Set<String> names = type.keySet();
        for(final String name : names) {
            final Map<String, Object> dataMap = new HashMap<String, Object>();
            attrMap.put(name, dataMap);
            dataMap.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, type.getType(name));
            dataMap.put(Constants.PROP_RESOURCE_SUPER_TYPE, Constants.TYPE_ATTRIBUTE);
View Full Code Here

                rr.set(objectName + "`" + metricName, (Float)value);
            }
            else if ( value instanceof CompositeDataSupport ) {
                CompositeDataSupport data = (CompositeDataSupport)value;
                CompositeType type = data.getCompositeType();
                Set keys = type.keySet();
                for ( Iterator it = keys.iterator(); it.hasNext(); ) {
                    String key = (String)it.next();
                    getMetric(objectName, metricName + "`" + key, data.get(key), rr);
                }
            }
View Full Code Here

        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
View Full Code Here

            final OpenType<?> openType = getOpenType();
            if (openType instanceof CompositeType) {
                final CompositeType compositeType = (CompositeType)openType;
                //Create a composite
                final Map<String, Object> items = new HashMap<String, Object>();
                for (String attrName : compositeType.keySet()) {
                    TypeConverter converter = getConverter(typeNode.get(attrName, TYPE), typeNode.get(attrName, VALUE_TYPE));
                    items.put(attrName, converter.fromModelNode(node.get(attrName)));
                }

                try {
View Full Code Here

        description.get(VALUE_TYPE).set(complexValueType);

        TypeConverter converter = getConverter(description);

        CompositeType type = assertCast(CompositeType.class, converter.getOpenType());
        Set<String> keys = type.keySet();
        Assert.assertEquals(10, keys.size());
        assertCompositeType(type, "int-value", Integer.class.getName(), "An int value");
        //TODO big integer not working properly in current version of dmr
        //assertCompositeType(composite, "bigint-value", BigInteger.class.getName(), "A biginteger value");
        assertCompositeType(type, "bigdecimal-value", BigDecimal.class.getName(), "A bigdecimal value");
View Full Code Here

        TypeConverter converter = getConverter(description);

        ArrayType<CompositeType> arrayType = assertCast(ArrayType.class, converter.getOpenType());
        CompositeType type = assertCast(CompositeType.class, arrayType.getElementOpenType());
        Set<String> keys = type.keySet();
        Assert.assertEquals(2, keys.size());
        assertCompositeType(type, "int-value", Integer.class.getName(), "An int value");
        assertCompositeType(type, "list-int-value", Integer[].class.getName(), "An int list value");

        ModelNode node = new ModelNode();
View Full Code Here

        description.get(VALUE_TYPE).set(complexValueType);

        TypeConverter converter = getConverter(description);

        CompositeType type = assertCast(CompositeType.class, converter.getOpenType());
        Set<String> keys = type.keySet();
        Assert.assertEquals(1, keys.size());

        Assert.assertEquals(SimpleType.STRING, type.getType("value"));

        ModelNode node = new ModelNode();
View Full Code Here

                contentType = (CompositeType)((ArrayType<CompositeType>)((OpenMBeanParameterInfo)op.getSignature()[2]).getOpenType()).getElementOpenType();
                break;
            }
        }
        Map<String, Object> values = new HashMap<String, Object>();
        for (String key : contentType.keySet()) {
            values.put(key, null);
        }
        values.put("hash", hash);
        CompositeData contents = new CompositeDataSupport(contentType, values);
View Full Code Here

        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
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.