Package javax.management.openmbean

Examples of javax.management.openmbean.TabularType


    public TabularData getQueries() {
        TabularDataSupport tds = null;
        try {
            CompositeType ct = QueryStatCompositeTypeFactory.getCompositeType();

            TabularType tt = new TabularType(QueryStatDto.class.getName(),
                    "Query History", ct, QueryStatCompositeTypeFactory.index);
            tds = new TabularDataSupport(tt);

            for (QueryStatDto q : getTopQueries()) {
                tds.put(new CompositeDataSupport(ct,
View Full Code Here


                types[i] = SimpleType.STRING;
            }

            try {
                CompositeType ct = new CompositeType(typeName, typeDescription, names, names, types);
                TabularType type = new TabularType(typeName, typeDescription, ct, names);
                TabularDataSupport data = new TabularDataSupport(type);

                CompositeData line = new CompositeDataSupport(ct, names, values);
                data.put(line);
View Full Code Here

    private CamelOpenMBeanTypes() {
    }

    public static TabularType listTypeConvertersTabularType() throws OpenDataException {
        CompositeType ct = listTypeConvertersCompositeType();
        return new TabularType("listTypeConverters", "Lists all the type converters in the registry (from -> to)", ct, new String[]{"from", "to"});
    }
View Full Code Here

  h.check(type5.getClassName(), "[L" + className + ";");
  h.check(type5.getTypeName(), "[L" + className + ";");
  h.check(type5.getElementOpenType().getClassName(), className);
  h.check(type5.getDescription(), "1-dimension array of " + className);
  h.checkPoint("Tabular Type Array");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  ArrayType type6 = new ArrayType(1, ttype);
  className = TabularData.class.getName();
  h.check(type6.getClassName(), "[L" + className + ";");
  h.check(type6.getTypeName(), "[L" + className + ";");
  h.check(type6.getElementOpenType().getClassName(), className);
View Full Code Here

  CompositeType ctype = new CompositeType("Test","Test",new String[]{"name"},
            new String[]{"Name"},
            new OpenType[] { SimpleType.STRING});
  ArrayType type6 = new ArrayType(1, ctype);
  h.check(!type6.isPrimitiveArray(), "Composite type false check");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  ArrayType type7 = new ArrayType(1, ttype);
  h.check(!type7.isPrimitiveArray(), "Tabular type false check");
  ArrayType type8 = new ArrayType(1, type1);
  h.check(type8.isPrimitiveArray(), "Carry through true check");
  ArrayType type9 = new ArrayType(1, type2);
View Full Code Here

  data.put("name", "Bob");
  CompositeData cdata = new CompositeDataSupport(ctype, data);
  CompositeData[] cdataarr = new CompositeData[] { cdata };
  ArrayType type2 = new ArrayType(1, ctype);
  h.check(type2.isValue(cdataarr), "Composite data check");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  TabularData tdata = new TabularDataSupport(ttype);
  tdata.put(cdata);
  TabularData[] tdataarr = new TabularData[] {tdata};
  ArrayType type3 = new ArrayType(1, ttype);
  h.check(type3.isValue(tdataarr), "Tabular data check");
View Full Code Here

                        "entry",
                        "An entry",
                        new String[] {"key", "value"},
                        new String[] {"The key", "The value"},
                        new OpenType[] {SimpleType.STRING, openType});
                openType = new TabularType("A map", "The map is indexed by 'key'", rowType, new String[] {"key"});
                return openType;
            } catch (OpenDataException e1) {
                throw new RuntimeException(e1);
            }
        }
View Full Code Here

                return converter.fromModelNode(node);
            }
        }

        Object fromSimpleModelNode(final ModelNode node) {
            final TabularType tabularType = (TabularType)getOpenType();
            final TabularDataSupport tabularData = new TabularDataSupport(tabularType);
            final Map<String, ModelNode> values = new HashMap<String, ModelNode>();
            final List<Property> properties = node.isDefined() ? node.asPropertyList() : null;
            if (properties != null) {
                for (Property prop : properties) {
                    values.put(prop.getName(), prop.getValue());
                }
            }

            final TypeConverter converter = TypeConverter.getConverter(valueTypeNode, null);
            for (Map.Entry<String, ModelNode> prop : values.entrySet()) {
                Map<String, Object> rowData = new HashMap<String, Object>();
                rowData.put("key", prop.getKey());
                rowData.put("value", converter.fromModelNode(prop.getValue()));
                try {
                    tabularData.put(new CompositeDataSupport(tabularType.getRowType(), rowData));
                } catch (OpenDataException e) {
                    throw new RuntimeException(e);
                }
            }
            return tabularData;
View Full Code Here

        Assert.assertEquals(description, composite.getDescription(name));
        return composite.getType(name);
    }

    private void assertMapType(OpenType<?> mapType, OpenType<?> keyType, OpenType<?> valueType) {
        TabularType type = assertCast(TabularType.class, mapType);
        Assert.assertEquals(1, type.getIndexNames().size());
        Assert.assertEquals("key", type.getIndexNames().get(0));
        Assert.assertEquals(2, type.getRowType().keySet().size());
        Assert.assertTrue(type.getRowType().keySet().contains("key"));
        Assert.assertTrue(type.getRowType().keySet().contains("value"));
        Assert.assertEquals(keyType, type.getRowType().getType("key"));
        Assert.assertEquals(valueType, type.getRowType().getType("value"));

    }
View Full Code Here

        CompositeDataSupport data = new CompositeDataSupport(type, items);
        return data;
    }

    private void assertMapType(OpenType<?> mapType, OpenType<?> keyType, OpenType<?> valueType) {
        TabularType type = assertCast(TabularType.class, mapType);
        Assert.assertEquals(1, type.getIndexNames().size());
        Assert.assertEquals("key", type.getIndexNames().get(0));
        Assert.assertEquals(2, type.getRowType().keySet().size());
        Assert.assertTrue(type.getRowType().keySet().contains("key"));
        Assert.assertTrue(type.getRowType().keySet().contains("value"));
        Assert.assertEquals(keyType, type.getRowType().getType("key"));
        Assert.assertEquals(valueType, type.getRowType().getType("value"));

    }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.TabularType

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.