Class MBeanInfoData
java.lang.Object
org.jolokia.service.jmx.handler.list.MBeanInfoData
Tree of MBean meta data. This map is a container for one or more
MBeanInfo meta data which can be obtained
via a list request. The full structure in its JSON representation looks like below. The amount
of data included can be fine tuned in two ways:
- With a
maxDepthparameter given at construction time, the size of the map can be restricted (from top down) - A given path selects only a partial information from the tree
{
<domain> : {
<prop list> : {
"attr" : {
<attr name> : {
"type" : <attribute type>,
"desc" : <textual description of attribute>,
"rw" : true/false
},
...
},
"op" : {
<operation name> : {
"args" : [
{
"type" : <argument type>,
"name" : <argument name>,
"desc" : <textual description of argument>
},
...
],
"ret" : <return type>,
"desc" : <textual description of operation>
},
...
},
"notif" : {
<notification type> : {
"name" : <name>,
"desc" : <desc>,
"types" : [ <type1>, <type2>, ... ]
},
...
}
},
...
},
...
}
- Since:
- 13.09.11
- Author:
- roland
-
Constructor Summary
ConstructorsConstructorDescriptionMBeanInfoData(int pMaxDepth, Deque<String> pPathStack, boolean pUseCanonicalName, boolean pListKeys, boolean pListCache, String pProvider) Constructor taking a max depth. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMBeanInfo(MBeanServerConnection pConn, ObjectInstance pInstance, Set<DataUpdater> customUpdaters, Set<CacheKeyProvider> cacheKeyProviders) Add information about an MBean as obtained from anMBeanInfodescriptor.Extract either a sub tree or a leaf value.voidhandleException(ObjectName pName, IOException pExp) Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.voidhandleException(ObjectName pName, IllegalStateException pExp) Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.voidhandleException(ObjectName pName, InstanceNotFoundException pExp) Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.booleanThe first two levels of this map (tree) consist of the MBean's domain name and name properties, which are independent of an MBean's meta data.
-
Constructor Details
-
MBeanInfoData
public MBeanInfoData(int pMaxDepth, Deque<String> pPathStack, boolean pUseCanonicalName, boolean pListKeys, boolean pListCache, String pProvider) Constructor taking a max depth. The max depth specifies how deep the info tree should be build up. The tree will be truncated if it gets larger than this value. A path (in form of a stack) can be given, in which only a sub information (sub-tree or leaf value) is stored- Parameters:
pMaxDepth- max depthpPathStack- the stack for restricting the information to add. The given stack will be cloned and is left untouched.pUseCanonicalName- whether to use canonical name in listingspListKeys-pListCache-
-
-
Method Details
-
handleFirstOrSecondLevel
The first two levels of this map (tree) consist of the MBean's domain name and name properties, which are independent of an MBean's meta data. If the max depth given at construction time is less or equals than 2 (and no inner path into the map is given), then a client of this map does not need to query the MBeanServer for MBeanInfo meta data. This method checks this condition and returns true if this is the case. As side effect it will update this map with the name part extracted from the given object name- Parameters:
pName- the objectname used for the first two levels- Returns:
- true if the object name has been added.
-
addMBeanInfo
public void addMBeanInfo(MBeanServerConnection pConn, ObjectInstance pInstance, Set<DataUpdater> customUpdaters, Set<CacheKeyProvider> cacheKeyProviders) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException Add information about an MBean as obtained from anMBeanInfodescriptor. The information added can be restricted by a given path (which has already been prepared as a stack). Also, a max depth as given in the constructor restricts the size of the map from the top.- Parameters:
pConn-MBeanServerConnectionto get MBeanInfo from (or from cache if possible)pInstance- the object instance of the MBeancustomUpdaters- additional set of discovered updaters to enhance the constructed MBeanInfo (JSON data)cacheKeyProviders- set of services that help to construct the cache of MBeanInfo- Throws:
InstanceNotFoundExceptionIntrospectionExceptionReflectionExceptionIOException
-
handleException
Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.- Parameters:
pName- MBean name for which the error occurredpExp- exception occurred- Throws:
IOException- if this method decides to rethrow the execption
-
handleException
Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.- Parameters:
pName- MBean name for which the error occurredpExp- exception occurred- Throws:
IllegalStateException- if this method decides to rethrow the exception
-
handleException
public void handleException(ObjectName pName, InstanceNotFoundException pExp) throws InstanceNotFoundException Add an exception which occurred during extraction of anMBeanInfofor a certainObjectNameto this map.- Parameters:
pName- MBean name for which the error occurredpExp- exception occurred- Throws:
IllegalStateException- if this method decides to rethrow the exceptionInstanceNotFoundException
-
applyPath
Extract either a sub tree or a leaf value. If a path is used, then adding MBeanInfos has added them as if no path were given (i.e. in it original place in the tree) but leaves out other information not included by the path. This method then moves up the part pointed to by the path to the top of the tree hierarchy. It also takes into account the maximum depth of the tree and truncates below- Returns:
- either a Map for a subtree or the leaf value as an object
-