Class MBeanUtil
- java.lang.Object
-
- com.opencloud.rhino.management.MBeanUtil
-
public class MBeanUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description MBeanUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getAttributeName
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).
-
getAttributeName
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).
-
isAttribute
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.
-
isGetter
public static boolean isGetter(Method method)
Returns true if the specified method represents an MBean attribute getter.
-
isGetterName
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).
-
isSetter
public static boolean isSetter(Method method)
Returns true if the specified method represents an MBean attribute setter.
-
requiresWriteAccess
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.
-
-