Class MBeanAccessor
- java.lang.Object
-
- com.tangosol.net.management.MBeanAccessor
-
public class MBeanAccessor extends Object
MBeanAccessor provides a means to access JMX MBeans via the Coherence Management Server (a single MBeanServer with an aggregated view of MBeans for the entire cluster).This API provides a means to query MBeans, get and update MBean attributes, and invoke MBean operations. Ultimately this allows a client to use Coherence's transport to communicate with the MBeanServer to interrogate MBeans.
- Since:
- 12.2.1.4.0
- Author:
- sr/hr
- See Also:
- Introduction to Oracle Coherence Management
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MBeanAccessor.GetAttributes
The Remote.Function for theMBeanServerConnection
.getAttributes method.static class
MBeanAccessor.Invoke
The Remote.Function for theMBeanServerConnection
.invoke method.static class
MBeanAccessor.QueryBuilder
The Query Builder for generating Coherence MBean queries.static class
MBeanAccessor.SetAttributes
The Remote.Function for theMBeanServerConnection
.setAttributes method.
-
Field Summary
Fields Modifier and Type Field Description static String
CLUSTER
The "cluster" key in the ObjectName.protected MBeanServerProxy
f_mbeanServerProxy
TheMBeanServerProxy
to be used for MBean operations.static String
MEMBER
The "member" key in the ObjectName.static String
NAME
The "name" key in the ObjectName.static String
NODE_ID
The "nodeId" key in the ObjectName.static String
SERVICE
The "service" key in the ObjectName.static String
STORAGE_MANAGER_QUERY
MBean query to filter out StorageManager MBean of a specific cache and service, running on a specific node.static String
TIER
The "tier" key in the ObjectName.static String
TYPE
The "type" key in the ObjectName.
-
Constructor Summary
Constructors Constructor Description MBeanAccessor()
Default Constructor.MBeanAccessor(MBeanServerProxy mBeanServerProxy)
Create an instance of MBeanAccessor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
aggregate(MBeanAccessor.QueryBuilder.ParsedQuery query, String sLocator, String sAttribute, String sCollector)
Process the request for MBean attributes.Map<String,Map<String,Object>>
getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query)
Return all the attributes that match the query expressed by the providedMBeanAccessor.QueryBuilder
.Map<String,Map<String,Object>>
getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query, Filter<MBeanAttributeInfo> filter, boolean fAddStorageMBeanAttributes)
Return all the attributes that match the query expressed by the providedMBeanAccessor.QueryBuilder
.Map<String,Object>
invoke(MBeanAccessor.QueryBuilder.ParsedQuery query, String sOperationName, Object[] aoArguments, String[] asSignature)
Invoke a JMX MBean operation on one or many MBeans determined by the providedMBeanAccessor.QueryBuilder
.Set<String>
queryKeys(MBeanAccessor.QueryBuilder.ParsedQuery query)
Return a list of MBean ObjectNames determined by the providedMBeanAccessor.QueryBuilder
.Map<String,Map<String,Object>>
update(MBeanAccessor.QueryBuilder.ParsedQuery query, Map<String,Object> mapAttributes)
Update all JMX MBeans determined by evaluating the providedMBeanAccessor.QueryBuilder
.
-
-
-
Field Detail
-
f_mbeanServerProxy
protected final MBeanServerProxy f_mbeanServerProxy
TheMBeanServerProxy
to be used for MBean operations.
-
NAME
public static final String NAME
The "name" key in the ObjectName.- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
The "type" key in the ObjectName.- See Also:
- Constant Field Values
-
SERVICE
public static final String SERVICE
The "service" key in the ObjectName.
-
TIER
public static final String TIER
The "tier" key in the ObjectName.- See Also:
- Constant Field Values
-
NODE_ID
public static final String NODE_ID
The "nodeId" key in the ObjectName.
-
MEMBER
public static final String MEMBER
The "member" key in the ObjectName.
-
CLUSTER
public static final String CLUSTER
The "cluster" key in the ObjectName.
-
STORAGE_MANAGER_QUERY
public static final String STORAGE_MANAGER_QUERY
MBean query to filter out StorageManager MBean of a specific cache and service, running on a specific node.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MBeanAccessor
public MBeanAccessor()
Default Constructor.
-
MBeanAccessor
public MBeanAccessor(MBeanServerProxy mBeanServerProxy)
Create an instance of MBeanAccessor.- Parameters:
mBeanServerProxy
- theMBeanServerProxy
to be used
-
-
Method Detail
-
getAttributes
public Map<String,Map<String,Object>> getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query)
Return all the attributes that match the query expressed by the providedMBeanAccessor.QueryBuilder
.Note: the return type is keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
- Parameters:
query
- theMBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable MBeans- Returns:
- a Map keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
-
getAttributes
public Map<String,Map<String,Object>> getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query, Filter<MBeanAttributeInfo> filter, boolean fAddStorageMBeanAttributes)
Return all the attributes that match the query expressed by the providedMBeanAccessor.QueryBuilder
.Note: the return type is keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
- Parameters:
query
- theMBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable MBeansfilter
- server side filter for what attributes to returnfAddStorageMBeanAttributes
- add storage MBean attributes to CacheMBean tier="back" attributes.- Returns:
- a Map keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
-
invoke
public Map<String,Object> invoke(MBeanAccessor.QueryBuilder.ParsedQuery query, String sOperationName, Object[] aoArguments, String[] asSignature)
Invoke a JMX MBean operation on one or many MBeans determined by the providedMBeanAccessor.QueryBuilder
.- Parameters:
query
- theMBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable MBeanssOperationName
- the name of the operationaoArguments
- the arguments of the operationasSignature
- the signature of the operation- Returns:
- a Map keyed by the full ObjectName registered with the MBeanServer and the value returned by invoking the operation
-
update
public Map<String,Map<String,Object>> update(MBeanAccessor.QueryBuilder.ParsedQuery query, Map<String,Object> mapAttributes)
Update all JMX MBeans determined by evaluating the providedMBeanAccessor.QueryBuilder
. All attributes in the provided map will be updated on the corresponding MBean(s) iff the attribute is present.A Set of ObjectNames corresponding to the updated MBeans is returned. These MBeans have been updated with the matching attributes provided to this update method. Attributes not present on the targeted MBean are silently ignored unless there are no attributes that match and therefore will be absent from the returned set of ObjectNames.
- Parameters:
query
- theMBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable MBeansmapAttributes
- the attributes to update- Returns:
- a map keyed by ObjectNames updated with the map of attributes that were updated (based on the attributes present on the MBean)
-
queryKeys
public Set<String> queryKeys(MBeanAccessor.QueryBuilder.ParsedQuery query)
Return a list of MBean ObjectNames determined by the providedMBeanAccessor.QueryBuilder
.- Parameters:
query
- theMBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable MBeans- Returns:
- the Set of MBean ObjectNames
-
aggregate
public Map<String,Object> aggregate(MBeanAccessor.QueryBuilder.ParsedQuery query, String sLocator, String sAttribute, String sCollector)
Process the request for MBean attributes.The requested MBean solely depends on the 'type' input. This may be one of the values specified in the
mbean types
constant.The processing can be modified in three ways:
- reducing the data (querying)
- choosing the collector implementation (aggregating)
- select the attributes to return
If the data is not reduced to a single MBean some attribute level aggregation is applied to the MBeans. By default this aggregation is a list, however each attribute may specify its own default as defined in the
service
orcache
enums.Either all attributes are returned or a single attribute based upon the absence or presence, respectively, of the attribute in the URI.
- Parameters:
query
- theMBeanAccessor.QueryBuilder
to be used to generate MBean querysLocator
- either a regex to be applied against nodeids or a role namesAttribute
- the attribute to returnsCollector
- the collector to use instead of the default- Returns:
- a Map of attribute name to attribute value; the attribute value may be the result of an aggregation based upon the request
-
-