Пример #1
0
  protected List<ObjectName> findObjectNames(String pattern) throws MalformedObjectNameException {
    List<ObjectName> results = new ArrayList<ObjectName>();

    if (pattern != null) {
      Set<ObjectName> objectNames = server.queryNames(new ObjectName("*.*:*"), null);

      for (ObjectName objectName : objectNames) {
        if (WildcardUtils.match(getName(objectName).toLowerCase(), pattern.toLowerCase())) {
          results.add(objectName);
        }
      }
    }

    return results;
  }
Пример #2
0
  protected List<MBeanAttributeInfo> findMBeanAttributeInfos(
      MBeanInfo info, String attributePattern) {
    List<MBeanAttributeInfo> results = new ArrayList<MBeanAttributeInfo>();

    if (attributePattern != null) {
      for (MBeanAttributeInfo attributeInfo : info.getAttributes()) {
        if (WildcardUtils.match(
            attributeInfo.getName().toLowerCase(), attributePattern.toLowerCase())) {
          results.add(attributeInfo);
        }
      }
    }

    return results;
  }
Пример #3
0
  protected List<MBeanOperationInfo> findMBeanOperationInfos(
      MBeanInfo info, String operationPattern, int signatureLength) {
    List<MBeanOperationInfo> results = new ArrayList<MBeanOperationInfo>();

    if (operationPattern != null) {
      for (MBeanOperationInfo operationInfo : info.getOperations()) {
        if (!isSupported(operationInfo)) {
          continue;
        }

        if ((signatureLength >= 0) && (operationInfo.getSignature().length != signatureLength)) {
          continue;
        }

        if (WildcardUtils.match(
            operationInfo.getName().toLowerCase(), operationPattern.toLowerCase())) {
          results.add(operationInfo);
        }
      }
    }

    return results;
  }