|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jasmine.probe.collectors.jmx.internal.JmxUtil
public class JmxUtil
Support for access to MBean attributes and attribute fragments.
| Constructor Summary | |
|---|---|
JmxUtil()
|
|
| Method Summary | |
|---|---|
static Attribute |
createNewIndexedAttribute(String contName,
String index,
Object elemValue)
Create a new Attribute instance for an indexed element. |
static Attribute |
createNewItemAttribute(String contName,
String key,
Object itemValue)
Create a new Attribute instance for a keyed item. |
static Attribute |
getAttributeFragment(String name,
Attribute att)
Return an Attribute object corresponding to the given attribute fragment name. |
static List<Attribute> |
getAttributeFragments(Attribute att)
Decompose a JMX Attribute having a complex type into a list of Attributes having simple types (the fragments). |
protected static AttributeList |
getAttributes(MBeanServerConnection cnx,
ObjectName objname)
Get an AttributeList corresponding to all the attribute names of a given MBean |
protected static AttributeList |
getAttributes(MBeanServerConnection cnx,
ObjectName objname,
List<String> attNames)
Get an AttributeList corresponding to a list of attribute names of a given MBean |
protected static AttributeList |
getAttributesForProvidedNames(MBeanServerConnection cnx,
ObjectName objname,
Collection<String> names,
String indicName)
Get Attribute instances for all attribute names and/or attribute fragment names. |
static List<String> |
getMBeanAttNames(MBeanServerConnection cnx,
ObjectName on)
Return a list of attribute names of a given MBean. |
static Set<ObjectName> |
getMBeans(MBeanServerConnection cnx,
ObjectName on)
Get all the MBeans corresponding to an ObjectName pattern. |
static ObjectName |
getObjectName(String pattern)
|
protected static boolean |
hasAttributes(List<String> attrlist)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JmxUtil()
| Method Detail |
|---|
public static Set<ObjectName> getMBeans(MBeanServerConnection cnx,
ObjectName on)
throws IOException
cnx - Connection to the MBean serveron - ObjectName pattern
IOException - A communication problem occurred when
talking to the MBean server.
public static List<String> getMBeanAttNames(MBeanServerConnection cnx,
ObjectName on)
throws IOException,
JMException
cnx - MBeanServer connectionon - The MBean's name.
IOException - A communication problem occurred when
talking to the MBean server.
JMException - A JMX exception occurred when using the MBean.
public static ObjectName getObjectName(String pattern)
throws JasmineCollectorException
JasmineCollectorException - an ObjectName could not be obtained as the pattern
in not well formed given the JMX naming conventions.
public static Attribute createNewIndexedAttribute(String contName,
String index,
Object elemValue)
contName - the name associated to the indexed objectindex - the element's indexelemValue - the value of the element having the given index
public static Attribute createNewItemAttribute(String contName,
String key,
Object itemValue)
contName - the name associated to the composite object (the container)key - the item's keyitemValue - the value of the item having the given key
public static Attribute getAttributeFragment(String name,
Attribute att)
throws FragmentNameException
cnx - Connection to the MBean serverobjname - MBean to pollname - attribute fragment namerootAtt - the MBean attribute containing this fragment
IOException - A communication problem occurred when
talking to the MBean server.
JMException - Problem with the JMX code.
FragmentNameException - exception related to the fragment naming policy
public static List<Attribute> getAttributeFragments(Attribute att)
throws ComplexValuesException
att - The initial attribute which may have a complex or a simple type.
It its value has a simple type, the attribute is returned as it is.
If it has a complex type, its value is decomposed in simple elements, the fragments.
ComplexValuesException
protected static AttributeList getAttributes(MBeanServerConnection cnx,
ObjectName objname,
List<String> attNames)
throws IOException,
JMException
cnx - Connection to the MBean serverobjname - name of the MBean to pollattNames - list of attribute names
IOException
JMException
protected static AttributeList getAttributes(MBeanServerConnection cnx,
ObjectName objname)
throws IOException,
JMException
cnx - Connection to the MBean serverobjname - name of the MBean to poll
IOException
JMException
protected static AttributeList getAttributesForProvidedNames(MBeanServerConnection cnx,
ObjectName objname,
Collection<String> names,
String indicName)
throws IOException,
JMException
cnx - Connection to the MBean serverobjname - name of the MBean to pollnames - provided names (attribute or fragment names to poll)
IOException
JMExceptionprotected static boolean hasAttributes(List<String> attrlist)
attrlist - list of attribute/fragment names from the indicator's definition (atts property)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||