|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.jmx.core.DynamicMBeanDelegator
public final class DynamicMBeanDelegator
DynamicMBeanDelegator provides a number of utilities useful when implementing
DynamicMBean methods and behaviors.
Supported API: true
Extendable: false
| Method Summary | |
|---|---|
static Object |
getAttribute(Object targetObject,
String attributeName,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
Same as other getAttribute() method here except this provides a bit more explicit feedback when the target attribute is write-only (e.g. |
static Object |
getAttribute(Object targetObject,
String attributeName,
Method readMethod)
Utility for implementing DyanmicMBean's getAttribute() method against a target object when the read method is known. |
static AttributeList |
getAttributes(DynamicMBean delegate,
String[] attributeNames)
Provides an implementation of DynamicMBean's
getAttributes() method by repeatedly calling getAttribute() on 'delegate'. |
static String |
getFullSignature(MBeanOperationInfo operInfo)
Get full method signature given MBeanOperationInfo. |
static String |
getFullSignature(String operationName,
String[] argumentTypes)
Get full method signature given operation name and argument type strings. |
static void |
getMBeanAttributeInfoFromMethodMaps(Map<String,MBeanAttributeInfo> attrNameToInfoMap,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
Populates a map from attribute names to MBeanAttributeInfo objects based on input maps from attribute names to read and write methods (which are treated as read-only). |
static Method |
getMethod(Class cls,
String operationName,
String[] argumentTypes)
Look up method in 'cls' based on method name and argument type strings. |
static void |
getMethodMapsForBeanProperties(Class targetClass,
Collection<Class> additionalAllowablePropertyTypes,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
Given a target class, populates maps from attribute names to read and write methods for these attribute names based on the target class' properties as per Java Beans reflection. |
static Object |
invoke(Object targetObject,
Class targetClass,
String operationName,
Object[] arguments,
String[] argumentTypes)
Looks up method in 'targetClass' and invokes it on 'targetObject'. |
static Object |
invoke(Object targetObject,
Method operMethod,
String operationName,
Object[] arguments)
Invokes 'operMethod' on 'targetObject'. |
static void |
setAttribute(Object targetObject,
Attribute attribute,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
Same as other setAttribute() method here except this provides a bit more explicit feedback when the target attribute is read-only. |
static void |
setAttribute(Object targetObject,
Attribute attribute,
Method writeMethod)
Utility for implementing DyanmicMBean's setAttribute() method against a target object when the write method is known. |
static AttributeList |
setAttributes(DynamicMBean delegate,
AttributeList attributeList)
Provides an implementation of DynamicMBean's
setAttributes() method by repeatedly calling setAttribute() on 'delegate'. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AttributeList getAttributes(DynamicMBean delegate,
String[] attributeNames)
DynamicMBean's
getAttributes() method by repeatedly calling getAttribute() on 'delegate'.
This saves DynamicMBean implementors from implementing this method themselves
if they cannot achieve any further savings by treating multiple attributes
at once (e.g. handling all of them in on network trip).
Supported API: true
public static AttributeList setAttributes(DynamicMBean delegate,
AttributeList attributeList)
DynamicMBean's
setAttributes() method by repeatedly calling setAttribute() on 'delegate'.
This saves DynamicMBean implementors from implementing this method themselves
if they cannot achieve any further savings by treating multiple attributes
at once (e.g. handling all of them in on network trip).
Supported API: true
public static void getMethodMapsForBeanProperties(Class targetClass,
Collection<Class> additionalAllowablePropertyTypes,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
targetClass - class being targetedadditionalAllowablePropertyTypes - additional property types to include beyond MBean open types (which are normally the only properties considered)attrNameToReadMethodMap - map from attribute names to read methods; to be populated by this methodattrNameToWriteMethodMap - map from attribute names to write methods; to be populated by this method
public static void getMBeanAttributeInfoFromMethodMaps(Map<String,MBeanAttributeInfo> attrNameToInfoMap,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
attrNameToInfoMap - map from attribute names to MBeanAttributeInfo objects; to be populated by this methodattrNameToReadMethodMap - map from attribute names to read methods; treated as read-only by this methodattrNameToWriteMethodMap - map from attribute names to write methods; treated as read-only by this method
public static Object getAttribute(Object targetObject,
String attributeName,
Method readMethod)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
AttributeNotFoundException
MBeanException
ReflectionException
public static Object getAttribute(Object targetObject,
String attributeName,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
AttributeNotFoundException
MBeanException
ReflectionException
public static void setAttribute(Object targetObject,
Attribute attribute,
Method writeMethod)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public static void setAttribute(Object targetObject,
Attribute attribute,
Map<String,Method> attrNameToReadMethodMap,
Map<String,Method> attrNameToWriteMethodMap)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public static Object invoke(Object targetObject,
Class targetClass,
String operationName,
Object[] arguments,
String[] argumentTypes)
throws MBeanException,
ReflectionException
MBeanException
ReflectionException
public static Object invoke(Object targetObject,
Method operMethod,
String operationName,
Object[] arguments)
throws MBeanException,
ReflectionException
MBeanException
ReflectionException
public static Method getMethod(Class cls,
String operationName,
String[] argumentTypes)
public static String getFullSignature(MBeanOperationInfo operInfo)
public static String getFullSignature(String operationName,
String[] argumentTypes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||