public class JmxService extends Object
The JmxService provides a wrapper around JMX connections to one or more servers. The service is configured with a list of server definitions which includes a logical name for the server and a connection to the server. Each server has a list of object names and labels and the list of attributes and operations to be exposed on that server. The only servers, objects, attributes and operations to be exposed are those in the configuration.
| Constructor and Description |
|---|
JmxService(List<Map<String,Object>> jmxServers)
Construct a new JmxService.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String serverId,
String objectId,
String attributeId)
Get the value for the attribute for an object on a server.
|
List<String> |
getAttributeNames(String serverId,
String objectId)
Get all the attributes names for an object on a server.
|
List<FieldDefinition> |
getAttributes(String serverId,
String objectId)
Get the values for all attributes for an object on a server.
|
MBeanOperationInfo |
getOperation(String serverId,
String objectId,
String operationId)
Get the description for the operation for an object on a server.
|
List<String> |
getOperationNames(String serverId,
String objectId)
Get all the operations names for an object on a server.
|
List<MBeanOperationInfo> |
getOperations(String serverId,
String objectId)
Get the description for all operations for an object on a server.
|
boolean |
hasAttribute(String serverId,
String objectId,
String attributeId)
Check to see if the object has been configured to have the specified
attribute.
|
boolean |
hasOperation(String serverId,
String objectId,
String operationId)
Check to see if the object has been configured to have the specified
operation.
|
Object |
invokeOperation(String serverId,
String objectId,
String operationId,
Map<String,String> parameters)
Invoke the operation with the specified parameters.
|
void |
writeAttribute(MapWriter mapWriter,
String serverId,
String objectId,
String attributeId)
Write the attribute for the attribute for an object on a server.
|
void |
writeAttribute(MapWriter mapWriter,
String serverId,
String objectId,
String attributeId,
Object value)
Write the attribute for the attribute for an object on a server.
|
void |
writeAttributes(MapWriter mapWriter)
Write the attributes for all servers and objects.
|
void |
writeAttributes(MapWriter mapWriter,
String serverId)
Write the attributes for all objects for a server.
|
void |
writeAttributes(MapWriter mapWriter,
String serverId,
String objectId)
Write the attributes for the objects on a server.
|
void |
writeOperation(MapWriter mapWriter,
String serverId,
String objectId,
MBeanOperationInfo operation,
Object returnValue)
Write the operation for the operation for an object on a server.
|
void |
writeOperation(MapWriter mapWriter,
String serverId,
String objectId,
String operationId)
Write the operation for the operation for an object on a server.
|
void |
writeOperation(MapWriter mapWriter,
String serverId,
String objectId,
String operationId,
Object returnValue)
Write the operation for the operation for an object on a server.
|
void |
writeOperations(MapWriter mapWriter)
Write the operations for all servers and objects.
|
void |
writeOperations(MapWriter mapWriter,
String serverId)
Write the operations for all objects for a server.
|
void |
writeOperations(MapWriter mapWriter,
String serverId,
String objectId)
Write the operations for the objects on a server.
|
public Object getAttribute(String serverId, String objectId, String attributeId)
mapWriter - The writer to write the attributes to.serverId - The name of the server.objectId - The name of the object.attributeId - The name of the attribute.public List<String> getAttributeNames(String serverId, String objectId)
serverId - The name of the server.objectId - The name of the object.public List<FieldDefinition> getAttributes(String serverId, String objectId)
serverId - The name of the server.objectId - The name of the object.public MBeanOperationInfo getOperation(String serverId, String objectId, String operationId)
serverId - The name of the server.objectId - The name of the object.operationId - The name of the operation.public List<String> getOperationNames(String serverId, String objectId)
serverId - The name of the server.objectId - The name of the object.public List<MBeanOperationInfo> getOperations(String serverId, String objectId)
serverId - The name of the server.objectId - The name of the object.public boolean hasAttribute(String serverId, String objectId, String attributeId)
serverId - The name of the server.objectId - The name of the object.attributeId - The name of the attribute.public boolean hasOperation(String serverId, String objectId, String operationId)
serverId - The name of the server.objectId - The name of the object.operationId - The name of the operation.public Object invokeOperation(String serverId, String objectId, String operationId, Map<String,String> parameters)
serverId - The name of the server.objectId - The name of the object.operationId - The name of the operation.parameters - The parameters to pass to the operation.public void writeAttribute(MapWriter mapWriter, String serverId, String objectId, String attributeId)
mapWriter - The writer to write the attributes to.serverId - The name of the server.objectId - The name of the object.attributeId - The name of the attribute.public void writeAttribute(MapWriter mapWriter, String serverId, String objectId, String attributeId, Object value)
mapWriter - The writer to write the attributes to.serverId - The name of the server.objectId - The name of the object.attributeId - The name of the attribute.value - The value to write.public void writeAttributes(MapWriter mapWriter)
mapWriter - The writer to write the attributes to.public void writeAttributes(MapWriter mapWriter, String serverId)
mapWriter - The writer to write the attributes to.serverId - The name of the server.public void writeAttributes(MapWriter mapWriter, String serverId, String objectId)
mapWriter - The writer to write the attributes to.serverId - The name of the server.objectId - The name of the object.public void writeOperation(MapWriter mapWriter, String serverId, String objectId, MBeanOperationInfo operation, Object returnValue)
mapWriter - The writer to write the operation to.serverId - The name of the server.objectId - The name of the object.operation - The operation details.returnValue - The value returned from invoking the method.public void writeOperation(MapWriter mapWriter, String serverId, String objectId, String operationId)
mapWriter - The writer to write the operation to.serverId - The name of the server.objectId - The name of the object.operationId - The name of the operations.public void writeOperation(MapWriter mapWriter, String serverId, String objectId, String operationId, Object returnValue)
mapWriter - The writer to write the operation to.serverId - The name of the server.objectId - The name of the object.operationId - The name of the operations.returnValue - The value returned from invoking the method.public void writeOperations(MapWriter mapWriter)
mapWriter - The writer to write the operations to.public void writeOperations(MapWriter mapWriter, String serverId)
mapWriter - The writer to write the operations to.serverId - The name of the server.Copyright © 2015 Revolution Systems Inc.. All rights reserved.