Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeType


            else if ( value instanceof Float ) {
                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


    }

    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);
View Full Code Here

        private final static OpenType[] types = { SimpleType.LONG,
                SimpleType.LONG, SimpleType.STRING, SimpleType.STRING,
                SimpleType.STRING };

        public static CompositeType getCompositeType() throws OpenDataException {
            return new CompositeType(QueryStat.class.getName(),
                    QueryStat.class.getName(), names, descriptions, types);
        }
View Full Code Here

            for (int i = 0; i < types.length; i++) {
                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

    protected void createProperty(String propertyPrefix, Object result) {
        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) {
                    setProperty(propertyPrefix + "." + key, value);
                } else {
                    createProperty(propertyPrefix + "." + key, value);
                }
View Full Code Here

    public TabularData listTypeConverters() {
        try {
            TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listTypeConvertersTabularType());
            List<Class[]> converters = registry.listAllTypeConvertersFromTo();
            for (Class[] entry : converters) {
                CompositeType ct = CamelOpenMBeanTypes.listTypeConvertersCompositeType();
                String from = entry[0].getCanonicalName();
                String to = entry[1].getCanonicalName();
                CompositeData data = new CompositeDataSupport(ct, new String[]{"from", "to"}, new Object[]{from, to});
                answer.put(data);
            }
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

        CompositeType ct = listTypeConvertersCompositeType();
        return new TabularType("listTypeConverters", "Lists all the type converters in the registry (from -> to)", ct, new String[]{"from", "to"});
    }

    public static CompositeType listTypeConvertersCompositeType() throws OpenDataException {
        return new CompositeType("types", "From/To types", new String[]{"from", "to"},
                new String[]{"From type", "To type"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING});
    }
View Full Code Here

  h.check(type4.getClassName(), "[[[[Ljava.lang.String;");
  h.check(type4.getTypeName(), "[[[[Ljava.lang.String;");
  h.check(type4.getElementOpenType().getClassName(), "java.lang.String");
  h.check(type4.getDescription(), "4-dimension array of java.lang.String");
  h.checkPoint("Composite Type Array");
  CompositeType ctype = new CompositeType("Test","Test",new String[]{"name"},
            new String[]{"Name"},
            new OpenType[] { SimpleType.STRING});
  ArrayType type5 = new ArrayType(1, ctype);
  String className = CompositeData.class.getName();
  h.check(type5.getClassName(), "[L" + className + ";");
View Full Code Here

  h.check(!type3.isPrimitiveArray(), "Wrapped not masked false check");
  ArrayType type4 = new ArrayType(1, SimpleType.INTEGER);
  h.check(!type4.isPrimitiveArray(), "Normal wrapped false check");
  ArrayType type5 = new ArrayType(1, SimpleType.STRING);
  h.check(!type5.isPrimitiveArray(), "String false check");
  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"});
View Full Code Here

TOP

Related Classes of javax.management.openmbean.CompositeType

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.