Class AbstractMXBean
- java.lang.Object
-
- org.opendaylight.infrautils.utils.management.AbstractMXBean
-
- Direct Known Subclasses:
DelegatingSystemReadyMonitorMXBean
public abstract class AbstractMXBean extends Object
This class is inspired from the original implementation in controller.- Author:
- Thomas Pantelis, Faseela K
-
-
Field Summary
Fields Modifier and Type Field Description static String
BASE_JMX_PREFIX
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMXBean(@NonNull String mbeanName, @NonNull String mbeanType, @Nullable String mbeanCategory)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable String
getMBeanCategory()
Returns theCategory
property of the bean's ObjectName.String
getMBeanName()
Returns thename
property of the bean's ObjectName.String
getMBeanType()
Returns thetype
property of the bean's ObjectName.Object
invokeMBeanFunction(String functionName)
invoke an mbean function with the platform MBean server.Object
readMBeanAttribute(String attribute)
Read an mbean attribute from the platform MBean server.void
register()
This method is a wrapper for registerMBean with void return type so it can be invoked by dependency injection frameworks such as Spring and Blueprint.boolean
registerMBean()
Registers this bean with the platform MBean server with the domain defined byBASE_JMX_PREFIX
.void
unregister()
This method is a wrapper for unregisterMBean with void return type so it can be invoked by dependency injection frameworks such as Spring and Blueprint.boolean
unregisterMBean()
Unregisters this bean with the platform MBean server.
-
-
-
Field Detail
-
BASE_JMX_PREFIX
public static final String BASE_JMX_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractMXBean
protected AbstractMXBean(@NonNull String mbeanName, @NonNull String mbeanType, @Nullable String mbeanCategory)
Constructor.- Parameters:
mbeanName
- Used as thename
property in the bean's ObjectName.mbeanType
- Used as thetype
property in the bean's ObjectName.mbeanCategory
- Used as theCategory
property in the bean's ObjectName.
-
-
Method Detail
-
register
public void register()
This method is a wrapper for registerMBean with void return type so it can be invoked by dependency injection frameworks such as Spring and Blueprint.
-
registerMBean
public final boolean registerMBean()
Registers this bean with the platform MBean server with the domain defined byBASE_JMX_PREFIX
.- Returns:
- true is successfully registered, false otherwise.
-
unregister
public void unregister()
This method is a wrapper for unregisterMBean with void return type so it can be invoked by dependency injection frameworks such as Spring and Blueprint.
-
unregisterMBean
public boolean unregisterMBean()
Unregisters this bean with the platform MBean server.- Returns:
- true is successfully unregistered, false otherwise.
-
invokeMBeanFunction
public Object invokeMBeanFunction(String functionName)
invoke an mbean function with the platform MBean server.- Returns:
- Object if successfully executed, "" otherwise.
-
readMBeanAttribute
public Object readMBeanAttribute(String attribute)
Read an mbean attribute from the platform MBean server.- Returns:
- Object if successfully executed, "" otherwise.
-
getMBeanName
public String getMBeanName()
Returns thename
property of the bean's ObjectName.
-
getMBeanType
public String getMBeanType()
Returns thetype
property of the bean's ObjectName.
-
getMBeanCategory
public @Nullable String getMBeanCategory()
Returns theCategory
property of the bean's ObjectName.
-
-