public class MBeanAccessor extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
MBeanAccessor.GetAttributes
The Remote.Function for the
MBeanServerConnection .getAttributes
method. |
static class |
MBeanAccessor.Invoke
The Remote.Function for the
MBeanServerConnection .invoke
method. |
static class |
MBeanAccessor.QueryBuilder
The Query Builder for generating Coherence MBean queries.
|
static class |
MBeanAccessor.SetAttributes
The Remote.Function for the
MBeanServerConnection .setAttributes
method. |
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER
The "cluster" key in the ObjectName.
|
protected MBeanServerProxy |
f_mbeanServerProxy
The
MBeanServerProxy 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 and Description |
---|
MBeanAccessor()
Default Constructor.
|
MBeanAccessor(MBeanServerProxy mBeanServerProxy)
Create an instance of MBeanAccessor.
|
Modifier and Type | Method and 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 provided
MBeanAccessor.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 provided
MBeanAccessor.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
provided
MBeanAccessor.QueryBuilder . |
Set<String> |
queryKeys(MBeanAccessor.QueryBuilder.ParsedQuery query)
Return a list of MBean ObjectNames determined by the provided
MBeanAccessor.QueryBuilder . |
Map<String,Map<String,Object>> |
update(MBeanAccessor.QueryBuilder.ParsedQuery query,
Map<String,Object> mapAttributes)
Update all JMX MBeans determined by evaluating the provided
MBeanAccessor.QueryBuilder . |
protected final MBeanServerProxy f_mbeanServerProxy
MBeanServerProxy
to be used for MBean operations.public static final String NAME
public static final String TYPE
public static final String SERVICE
public static final String TIER
public static final String NODE_ID
public static final String MEMBER
public static final String CLUSTER
public static final String STORAGE_MANAGER_QUERY
public MBeanAccessor()
public MBeanAccessor(MBeanServerProxy mBeanServerProxy)
mBeanServerProxy
- the MBeanServerProxy
to be usedpublic Map<String,Map<String,Object>> getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query)
MBeanAccessor.QueryBuilder
.
Note: the return type is keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
query
- the MBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable
MBeanspublic Map<String,Map<String,Object>> getAttributes(MBeanAccessor.QueryBuilder.ParsedQuery query, Filter<MBeanAttributeInfo> filter, boolean fAddStorageMBeanAttributes)
MBeanAccessor.QueryBuilder
.
Note: the return type is keyed by the full ObjectName registered with the MBeanServer and a Map of attribute name to value
query
- the MBeanAccessor.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.public Map<String,Object> invoke(MBeanAccessor.QueryBuilder.ParsedQuery query, String sOperationName, Object[] aoArguments, String[] asSignature)
MBeanAccessor.QueryBuilder
.query
- the MBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine
applicable MBeanssOperationName
- the name of the operationaoArguments
- the arguments of the operationasSignature
- the signature of the operationpublic Map<String,Map<String,Object>> update(MBeanAccessor.QueryBuilder.ParsedQuery query, Map<String,Object> mapAttributes)
MBeanAccessor.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.
query
- the MBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine
applicable MBeansmapAttributes
- the attributes to updatepublic Set<String> queryKeys(MBeanAccessor.QueryBuilder.ParsedQuery query)
MBeanAccessor.QueryBuilder
.query
- the MBeanAccessor.QueryBuilder.ParsedQuery
to be used to determine applicable
MBeanspublic Map<String,Object> aggregate(MBeanAccessor.QueryBuilder.ParsedQuery query, String sLocator, String sAttribute, String sCollector)
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:
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
or cache
enums.
Either all attributes are returned or a single attribute based upon the absence or presence, respectively, of the attribute in the URI.
query
- the MBeanAccessor.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