Skip to content

io microsphere management MBeanAttribute

github-actions[bot] edited this page Apr 11, 2026 · 5 revisions

MBeanAttribute

Type: Class | Module: microsphere-java-core | Package: io.microsphere.management | Since: 1.0.0

Source: microsphere-java-core/src/main/java/io/microsphere/management/MBeanAttribute.java

Overview

Represents an MBean attribute, encapsulating the MBeanAttributeInfo and its optional value.

This class provides a convenient way to work with MBean attributes by combining the metadata provided by MBeanAttributeInfo with the actual value of the attribute. It is particularly useful when retrieving or manipulating MBean attributes dynamically.

Example Usage

// Assume mBeanInfo and attributeInfo are obtained from an MBeanServer
MBeanAttribute mBeanAttribute = new MBeanAttribute(mBeanInfo, attributeInfo, value);

// Get the name of the attribute
String attributeName = mBeanAttribute.getName();

// Get the type of the attribute
String attributeType = mBeanAttribute.getType();

// Check if the attribute is readable
boolean readable = mBeanAttribute.isReadable();

// Get the value of the attribute
Object attributeValue = mBeanAttribute.getValue();

Declaration

public class MBeanAttribute

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.8-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

// Assume mBeanInfo and attributeInfo are obtained from an MBeanServer
MBeanAttribute mBeanAttribute = new MBeanAttribute(mBeanInfo, attributeInfo, value);

// Get the name of the attribute
String attributeName = mBeanAttribute.getName();

// Get the type of the attribute
String attributeType = mBeanAttribute.getType();

// Check if the attribute is readable
boolean readable = mBeanAttribute.isReadable();

// Get the value of the attribute
Object attributeValue = mBeanAttribute.getValue();

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-java-core</artifactId>
    <version>${microsphere-java.version}</version>
</dependency>

Tip: Use the BOM (microsphere-java-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.management.MBeanAttribute;

API Reference

Public Methods

Method Description
getDeclaringMBeanInfo
getName
getType
isReadable Whether the value of the attribute can be read.
isWritable Whether new values can be written to the attribute.
isIs Indicates if this attribute has an "is" getter.
getAttributeInfo
getValue

Method Details

isWritable

public boolean isWritable()

Whether new values can be written to the attribute.

See Also

  • MBeanAttributeInfo
  • Attribute

This documentation was auto-generated from the source code of microsphere-java.

Home

annotation-processor

java-annotations

java-core

java-test

jdk-tools

lang-model

Clone this wiki locally