equal
deleted
inserted
replaced
265 */ |
265 */ |
266 private static <T extends GarbageCollectorMXBean> |
266 private static <T extends GarbageCollectorMXBean> |
267 List<T> getGcMXBeanList(Class<T> gcMXBeanIntf) { |
267 List<T> getGcMXBeanList(Class<T> gcMXBeanIntf) { |
268 List<GarbageCollectorMXBean> list = |
268 List<GarbageCollectorMXBean> list = |
269 ManagementFactoryHelper.getGarbageCollectorMXBeans(); |
269 ManagementFactoryHelper.getGarbageCollectorMXBeans(); |
270 List<T> result = new ArrayList<T>(list.size()); |
270 List<T> result = new ArrayList<>(list.size()); |
271 for (GarbageCollectorMXBean m : list) { |
271 for (GarbageCollectorMXBean m : list) { |
272 if (gcMXBeanIntf.isInstance(m)) { |
272 if (gcMXBeanIntf.isInstance(m)) { |
273 result.add(gcMXBeanIntf.cast(m)); |
273 result.add(gcMXBeanIntf.cast(m)); |
274 } |
274 } |
275 } |
275 } |
328 } |
328 } |
329 return defaultKeyProps; |
329 return defaultKeyProps; |
330 } |
330 } |
331 |
331 |
332 private static Set<String> keyProperties(String... keyNames) { |
332 private static Set<String> keyProperties(String... keyNames) { |
333 Set<String> set = new HashSet<String>(); |
333 Set<String> set = new HashSet<>(); |
334 set.add("type"); |
334 set.add("type"); |
335 for (String s : keyNames) { |
335 for (String s : keyNames) { |
336 set.add(s); |
336 set.add(s); |
337 } |
337 } |
338 return set; |
338 return set; |
362 |
362 |
363 <T extends PlatformManagedObject> |
363 <T extends PlatformManagedObject> |
364 List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface) |
364 List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface) |
365 throws java.io.IOException |
365 throws java.io.IOException |
366 { |
366 { |
367 List<T> result = new ArrayList<T>(); |
367 List<T> result = new ArrayList<>(); |
368 for (ObjectName on : getObjectNames(mbs)) { |
368 for (ObjectName on : getObjectNames(mbs)) { |
369 result.add(ManagementFactory. |
369 result.add(ManagementFactory. |
370 newPlatformMXBeanProxy(mbs, |
370 newPlatformMXBeanProxy(mbs, |
371 on.getCanonicalName(), |
371 on.getCanonicalName(), |
372 mxbeanInterface) |
372 mxbeanInterface) |