/** * There are issues loading some JMX attributes on some systems. This protects us from a * single bad attribute stopping us reading any metrics (or just a random sampling) out of * the system. */ private static List<Attribute> safelyLoadAttributes( MBeanServerConnection server, ObjectName objectName, List<String> matchingNames) { try { // first try batch loading all attributes as this is faster return batchLoadAttributes(server, objectName, matchingNames); } catch (Exception e) { // JBOSS ticket: https://issues.jboss.org/browse/AS7-4404 LOGGER.info("Error batch loading attributes for {} : {}", objectName, e.getMessage()); // some containers (jboss I am looking at you) fail the entire getAttributes request // if one is broken we can get the working attributes if we ask for them individually return individuallyLoadAttributes(server, objectName, matchingNames); } }
/** * There are issues loading some JMX attributes on some systems. This protects us from a * single bad attribute stopping us reading any metrics (or just a random sampling) out of * the system. */ private static List<Attribute> safelyLoadAttributes( MBeanServerConnection server, ObjectName objectName, List<String> matchingNames) { try { // first try batch loading all attributes as this is faster return batchLoadAttributes(server, objectName, matchingNames); } catch (Exception e) { // JBOSS ticket: https://issues.jboss.org/browse/AS7-4404 LOGGER.info("Error batch loading attributes for {} : {}", objectName, e.getMessage()); // some containers (jboss I am looking at you) fail the entire getAttributes request // if one is broken we can get the working attributes if we ask for them individually return individuallyLoadAttributes(server, objectName, matchingNames); } }