本文整理汇总了Java中javax.management.openmbean.TabularData.put方法的典型用法代码示例。如果您正苦于以下问题:Java TabularData.put方法的具体用法?Java TabularData.put怎么用?Java TabularData.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.openmbean.TabularData
的用法示例。
在下文中一共展示了TabularData.put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: apply
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
@Override
public TabularData apply(InProgressSnapshot from) {
List<OpenType<?>> types = Lists.transform(from.getColumnClasses(), CLASS_TO_OPENTYPE);
CompositeType rowType;
try {
int columnCount = from.getColumnCount();
rowType = new CompositeType("Snapshot row", "Snapshot row", from.getColumnNames()
.toArray(new String[columnCount]), from.getColumnDescriptions().toArray(
new String[columnCount]), types.toArray(new OpenType<?>[columnCount]));
TabularType type = new TabularType("Snapshot", "Snapshot", rowType,
new String[] { "Thread name" });
TabularData data = new TabularDataSupport(type);
for (Map<String, Object> dataRow : from.getValues()) {
CompositeData row = new CompositeDataSupport(rowType, dataRow);
data.put(row);
}
return data;
} catch (OpenDataException e) {
throw new RuntimeException(e);
}
}
示例8: aggregateStats
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
/**
* Aggregates two tabular structures into one.
*
* @param source the source tabular
* @param target the target tabular
* @param aggregator the aggregator which will perform data aggregation
* @return the aggregated tabular structure
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static TabularData aggregateStats(TabularData source, TabularData target, StatsAggregator aggregator) {
logger.debug("aggregateStats.enter; got source: {}", source);
if (source == null) {
return target;
}
TabularData result = new TabularDataSupport(source.getTabularType());
Set<List> keys = (Set<List>) source.keySet();
if (target == null) {
return source;
} else {
for (List key: keys) {
Object[] index = key.toArray();
CompositeData aggr = aggregateStats(source.get(index), target.get(index), aggregator);
result.put(aggr);
}
}
logger.debug("aggregateStats.exit; returning: {}", result);
return result;
}
示例9: makeTable
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
private static TabularData makeTable() throws OpenDataException {
TabularData td = new TabularDataSupport(tt);
for (Map.Entry<String, Integer> entry : stringToValue.entrySet()) {
CompositeData cd = new CompositeDataSupport(
ct,
new String[] {"name", "int"},
new Object[] {entry.getKey(), entry.getValue()});
td.put(cd);
}
return td;
}
示例10: getMissingPersistentMembersJMX
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
public TabularData getMissingPersistentMembersJMX() throws AdminException {
try {
Set<PersistentID> members = super.getMissingPersistentMembers();
TabularData results = new TabularDataSupport(PERSISTENT_ID_TABLE_TYPE);
for(PersistentID id : members) {
CompositeData idData = new CompositeDataSupport(PERSISTENT_ID_TYPE, PERSISTENT_ID_FIELDS, new Object[] {id.getHost().toString(), id.getDirectory(), id.getUUID().toString()});
results.put(idData);
}
return results;
} catch( OpenDataException e) {
logger.warning(LocalizedStrings.ONE_ARG, "Exception occurred while getting missing persistent members.", e);
throw new AdminException(e);
}
}
示例11: extendedInformation
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
@Override
public TabularData extendedInformation() {
try {
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.endpointsUtilizationTabularType());
EndpointUtilizationStatistics stats = processor.getEndpointUtilizationStatistics();
if (stats != null) {
for (Map.Entry<String, Long> entry : stats.getStatistics().entrySet()) {
CompositeType ct = CamelOpenMBeanTypes.endpointsUtilizationCompositeType();
String url = entry.getKey();
if (sanitize) {
url = URISupport.sanitizeUri(url);
}
Long hits = entry.getValue();
if (hits == null) {
hits = 0L;
}
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);
}
}
示例12: explain
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
@Override
public TabularData explain(boolean allOptions) {
String dataFormatName = getName();
if (dataFormatName != null) {
try {
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.explainDataFormatTabularType());
String json = camelContext.explainDataFormatJson(dataFormatName, dataFormat, allOptions);
List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);
for (Map<String, String> row : rows) {
String name = row.get("name");
String kind = row.get("kind");
String label = row.get("label") != null ? row.get("label") : "";
String type = row.get("type");
String javaType = row.get("javaType");
String deprecated = row.get("deprecated") != null ? row.get("deprecated") : "";
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.explainDataFormatsCompositeType();
CompositeData data = new CompositeDataSupport(ct,
new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"},
new Object[]{name, kind, label, type, javaType, deprecated, value, defaultValue, description});
answer.put(data);
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
} else {
return null;
}
}
示例13: explain
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
@Override
public TabularData explain(boolean allOptions) {
try {
String json = endpoint.getCamelContext().explainEndpointJson(getEndpointUri(), allOptions);
List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.explainEndpointTabularType());
for (Map<String, String> row : rows) {
String name = row.get("name");
String kind = row.get("kind");
String group = row.get("group") != null ? row.get("group") : "";
String label = row.get("label") != null ? row.get("label") : "";
String type = row.get("type");
String javaType = row.get("javaType");
String deprecated = row.get("deprecated") != null ? row.get("deprecated") : "";
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", "kind", "group", "label", "type", "java type", "deprecated", "value", "default value", "description"},
new Object[]{name, kind, group, label, type, javaType, deprecated, value, defaultValue, description});
answer.put(data);
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}
示例14: explain
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
public TabularData explain(boolean allOptions) {
try {
String json = context.explainEipJson(id, allOptions);
List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.explainEipTabularType());
for (Map<String, String> row : rows) {
String name = row.get("name");
String kind = row.get("kind");
String label = row.get("label") != null ? row.get("label") : "";
String type = row.get("type");
String javaType = row.get("javaType");
String deprecated = row.get("deprecated") != null ? row.get("deprecated") : "";
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.explainEipsCompositeType();
CompositeData data = new CompositeDataSupport(ct,
new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"},
new Object[]{name, kind, label, type, javaType, deprecated, value, defaultValue, description});
answer.put(data);
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}
示例15: endpointStatistics
import javax.management.openmbean.TabularData; //导入方法依赖的package包/类
@Override
public TabularData endpointStatistics() {
try {
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listRuntimeEndpointsTabularType());
EndpointRegistry staticRegistry = getContext().getEndpointRegistry();
int index = 0;
for (RuntimeEndpointRegistry.Statistic stat : registry.getEndpointStatistics()) {
CompositeType ct = CamelOpenMBeanTypes.listRuntimeEndpointsCompositeType();
String url = stat.getUri();
Boolean isStatic = staticRegistry.isStatic(url);
Boolean isDynamic = staticRegistry.isDynamic(url);
if (sanitize) {
url = URISupport.sanitizeUri(url);
}
String routeId = stat.getRouteId();
String direction = stat.getDirection();
long hits = stat.getHits();
CompositeData data = new CompositeDataSupport(ct, new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"},
new Object[]{index, url, routeId, direction, isStatic, isDynamic, hits});
answer.put(data);
// use a counter as the single index in the TabularData as we do not want a multi-value index
index++;
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}