当前位置: 首页>>代码示例>>Java>>正文


Java TabularData类代码示例

本文整理汇总了Java中javax.management.openmbean.TabularData的典型用法代码示例。如果您正苦于以下问题:Java TabularData类的具体用法?Java TabularData怎么用?Java TabularData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TabularData类属于javax.management.openmbean包,在下文中一共展示了TabularData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeTabularData

import javax.management.openmbean.TabularData; //导入依赖的package包/类
public void writeTabularData(TabularData tabularData) {
    if (tabularData == null) {
        writeNull();
        return;
    }

    int entryIndex = 0;
    write('[');

    for (Object item : tabularData.values()) {
        if (entryIndex != 0) {
            write(',');
        }
        CompositeData row = (CompositeData) item;
        writeCompositeData(row);

        entryIndex++;
    }
    write(']');
}
 
开发者ID:quartzweb,项目名称:quartz-web,代码行数:21,代码来源:JSONWriter.java

示例2: getAllTriggers

import javax.management.openmbean.TabularData; //导入依赖的package包/类
public TabularData getAllTriggers(String instanceId)
		throws SchedulerException {
	SchedulingContext cntx = new SchedulingContext(instanceId);
	List<Trigger> triggerList = new ArrayList<Trigger>();

	for (String triggerGroupName : scheduler.getTriggerGroupNames(cntx)) {
		for (String triggerName : scheduler.getTriggerNames(cntx,
				triggerGroupName)) {
			triggerList.add(scheduler.getTrigger(cntx, triggerName,
					triggerGroupName));
		}
	}

	return TriggerSupport.toTabularData(triggerList
			.toArray(new Trigger[triggerList.size()]));
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:17,代码来源:QuartzSchedulerMBeanImpl.java

示例3: newJobDetail

import javax.management.openmbean.TabularData; //导入依赖的package包/类
/**
 * @param cData
 * @return JobDetail
 */
public static JobDetail newJobDetail(CompositeData cData) {
	JobDetail jobDetail = new JobDetail();

	int i = 0;
	jobDetail.setName((String) cData.get(ITEM_NAMES[i++]));
	jobDetail.setGroup((String) cData.get(ITEM_NAMES[i++]));
	jobDetail.setDescription((String) cData.get(ITEM_NAMES[i++]));
	try {
		Class c = Class.forName((String) cData.get(ITEM_NAMES[i++]));
		jobDetail.setJobClass(c);
	} catch (ClassNotFoundException cnfe) {
		/**/
	}
	jobDetail.setJobDataMap(JobDataMapSupport
			.newJobDataMap((TabularData) cData.get(ITEM_NAMES[i++])));
	jobDetail.setVolatility((Boolean) cData.get(ITEM_NAMES[i++]));
	jobDetail.setDurability((Boolean) cData.get(ITEM_NAMES[i++]));
	jobDetail.setRequestsRecovery((Boolean) cData.get(ITEM_NAMES[i++]));

	return jobDetail;
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:26,代码来源:JobDetailSupport.java

示例4: toString

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
public String toString() {
    if (userData == null) {
        return null;
    }
    if (userData.getClass().isArray()) {
        String name =
                Utils.getArrayClassName(userData.getClass().getName());
        int length = Array.getLength(userData);
        return name + "[" + length + "]";
    }

    if (userData instanceof CompositeData ||
            userData instanceof TabularData) {
        return userData.getClass().getName();
    }

    return userData.toString();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XMBeanNotifications.java

示例5: toString

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
public String toString() {

    if(value == null) return null;

    if(value.getClass().isArray()) {
        String name =
            Utils.getArrayClassName(value.getClass().getName());
        int length = Array.getLength(value);
        return name + "[" + length +"]";
    }

    if(value instanceof CompositeData ||
       value instanceof TabularData)
        return value.getClass().getName();

    return value.toString();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:XMBeanAttributes.java

示例6: fromNonNullOpenValue

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
final Object fromNonNullOpenValue(Object openValue)
        throws InvalidObjectException {
    final TabularData table = (TabularData) openValue;
    final Collection<CompositeData> rows = cast(table.values());
    final Map<Object, Object> valueMap =
        sortedMap ? newSortedMap() : newInsertionOrderMap();
    for (CompositeData row : rows) {
        final Object key =
            keyMapping.fromOpenValue(row.get("key"));
        final Object value =
            valueMapping.fromOpenValue(row.get("value"));
        if (valueMap.put(key, value) != null) {
            final String msg =
                "Duplicate entry in TabularData: key=" + key;
            throw new InvalidObjectException(msg);
        }
    }
    return valueMap;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:DefaultMXBeanMappingFactory.java

示例7: recursive

import javax.management.openmbean.TabularData; //导入依赖的package包/类
private void recursive(GenericObject object, String key, Object value) {
	if (value instanceof CompositeData) {
		CompositeData composite = (CompositeData) value;
		object.put(key, toGenericObject(composite));
	} else if (value instanceof TabularData) {
		TabularData tabularData = (TabularData) value;
		@SuppressWarnings("unchecked")
		Collection<CompositeData> values = (Collection<CompositeData>) tabularData.values();
		GenericArray array = new GenericArray();
		for (CompositeData data : values) {
			array.add(toGenericObject(data));
		}
		object.put(key, array);
	} else if (value instanceof Number || value instanceof Boolean || value instanceof String){
		object.put(key, value);
	} else {
		// todo log
	}
}
 
开发者ID:denkbar,项目名称:djigger,代码行数:20,代码来源:MBeanCollector.java

示例8: convertToString

import javax.management.openmbean.TabularData; //导入依赖的package包/类
public static String convertToString(Object value) {
    if (value == null) {
        return null;
    }

    if (value.getClass().isArray()) {
        StringBuilder b = new StringBuilder("[");
        int length = Array.getLength(value);
        for (int i = 0; i < length; i++) {
            Object o = Array.get(value, i);
            b.append(convertToString(o));
            if (i < length - 1) {
                b.append(", ");
            }
        }
        return b.append("]").toString();
    }
    else if (value instanceof CompositeData) {
        return compositeToString((CompositeData) value);
    }
    else if (value instanceof TabularData) {
        return tabularToString((TabularData) value);
    }
    return value.toString();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:26,代码来源:AttributeHelper.java

示例9: browse

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
public TabularData browse(String routeId, int limit, boolean sortByLongestDuration) {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listInflightExchangesTabularType());
        Collection<InflightRepository.InflightExchange> exchanges = inflightRepository.browse(routeId, limit, sortByLongestDuration);

        for (InflightRepository.InflightExchange entry : exchanges) {
            CompositeType ct = CamelOpenMBeanTypes.listInflightExchangesCompositeType();
            String exchangeId = entry.getExchange().getExchangeId();
            String fromRouteId = entry.getFromRouteId();
            String atRouteId = entry.getAtRouteId();
            String nodeId = entry.getNodeId();
            String elapsed = "" + entry.getElapsed();
            String duration = "" + entry.getDuration();

            CompositeData data = new CompositeDataSupport(ct,
                    new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"},
                    new Object[]{exchangeId, fromRouteId, atRouteId, nodeId, elapsed, duration});
            answer.put(data);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:ManagedInflightRepository.java

示例10: extendedInformation

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
public TabularData extendedInformation() {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.endpointsUtilizationTabularType());

        // we only have 1 endpoint

        CompositeType ct = CamelOpenMBeanTypes.endpointsUtilizationCompositeType();
        String url = getDestination();
        Long hits = processor.getCounter();

        CompositeData data = new CompositeDataSupport(ct, new String[]{"url", "hits"}, new Object[]{url, hits});
        answer.put(data);
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:ManagedSendProcessor.java

示例11: listEndpoints

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public TabularData listEndpoints() {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listEndpointsTabularType());
        Collection<Endpoint> endpoints = endpointRegistry.values();
        for (Endpoint endpoint : endpoints) {
            CompositeType ct = CamelOpenMBeanTypes.listEndpointsCompositeType();
            String url = endpoint.getEndpointUri();
            if (sanitize) {
                url = URISupport.sanitizeUri(url);
            }

            boolean fromStatic = endpointRegistry.isStatic(url);
            boolean fromDynamic = endpointRegistry.isDynamic(url);

            CompositeData data = new CompositeDataSupport(ct, new String[]{"url", "static", "dynamic"}, new Object[]{url, fromStatic, fromDynamic});
            answer.put(data);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:ManagedEndpointRegistry.java

示例12: browse

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Override
public TabularData browse() {
    try {
        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listAwaitThreadsTabularType());
        Collection<AsyncProcessorAwaitManager.AwaitThread> threads = manager.browse();
        for (AsyncProcessorAwaitManager.AwaitThread entry : threads) {
            CompositeType ct = CamelOpenMBeanTypes.listAwaitThreadsCompositeType();
            String id = "" + entry.getBlockedThread().getId();
            String name = entry.getBlockedThread().getName();
            String exchangeId = entry.getExchange().getExchangeId();
            String routeId = entry.getRouteId();
            String nodeId = entry.getNodeId();
            String duration = "" + entry.getWaitDuration();

            CompositeData data = new CompositeDataSupport(ct,
                    new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"},
                    new Object[]{id, name, exchangeId, routeId, nodeId, duration});
            answer.put(data);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:ManagedAsyncProcessorAwaitManager.java

示例13: listTypeConverters

import javax.management.openmbean.TabularData; //导入依赖的package包/类
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);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:ManagedTypeConverterRegistry.java

示例14: listEips

import javax.management.openmbean.TabularData; //导入依赖的package包/类
public TabularData listEips() throws Exception {
    try {
        // find all EIPs
        Map<String, Properties> eips = context.findEips();

        TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listEipsTabularType());

        // gather EIP detail for each eip
        for (Map.Entry<String, Properties> entry : eips.entrySet()) {
            String name = entry.getKey();
            String title = (String) entry.getValue().get("title");
            String description = (String) entry.getValue().get("description");
            String label = (String) entry.getValue().get("label");
            String type = (String) entry.getValue().get("class");
            String status = CamelContextHelper.isEipInUse(context, name) ? "in use" : "on classpath";
            CompositeType ct = CamelOpenMBeanTypes.listEipsCompositeType();
            CompositeData data = new CompositeDataSupport(ct, new String[]{"name", "title", "description", "label", "status", "type"},
                    new Object[]{name, title, description, label, status, type});
            answer.put(data);
        }
        return answer;
    } catch (Exception e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:ManagedCamelContext.java

示例15: testListEips

import javax.management.openmbean.TabularData; //导入依赖的package包/类
@Test
public void testListEips() throws Exception {
    // JMX tests dont work well on AIX CI servers (hangs them)
    if (isPlatform("aix")) {
        return;
    }

    MBeanServer mbeanServer = getMBeanServer();

    ObjectName on = ObjectName.getInstance("org.apache.camel:context=19-camel-1,type=context,name=\"camel-1\"");

    assertTrue("Should be registered", mbeanServer.isRegistered(on));

    @SuppressWarnings("unchecked")
    TabularData data = (TabularData) mbeanServer.invoke(on, "listEips", null, null);
    assertNotNull(data);
    assertTrue(data.size() > 150);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:SpringManagedCamelContextTest.java


注:本文中的javax.management.openmbean.TabularData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。