public class MBeanUtil extends Object
Constructor and Description |
---|
MBeanUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getAttributeName(Method method)
Returns the name of the attribute represented by the specified attribute method.
|
static String |
getAttributeName(String methodName)
Returns the name of the attribute represented by the specified attribute method.
|
static boolean |
isAttribute(Method method)
Returns true if the specified method represents an MBean attribute getter or setter.
|
static boolean |
isGetter(Method method)
Returns true if the specified method represents an MBean attribute getter.
|
static boolean |
isGetterName(String methodName,
String[] arguments)
Returns true if the specified methodName and arguments could potentially be a getter operation.
|
static boolean |
isSetter(Method method)
Returns true if the specified method represents an MBean attribute setter.
|
static boolean |
isSetterName(String methodName,
String[] arguments) |
static boolean |
requiresWriteAccess(ClassLoader classLoader,
Class containingClass,
Method method)
Returns true if the specified method (from the specified containing class) requires write permission to use.
|
public static String getAttributeName(Method method)
Returns the name of the attribute represented by the specified attribute method. Does not check whether the specified method is actually an attribute though (use isAttribute to determine that).
public static String getAttributeName(String methodName)
Returns the name of the attribute represented by the specified attribute method. Does not check whether the specified method is actually an attribute though (use isAttribute to determine that).
public static boolean isAttribute(Method method)
Returns true if the specified method represents an MBean attribute getter or setter. Returns false for methods which represent invoke operations.
public static boolean isGetter(Method method)
Returns true if the specified method represents an MBean attribute getter.
public static boolean isGetterName(String methodName, String[] arguments)
Returns true if the specified methodName and arguments could potentially be a getter operation. Used do detect and warn in cases where someone has invoked an attribute getter directly (instead of using getAttribute(s) as they should).
public static boolean isSetter(Method method)
Returns true if the specified method represents an MBean attribute setter.
public static boolean requiresWriteAccess(ClassLoader classLoader, Class containingClass, Method method) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
Returns true if the specified method (from the specified containing class) requires write permission to use. ClassLoader required for finding ManagementOperation Annotation.