Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeDataSupport


            Collection<Endpoint> endpoints = endpointRegistry.values();
            for (Endpoint endpoint : endpoints) {
                CompositeType ct = CamelOpenMBeanTypes.listEndpointsCompositeType();
                String url = endpoint.getEndpointUri();

                CompositeData data = new CompositeDataSupport(ct, new String[]{"url"}, new Object[]{url});
                answer.put(data);
            }
            return answer;
        } catch (Exception e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
View Full Code Here


                String value = row.get("value") != null ? row.get("value") : "";
                String defaultValue = row.get("defaultValue") != null ? row.get("defaultValue") : "";
                String description = row.get("description") != null ? row.get("description") : "";

                CompositeType ct = CamelOpenMBeanTypes.explainEndpointsCompositeType();
                CompositeData data = new CompositeDataSupport(ct,
                        new String[]{"option", "type", "java type", "value", "default value", "description"},
                        new Object[]{option, type, javaType, value, defaultValue, description});
                answer.put(data);
            }
View Full Code Here

      for (Iterator<Object> it = tdata.values().iterator(); it.hasNext();) {
        Object object = (Object) it.next();
        if (!(object instanceof CompositeDataSupport)) {
          continue;
        }
        CompositeDataSupport compositeDataSupport = (CompositeDataSupport) object;
        Job job = new Job();
        job.setSchedulerName(scheduler.getName());
        job.setQuartzInstanceId(scheduler.getQuartzInstanceUUID());
        job.setSchedulerInstanceId(scheduler.getInstanceId());
        job.setJobName((String) JMXUtil.convertToType(compositeDataSupport, "name"));
View Full Code Here

        {
         log.info("-------"+jobName+" trigger size:"+list.size());
           triggers = new ArrayList<Trigger>();
           for (int i = 0; i < list.size(); i++)
           {
              CompositeDataSupport compositeDataSupport = (CompositeDataSupport) list.get(i);
              Trigger trigger = new Trigger();
              trigger.setCalendarName((String) JMXUtil.convertToType(compositeDataSupport, "calendarName"));
              log.info("-------"+jobName+" trigger's calendar name:"+trigger.getCalendarName());
              trigger.setDescription((String) JMXUtil.convertToType(compositeDataSupport, "description"));
              trigger.setEndTime((Date) JMXUtil.convertToType(compositeDataSupport, "endTime"));
View Full Code Here

            }
            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);
                }
            }
            else if ( value instanceof TabularDataSupport ) {
                TabularDataSupport data = (TabularDataSupport)value;
                Set keys = data.keySet();
                for ( Iterator it = keys.iterator(); it.hasNext(); ) {
                    Object key = it.next();
                    for ( Iterator ki = ((List) key).iterator(); ki.hasNext(); ) {
                        Object key2 = ki.next();
                        CompositeData cd = data.get(new Object[] {key2});
                        getMetric(objectName, metricName + "`" + key2, cd.get("value"), rr);
                    }
                }
            }
            else if ( value.getClass().isArray() ) {
View Full Code Here

            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,
                        QueryStatCompositeTypeFactory.names,
                        QueryStatCompositeTypeFactory.getValues(q)));
            }
            return tds;
        } catch (Exception e) {
View Full Code Here

            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);

                return data;
            } catch (OpenDataException e) {
                return null;
View Full Code Here

        items.put(VERSION, "0.0.0");
        TabularData headerTable = new TabularDataSupport(HEADERS_TYPE);
        headerTable.put(new Header("a", "a").toCompositeData());
        headerTable.put(new Header("b", "b").toCompositeData());
        items.put(HEADERS, headerTable);
        CompositeData compositeData = new CompositeDataSupport(BUNDLE_TYPE, items);
       
        BundleData b = BundleData.from(compositeData);
       
        assertEquals("test", b.getSymbolicName());
        assertEquals("0.0.0", b.getVersion());
View Full Code Here

    }
   
    @Test
    public void testHeaderFromCompositeData() throws Exception {
       
        CompositeData compositeData = new CompositeDataSupport(HEADER_TYPE, new String[] { KEY, VALUE } , new String [] { "c", "d" });
        Header header = Header.from(compositeData);
        assertEquals("c", header.getKey());
        assertEquals("d", header.getValue());
       
    }
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);
                }
            }
        } else if (result instanceof TabularDataSupport) {
            TabularDataSupport data = (TabularDataSupport) result;
            for (Iterator iter = data.keySet().iterator(); iter.hasNext();) {
                Object key = iter.next();
                for (Iterator iter1 = ((List) key).iterator(); iter1.hasNext();) {
                    Object key1 = iter1.next();
                    CompositeData valuedata = data.get(new Object[] { key1 });
                    Object value = valuedata.get("value");
                    OpenType type = valuedata.getCompositeType().getType(
                            "value");
                    if (type instanceof SimpleType) {
                        setProperty(propertyPrefix + "." + key1, value);
View Full Code Here

TOP

Related Classes of javax.management.openmbean.CompositeDataSupport

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.