code: protected String escapeObjectName(@Nonnull ObjectName objectName) {
  
          /** Add objectName's domain */
          StringBuilder result = new StringBuilder();
          StringUtils2.appendEscapedNonAlphaNumericChars(objectName.getDomain(), false, result);
  
          /** Walk through (sorted) properties of the ObjectName and add values to the result */
          List<String> keys = Collections.list(objectName.getKeyPropertyList().keys());
          Collections.sort(keys);
          for (Iterator<String> it = keys.iterator(); it.hasNext(); ) {
              String propertyKey = it.next();
              result.append('.');
              StringUtils2.appendEscapedNonAlphaNumericChars(objectName.getKeyProperty(propertyKey), false, result);
          }
  
          return result.toString();
      }
docs: Transforms an {@linkplain javax.management.ObjectName} into a plain {@linkplain String}
  only composed of ('a' to 'Z', 'A' to 'Z', '.', '_') similar to JConsole naming.
  
  '_' is the escape char for not compliant chars.