|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsesoft.mmbi.ModelMBeanHelpers
public class ModelMBeanHelpers
Provides helpers for model mbeans.
Field Summary | |
---|---|
static java.lang.String |
DESCRIPTION
|
static java.lang.String |
DESCRIPTOR_TYPE
|
static java.lang.String |
DISPLAY_NAME
|
static java.lang.String |
DOT
|
static java.lang.String |
EVENT_TYPE
|
static java.lang.String |
FORWARDER
|
static java.lang.String |
METHOD
|
static java.lang.String |
NAME
|
static java.lang.String |
NOTIFICATION
|
static java.lang.String |
OPERATION
|
static java.lang.String |
ROLE
|
static java.lang.String |
SEVERITY
|
static java.lang.String |
SLASH
|
Constructor Summary | |
---|---|
ModelMBeanHelpers()
|
Method Summary | |
---|---|
static javax.management.Descriptor |
getDescriptor(java.lang.String className,
JMX annotation,
java.beans.FeatureDescriptor feature,
java.lang.String defaultName,
java.lang.String defaultDisplayName,
java.lang.String defaultDescription,
java.lang.String descriptorType,
java.lang.String role)
Creates a JMX descriptor from the specified information. |
static JMX |
getJMXAnnotation(java.lang.annotation.Annotation[] annotations)
Inquires the JMX annotation. |
static javax.management.modelmbean.ModelMBeanInfo |
getMBeanInfo(MMBIPassBack passBack)
Gets the created MBeanInfo. |
static java.beans.MethodDescriptor |
getMethodDescriptor(java.beans.MethodDescriptor[] features,
java.lang.reflect.Method method)
Gets the JavaBeans method descriptor for the method. |
static javax.management.MBeanParameterInfo[] |
getParameterInfos(java.lang.Class<?>[] types,
java.lang.annotation.Annotation[][] annotations,
java.beans.ParameterDescriptor[] features)
Gets MBean parameter info. |
static void |
handleBeanInfoEvents(MMBIPassBack passBack)
Handles BeanInfo events. |
static void |
handleConstructor(java.lang.reflect.Constructor<?> constructor,
MMBIPassBack passBack)
Handles Constructor analysis. |
static void |
handleField(java.lang.reflect.Field field,
MMBIPassBack passBack)
Handles field analysis. |
static void |
handleJMXNotificationAnnotations(java.lang.annotation.Annotation[] annotations,
java.util.Vector<javax.management.modelmbean.ModelMBeanNotificationInfo> notificationInfos)
Handles the JMXNotification annotations. |
static void |
handleMethod(java.lang.reflect.Method method,
MMBIPassBack passBack)
Handle MMBI method analysis and info. |
static java.util.EventListener |
makeEventListener(java.lang.Class<?> eventType,
java.lang.reflect.Method[] methods,
MMBIPassBack passBack)
Makes an event listener class, possibly creates new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DISPLAY_NAME
public static final java.lang.String SEVERITY
public static final java.lang.String NOTIFICATION
public static final java.lang.String NAME
public static final java.lang.String ROLE
public static final java.lang.String OPERATION
public static final java.lang.String DESCRIPTION
public static final java.lang.String DESCRIPTOR_TYPE
public static final java.lang.String SLASH
public static final java.lang.String DOT
public static final java.lang.String EVENT_TYPE
public static final java.lang.String FORWARDER
public static final java.lang.String METHOD
Constructor Detail |
---|
public ModelMBeanHelpers()
Method Detail |
---|
public static void handleJMXNotificationAnnotations(java.lang.annotation.Annotation[] annotations, java.util.Vector<javax.management.modelmbean.ModelMBeanNotificationInfo> notificationInfos) throws java.lang.Exception
annotations
- the annotations to be looked up for the JMX annotationnotificationInfos
- the notification infos to fill
java.lang.Exception
- if descriptor cannot be createdpublic static JMX getJMXAnnotation(java.lang.annotation.Annotation[] annotations)
annotations
- the annotations to be looked up for the JMX annotation
public static javax.management.MBeanParameterInfo[] getParameterInfos(java.lang.Class<?>[] types, java.lang.annotation.Annotation[][] annotations, java.beans.ParameterDescriptor[] features) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
types
- the typesannotations
- the annotationsfeatures
- the features
java.lang.NoSuchMethodException
- on failure
java.lang.reflect.InvocationTargetException
- on failure
java.lang.IllegalAccessException
- on failurepublic static javax.management.Descriptor getDescriptor(java.lang.String className, JMX annotation, java.beans.FeatureDescriptor feature, java.lang.String defaultName, java.lang.String defaultDisplayName, java.lang.String defaultDescription, java.lang.String descriptorType, java.lang.String role) throws javax.management.MBeanException, javax.management.modelmbean.XMLParseException
Default information can be overruled by annotation information
Note: Though this was designed as a helper function, it might be useful for customers, too.
annotation
- the JMX annotation containing overriding infofeature
- the Javabeans feature descriptor containing overriding infodefaultName
- the default namedefaultDisplayName
- the default display namedefaultDescription
- the default descriptiondescriptorType
- the type of the descriptor to createrole
- the role field of the descripto
javax.management.MBeanException
- if descriptor cannot be created
javax.management.modelmbean.XMLParseException
- if the annotation's XML is not validpublic static java.beans.MethodDescriptor getMethodDescriptor(java.beans.MethodDescriptor[] features, java.lang.reflect.Method method)
features
- the BeanInfo MethodDescriptorsmethod
- the Method
public static void handleMethod(java.lang.reflect.Method method, MMBIPassBack passBack) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, javax.management.MBeanException, javax.management.modelmbean.XMLParseException
method
- the method to analyzepassBack
- the passback object
java.lang.NoSuchMethodException
- on failure
java.lang.reflect.InvocationTargetException
- on failure
java.lang.IllegalAccessException
- on failure
javax.management.MBeanException
- on failure
javax.management.modelmbean.XMLParseException
- on failurepublic static void handleConstructor(java.lang.reflect.Constructor<?> constructor, MMBIPassBack passBack) throws java.lang.Exception
constructor
- the constructor to analyzepassBack
- the pass back object
java.lang.Exception
- on failurepublic static void handleField(java.lang.reflect.Field field, MMBIPassBack passBack) throws javax.management.MBeanException, javax.management.modelmbean.XMLParseException, javax.management.IntrospectionException, javax.management.RuntimeOperationsException
field
- the field to analyzepassBack
- on failure
javax.management.MBeanException
- on failure
javax.management.modelmbean.XMLParseException
- on failure
javax.management.IntrospectionException
- on failure
javax.management.RuntimeOperationsException
- on failurepublic static javax.management.modelmbean.ModelMBeanInfo getMBeanInfo(MMBIPassBack passBack)
This function creates the MBean Info, if not already done.
passBack
- the pass back object
public static void handleBeanInfoEvents(MMBIPassBack passBack) throws java.lang.Exception
passBack
- the pass back object
java.lang.Exception
- on failurepublic static java.util.EventListener makeEventListener(java.lang.Class<?> eventType, java.lang.reflect.Method[] methods, MMBIPassBack passBack) throws java.lang.Exception
eventType
- the event to listen formethods
- the methodspassBack
- the pass back object
java.lang.Exception
- on failure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |