public static ModelNode getPlatformLoggingResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.LOGGING)); for (String attr : PlatformMBeanConstants.LOGGING_READ_ATTRIBUTES) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.LOGGING + "." + attr)); } final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); final ModelNode loggers = populateAttribute(attrs, LOGGER_NAMES, ModelType.LIST, true, null); loggers.get(VALUE_TYPE).set(ModelType.STRING); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getMemoryManagerResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.MEMORY_MANAGER)); final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); for (String attr : PlatformMBeanConstants.MEMORY_MANAGER_READ_ATTRIBUTES) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.MEMORY_MANAGER + "." + attr)); } populateAttribute(attrs, NAME, ModelType.STRING, true, null); populateAttribute(attrs, VALID, ModelType.BOOLEAN, true, null); final ModelNode names = populateAttribute(attrs, MEMORY_POOL_NAMES, ModelType.LIST, true, null); names.get(VALUE_TYPE).set(ModelType.STRING); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getCompilationResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.COMPILATION)); for (String attr : PlatformMBeanConstants.COMPILATION_READ_ATTRIBUTES) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.COMPILATION + "." + attr)); } for (String attr : PlatformMBeanConstants.COMPILATION_METRICS) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.COMPILATION + "." + attr)); } final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); populateAttribute(attrs, NAME, ModelType.STRING, true, null); populateAttribute(attrs, COMPILATION_TIME_MONITORING_SUPPORTED, ModelType.BOOLEAN, true, null); populateAttribute(attrs, TOTAL_COMPILATION_TIME, ModelType.LONG, false, MeasurementUnit.MILLISECONDS); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getBufferPoolResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL)); for (String attr : PlatformMBeanConstants.BUFFER_POOL_READ_ATTRIBUTES) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "." + attr)); } for (String attr : PlatformMBeanConstants.BUFFER_POOL_METRICS) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "." + attr)); } final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); populateAttribute(attrs, NAME, ModelType.STRING, true, null); populateAttribute(attrs, COUNT, ModelType.LONG, true, MeasurementUnit.NONE); populateAttribute(attrs, MEMORY_USED, ModelType.LONG, true, MeasurementUnit.BYTES); populateAttribute(attrs, TOTAL_CAPACITY, ModelType.LONG, true, MeasurementUnit.BYTES); attrs.get(NAME, DESCRIPTION).set(bundle.getString("buffer-pools.name")); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getClassLoadingResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.CLASS_LOADING)); for (String attr : PlatformMBeanConstants.CLASSLOADING_READ_WRITE_ATTRIBUTES) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.CLASS_LOADING + "." + attr)); } for (String attr : PlatformMBeanConstants.CLASSLOADING_METRICS) { node.get(ATTRIBUTES, attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.CLASS_LOADING + "." + attr)); } final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); populateAttribute(attrs, VERBOSE, ModelType.BOOLEAN, true, null); populateAttribute(attrs, TOTAL_LOADED_CLASS_COUNT, ModelType.LONG, true, MeasurementUnit.NONE); populateAttribute(attrs, LOADED_CLASS_COUNT, ModelType.INT, true, MeasurementUnit.NONE); populateAttribute(attrs, UNLOADED_CLASS_COUNT, ModelType.LONG, true, MeasurementUnit.NONE); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getGarbageCollectorResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.GARBAGE_COLLECTOR)); final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); for (String attr : PlatformMBeanConstants.GARBAGE_COLLECTOR_READ_ATTRIBUTES) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.GARBAGE_COLLECTOR + "." + attr)); } for (String attr : PlatformMBeanConstants.GARBAGE_COLLECTOR_METRICS) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.GARBAGE_COLLECTOR + "." + attr)); } populateAttribute(attrs, NAME, ModelType.STRING, true, null); populateAttribute(attrs, VALID, ModelType.BOOLEAN, true, null); final ModelNode names = populateAttribute(attrs, MEMORY_POOL_NAMES, ModelType.LIST, true, null); names.get(VALUE_TYPE).set(ModelType.STRING); populateAttribute(attrs, COLLECTION_COUNT, ModelType.LONG, true, MeasurementUnit.NONE); populateAttribute(attrs, COLLECTION_TIME, ModelType.LONG, true, MeasurementUnit.MILLISECONDS); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getOperatingSystemResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.OPERATING_SYSTEM)); final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); for (String attr : PlatformMBeanConstants.OPERATING_SYSTEM_READ_ATTRIBUTES) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.OPERATING_SYSTEM + "." + attr)); } for (String attr : PlatformMBeanConstants.OPERATING_SYSTEM_METRICS) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.OPERATING_SYSTEM + "." + attr)); } populateAttribute(attrs, NAME, ModelType.STRING, false, null); populateAttribute(attrs, ARCH, ModelType.STRING, false, null); populateAttribute(attrs, VERSION, ModelType.STRING, false, null); populateAttribute(attrs, AVAILABLE_PROCESSORS, ModelType.INT, true, MeasurementUnit.NONE); populateAttribute(attrs, SYSTEM_LOAD_AVERAGE, ModelType.DOUBLE, true, MeasurementUnit.PERCENTAGE); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }
public static ModelNode getMemoryResource(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode node = new ModelNode(); node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.MEMORY)); final ModelNode attrs = node.get(ATTRIBUTES); addObjectNameAttribute(attrs, bundle); for (String attr : PlatformMBeanConstants.MEMORY_READ_WRITE_ATTRIBUTES) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.MEMORY + "." + attr)); } for (String attr : PlatformMBeanConstants.MEMORY_METRICS) { attrs.get(attr, DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.MEMORY + "." + attr)); } populateAttribute(attrs, OBJECT_PENDING_FINALIZATION_COUNT, ModelType.INT, true, MeasurementUnit.NONE); final ModelNode heapUsage = populateAttribute(attrs, HEAP_MEMORY_USAGE, ModelType.OBJECT, true, null); populateMemoryUsage(heapUsage.get(VALUE_TYPE), bundle); final ModelNode nonHeapUsage = populateAttribute(attrs, NON_HEAP_MEMORY_USAGE, ModelType.OBJECT, true, null); populateMemoryUsage(nonHeapUsage.get(VALUE_TYPE), bundle); populateAttribute(attrs, VERBOSE, ModelType.BOOLEAN, true, null); node.get(OPERATIONS).setEmptyObject(); node.get(CHILDREN).setEmptyObject(); return node; }