javax.management.openmbean.CompositeDataSupport Java Examples
The following examples show how to use
javax.management.openmbean.CompositeDataSupport.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultMXBeanMappingFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override final Object toNonNullOpenValue(Object value) throws OpenDataException { CompositeType ct = (CompositeType) getOpenType(); if (value instanceof CompositeDataView) return ((CompositeDataView) value).toCompositeData(ct); if (value == null) return null; Object[] values = new Object[getters.length]; for (int i = 0; i < getters.length; i++) { try { Object got = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }
Example #2
Source File: StackTraceElementCompositeData.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // stackTraceElementItemNames! final Object[] stackTraceElementItemValues = { ste.getClassName(), ste.getMethodName(), ste.getFileName(), new Integer(ste.getLineNumber()), new Boolean(ste.isNativeMethod()), }; try { return new CompositeDataSupport(stackTraceElementCompositeType, stackTraceElementItemNames, stackTraceElementItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #3
Source File: StackTraceElementCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // stackTraceElementItemNames! final Object[] stackTraceElementItemValues = { ste.getClassName(), ste.getMethodName(), ste.getFileName(), new Integer(ste.getLineNumber()), new Boolean(ste.isNativeMethod()), }; try { return new CompositeDataSupport(stackTraceElementCompositeType, stackTraceElementItemNames, stackTraceElementItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #4
Source File: VMOptionCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // vmOptionItemNames! final Object[] vmOptionItemValues = { option.getName(), option.getValue(), new Boolean(option.isWriteable()), option.getOrigin().toString(), }; try { return new CompositeDataSupport(vmOptionCompositeType, vmOptionItemNames, vmOptionItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #5
Source File: MemoryNotifInfoCompositeData.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryNotifInfoItemNames! final Object[] memoryNotifInfoItemValues = { memoryNotifInfo.getPoolName(), MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()), new Long(memoryNotifInfo.getCount()), }; try { return new CompositeDataSupport(memoryNotifInfoCompositeType, memoryNotifInfoItemNames, memoryNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #6
Source File: DefaultMXBeanMappingFactory.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@Override final Object toNonNullOpenValue(Object value) throws OpenDataException { CompositeType ct = (CompositeType) getOpenType(); if (value instanceof CompositeDataView) return ((CompositeDataView) value).toCompositeData(ct); if (value == null) return null; Object[] values = new Object[getters.length]; for (int i = 0; i < getters.length; i++) { try { Object got = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }
Example #7
Source File: VMOptionCompositeData.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // vmOptionItemNames! final Object[] vmOptionItemValues = { option.getName(), option.getValue(), new Boolean(option.isWriteable()), option.getOrigin().toString(), }; try { return new CompositeDataSupport(vmOptionCompositeType, vmOptionItemNames, vmOptionItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #8
Source File: TriggerSupport.java From lams with GNU General Public License v2.0 | 6 votes |
public static CompositeData toCompositeData(Trigger trigger) { try { return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES, new Object[] { trigger.getKey().getName(), trigger.getKey().getGroup(), trigger.getJobKey().getName(), trigger.getJobKey().getGroup(), trigger.getDescription(), JobDataMapSupport.toTabularData(trigger .getJobDataMap()), trigger.getCalendarName(), ((OperableTrigger)trigger).getFireInstanceId(), trigger.getMisfireInstruction(), trigger.getPriority(), trigger.getStartTime(), trigger.getEndTime(), trigger.getNextFireTime(), trigger.getPreviousFireTime(), trigger.getFinalFireTime() }); } catch (OpenDataException e) { throw new RuntimeException(e); } }
Example #9
Source File: MemoryNotifInfoCompositeData.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryNotifInfoItemNames! final Object[] memoryNotifInfoItemValues = { memoryNotifInfo.getPoolName(), MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()), memoryNotifInfo.getCount(), }; try { return new CompositeDataSupport(memoryNotifInfoCompositeType, memoryNotifInfoItemNames, memoryNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #10
Source File: DefaultMXBeanMappingFactory.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override final Object toNonNullOpenValue(Object value) throws OpenDataException { CompositeType ct = (CompositeType) getOpenType(); if (value instanceof CompositeDataView) return ((CompositeDataView) value).toCompositeData(ct); if (value == null) return null; Object[] values = new Object[getters.length]; for (int i = 0; i < getters.length; i++) { try { Object got = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }
Example #11
Source File: CronTriggerSupport.java From lams with GNU General Public License v2.0 | 6 votes |
public static CompositeData toCompositeData(CronTrigger trigger) { try { return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES, new Object[] { trigger.getCronExpression(), trigger.getTimeZone(), trigger.getKey().getName(), trigger.getKey().getGroup(), trigger.getJobKey().getName(), trigger.getJobKey().getGroup(), trigger.getDescription(), JobDataMapSupport.toTabularData(trigger .getJobDataMap()), trigger.getCalendarName(), ((OperableTrigger)trigger).getFireInstanceId(), trigger.getMisfireInstruction(), trigger.getPriority(), trigger.getStartTime(), trigger.getEndTime(), trigger.getNextFireTime(), trigger.getPreviousFireTime(), trigger.getFinalFireTime() }); } catch (OpenDataException e) { throw new RuntimeException(e); } }
Example #12
Source File: SlowQueryReportJmx.java From Tomcat7.0.67 with Apache License 2.0 | 6 votes |
/** * JMX operation - returns all the queries we have collected. * @return - the slow query report as composite data. */ @Override public CompositeData[] getSlowQueriesCD() throws OpenDataException { CompositeDataSupport[] result = null; ConcurrentHashMap<String,QueryStats> queries = perPoolStats.get(poolName); if (queries!=null) { Set<Map.Entry<String,QueryStats>> stats = queries.entrySet(); if (stats!=null) { result = new CompositeDataSupport[stats.size()]; Iterator<Map.Entry<String,QueryStats>> it = stats.iterator(); int pos = 0; while (it.hasNext()) { Map.Entry<String,QueryStats> entry = it.next(); QueryStats qs = entry.getValue(); result[pos++] = qs.getCompositeData(getCompositeType()); } } } return result; }
Example #13
Source File: LockInfoCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // lockInfoItemNames! final Object[] lockInfoItemValues = { new String(lock.getClassName()), new Integer(lock.getIdentityHashCode()), }; try { return new CompositeDataSupport(lockInfoCompositeType, lockInfoItemNames, lockInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw Util.newException(e); } }
Example #14
Source File: StackTraceElementCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // stackTraceElementItemNames! final Object[] stackTraceElementItemValues = { ste.getClassName(), ste.getMethodName(), ste.getFileName(), new Integer(ste.getLineNumber()), new Boolean(ste.isNativeMethod()), }; try { return new CompositeDataSupport(stackTraceElementCompositeType, stackTraceElementItemNames, stackTraceElementItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #15
Source File: GarbageCollectionNotifInfoCompositeData.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // gcNotifInfoItemNames! final Object[] gcNotifInfoItemValues; gcNotifInfoItemValues = new Object[] { gcNotifInfo.getGcName(), gcNotifInfo.getGcAction(), gcNotifInfo.getGcCause(), GcInfoCompositeData.toCompositeData(gcNotifInfo.getGcInfo()) }; CompositeType gict = getCompositeTypeByBuilder(); try { return new CompositeDataSupport(gict, gcNotifInfoItemNames, gcNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #16
Source File: MemoryUsageCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryUsageItemNames! final Object[] memoryUsageItemValues = { new Long(usage.getInit()), new Long(usage.getUsed()), new Long(usage.getCommitted()), new Long(usage.getMax()), }; try { return new CompositeDataSupport(memoryUsageCompositeType, memoryUsageItemNames, memoryUsageItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #17
Source File: GarbageCollectionNotifInfoCompositeData.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // gcNotifInfoItemNames! final Object[] gcNotifInfoItemValues; gcNotifInfoItemValues = new Object[] { gcNotifInfo.getGcName(), gcNotifInfo.getGcAction(), gcNotifInfo.getGcCause(), GcInfoCompositeData.toCompositeData(gcNotifInfo.getGcInfo()) }; CompositeType gict = getCompositeTypeByBuilder(); try { return new CompositeDataSupport(gict, gcNotifInfoItemNames, gcNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #18
Source File: StackTraceElementCompositeData.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // stackTraceElementItemNames! final Object[] stackTraceElementItemValues = { ste.getClassName(), ste.getMethodName(), ste.getFileName(), new Integer(ste.getLineNumber()), new Boolean(ste.isNativeMethod()), }; try { return new CompositeDataSupport(stackTraceElementCompositeType, stackTraceElementItemNames, stackTraceElementItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #19
Source File: MemoryNotifInfoCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryNotifInfoItemNames! final Object[] memoryNotifInfoItemValues = { memoryNotifInfo.getPoolName(), MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()), new Long(memoryNotifInfo.getCount()), }; try { return new CompositeDataSupport(memoryNotifInfoCompositeType, memoryNotifInfoItemNames, memoryNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #20
Source File: LockInfoCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // lockInfoItemNames! final Object[] lockInfoItemValues = { new String(lock.getClassName()), new Integer(lock.getIdentityHashCode()), }; try { return new CompositeDataSupport(lockInfoCompositeType, lockInfoItemNames, lockInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw Util.newException(e); } }
Example #21
Source File: MemoryNotifInfoCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryNotifInfoItemNames! final Object[] memoryNotifInfoItemValues = { memoryNotifInfo.getPoolName(), MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()), new Long(memoryNotifInfo.getCount()), }; try { return new CompositeDataSupport(memoryNotifInfoCompositeType, memoryNotifInfoItemNames, memoryNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #22
Source File: VMOptionCompositeData.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // vmOptionItemNames! final Object[] vmOptionItemValues = { option.getName(), option.getValue(), new Boolean(option.isWriteable()), option.getOrigin().toString(), }; try { return new CompositeDataSupport(vmOptionCompositeType, vmOptionItemNames, vmOptionItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #23
Source File: MemoryUsageCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryUsageItemNames! final Object[] memoryUsageItemValues = { new Long(usage.getInit()), new Long(usage.getUsed()), new Long(usage.getCommitted()), new Long(usage.getMax()), }; try { return new CompositeDataSupport(memoryUsageCompositeType, memoryUsageItemNames, memoryUsageItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #24
Source File: GarbageCollectionNotifInfoCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // gcNotifInfoItemNames! final Object[] gcNotifInfoItemValues; gcNotifInfoItemValues = new Object[] { gcNotifInfo.getGcName(), gcNotifInfo.getGcAction(), gcNotifInfo.getGcCause(), GcInfoCompositeData.toCompositeData(gcNotifInfo.getGcInfo()) }; CompositeType gict = getCompositeTypeByBuilder(); try { return new CompositeDataSupport(gict, gcNotifInfoItemNames, gcNotifInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #25
Source File: StackTraceElementCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // stackTraceElementItemNames! final Object[] stackTraceElementItemValues = { ste.getClassName(), ste.getMethodName(), ste.getFileName(), new Integer(ste.getLineNumber()), new Boolean(ste.isNativeMethod()), }; try { return new CompositeDataSupport(stackTraceElementCompositeType, stackTraceElementItemNames, stackTraceElementItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #26
Source File: DefaultMXBeanMappingFactory.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override final Object toNonNullOpenValue(Object value) throws OpenDataException { CompositeType ct = (CompositeType) getOpenType(); if (value instanceof CompositeDataView) return ((CompositeDataView) value).toCompositeData(ct); if (value == null) return null; Object[] values = new Object[getters.length]; for (int i = 0; i < getters.length; i++) { try { Object got = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }
Example #27
Source File: LockInfoCompositeData.java From hottub with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // lockInfoItemNames! final Object[] lockInfoItemValues = { new String(lock.getClassName()), new Integer(lock.getIdentityHashCode()), }; try { return new CompositeDataSupport(lockInfoCompositeType, lockInfoItemNames, lockInfoItemValues); } catch (OpenDataException e) { // Should never reach here throw Util.newException(e); } }
Example #28
Source File: TypeConverters.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
@Override public Object fromModelNode(ModelNode node) { if (node == null || !node.isDefined()) { return null; } final OpenType<?> openType = getOpenType(); if (openType instanceof CompositeType) { final CompositeType compositeType = (CompositeType)openType; //Create a composite final Map<String, Object> items = new HashMap<String, Object>(); for (String attrName : compositeType.keySet()) { TypeConverter converter = getConverter(typeNode.get(attrName, TYPE), typeNode.get(attrName, VALUE_TYPE)); items.put(attrName, converter.fromModelNode(node.get(attrName))); } try { return new CompositeDataSupport(compositeType, items); } catch (OpenDataException e) { throw new RuntimeException(e); } } else { return node.toJSONString(false); } }
Example #29
Source File: MemoryUsageCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // memoryUsageItemNames! final Object[] memoryUsageItemValues = { new Long(usage.getInit()), new Long(usage.getUsed()), new Long(usage.getCommitted()), new Long(usage.getMax()), }; try { return new CompositeDataSupport(memoryUsageCompositeType, memoryUsageItemNames, memoryUsageItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }
Example #30
Source File: VMOptionCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected CompositeData getCompositeData() { // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH // vmOptionItemNames! final Object[] vmOptionItemValues = { option.getName(), option.getValue(), new Boolean(option.isWriteable()), option.getOrigin().toString(), }; try { return new CompositeDataSupport(vmOptionCompositeType, vmOptionItemNames, vmOptionItemValues); } catch (OpenDataException e) { // Should never reach here throw new AssertionError(e); } }