Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- this.jmxConnector = JMXConnectorFactory.connect(serviceURL, auth);
- if (this.jmxConnector != null) {
- MBeanServerConnection mbs = this.jmxConnector.getMBeanServerConnection();
- if (mbs != null) {
- this.mbs = mbs;
- }
- }
- } catch (IOException e) {
- connected = false;
- }
- private Map<String, Object> getAttributesForMBean(ObjectName objectName, List<String> attributeNames) {
- HashMap<String, Object> attributeMap = new HashMap<String, Object>();
- for (String attributeName : attributeNames) {
- Object attributeValue = null;
- if (this.hasAttribute(objectName, attributeName)) {
- try {
- attributeValue = this.mbs.getAttribute(objectName, attributeName);
- } catch (Exception e) {
- logger.warn("In getAttributes(), for " + objectName + ": " , e);
- }
- }
- attributeMap.put(attributeName, attributeValue);
- }
- return attributeMap;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement