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;
}
java类javax.management.openmbean.TabularDataSupport的实例源码
TabularDataOrderTest.java 文件源码
项目:openjdk-jdk10
阅读 19
收藏 0
点赞 0
评论 0
JSON1.java 文件源码
项目:ysoserial-plus
阅读 26
收藏 0
点赞 0
评论 0
/**
* Will call all getter methods on payload that are defined in the given interfaces
*/
public static Map makeCallerChain ( Object payload, Class... ifaces ) throws OpenDataException, NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetException, Exception, ClassNotFoundException {
CompositeType rt = new CompositeType("a", "b", new String[] {
"a"
}, new String[] {
"a"
}, new OpenType[] {
javax.management.openmbean.SimpleType.INTEGER
});
TabularType tt = new TabularType("a", "b", rt, new String[] {
"a"
});
TabularDataSupport t1 = new TabularDataSupport(tt);
TabularDataSupport t2 = new TabularDataSupport(tt);
// we need to make payload implement composite data
// it's very likely that there are other proxy impls that could be used
AdvisedSupport as = new AdvisedSupport();
as.setTarget(payload);
InvocationHandler delegateInvocationHandler = (InvocationHandler) Reflections
.getFirstCtor("org.springframework.aop.framework.JdkDynamicAopProxy").newInstance(as);
InvocationHandler cdsInvocationHandler = Gadgets.createMemoizedInvocationHandler(Gadgets.createMap("getCompositeType", rt));
CompositeInvocationHandlerImpl invocationHandler = new CompositeInvocationHandlerImpl();
invocationHandler.addInvocationHandler(CompositeData.class, cdsInvocationHandler);
invocationHandler.setDefaultHandler(delegateInvocationHandler);
final CompositeData cdsProxy = Gadgets.createProxy(invocationHandler, CompositeData.class, ifaces);
JSONObject jo = new JSONObject();
Map m = new HashMap();
m.put("t", cdsProxy);
Reflections.setFieldValue(jo, "properties", m);
Reflections.setFieldValue(jo, "properties", m);
Reflections.setFieldValue(t1, "dataMap", jo);
Reflections.setFieldValue(t2, "dataMap", jo);
return Gadgets.makeMap(t1, t2);
}
TabularDataOrderTest.java 文件源码
项目:openjdk9
阅读 18
收藏 0
点赞 0
评论 0
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;
}
AdminDistributedSystemJmxImpl.java 文件源码
项目:gemfirexd-oss
阅读 16
收藏 0
点赞 0
评论 0
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);
}
}
TabularDataOrderTest.java 文件源码
项目:jdk8u_jdk
阅读 18
收藏 0
点赞 0
评论 0
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;
}
TabularDataOrderTest.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 20
收藏 0
点赞 0
评论 0
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;
}
ManagedRecipientList.java 文件源码
项目:Camel
阅读 21
收藏 0
点赞 0
评论 0
@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);
}
}
ManagedEnricher.java 文件源码
项目:Camel
阅读 21
收藏 0
点赞 0
评论 0
@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);
}
}
ManagedRoutingSlip.java 文件源码
项目:Camel
阅读 23
收藏 0
点赞 0
评论 0
@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);
}
}
ManagedRestRegistry.java 文件源码
项目:Camel
阅读 19
收藏 0
点赞 0
评论 0
@Override
public TabularData listRestServices() {
try {
TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listRestServicesTabularType());
List<RestRegistry.RestService> services = registry.listAllRestServices();
for (RestRegistry.RestService entry : services) {
CompositeType ct = CamelOpenMBeanTypes.listRestServicesCompositeType();
String url = entry.getUrl();
String baseUrl = entry.getBaseUrl();
String basePath = entry.getBasePath();
String uriTemplate = entry.getUriTemplate();
String method = entry.getMethod();
String consumes = entry.getConsumes();
String produces = entry.getProduces();
String state = entry.getState();
String inType = entry.getInType();
String outType = entry.getOutType();
String routeId = entry.getRouteId();
String description = entry.getDescription();
CompositeData data = new CompositeDataSupport(ct, new String[]
{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes", "produces", "inType", "outType", "state", "routeId", "description"},
new Object[]{url, baseUrl, basePath, uriTemplate, method, consumes, produces, inType, outType, state, routeId, description});
answer.put(data);
}
return answer;
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
}