javax.management.ObjectName.isDomainPattern()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中javax.management.ObjectName.isDomainPattern()方法的一些代码示例,展示了ObjectName.isDomainPattern()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectName.isDomainPattern()方法的具体详情如下:
包路径:javax.management.ObjectName
类名称:ObjectName
方法名:isDomainPattern

ObjectName.isDomainPattern介绍

暂无

代码示例

代码示例来源:origin: org.jboss.eap/wildfly-jsr77

public boolean isMyDomain(ObjectName objectName) {
  if (!objectName.isDomainPattern()) {
    return objectName.getDomain().equals(Constants.JMX_DOMAIN);
  }
  Pattern p = Pattern.compile(objectName.getDomain().replace("*", ".*"));
  return p.matcher(Constants.JMX_DOMAIN).matches();
}

代码示例来源:origin: org.wildfly/wildfly-jmx

private boolean isInExposedModelControllerDomains(ObjectName name) {
  String domain = name.getDomain();
  if (!name.isDomainPattern()) {
    if (domain.equals(resolvedDomain) || domain.equals(expressionsDomain)) {
      return true;
    }
  }
  Pattern p = Pattern.compile(name.getDomain().replace("*", ".*"));
  if (p.matcher(resolvedDomain).matches() || p.matcher(expressionsDomain).matches()) {
    return true;
  }
  return false;
}

代码示例来源:origin: wildfly/wildfly-core

private boolean isInExposedModelControllerDomains(ObjectName name) {
  String domain = name.getDomain();
  if (!name.isDomainPattern()) {
    if (domain.equals(resolvedDomain) || domain.equals(expressionsDomain)) {
      return true;
    }
  }
  Pattern p = Pattern.compile(name.getDomain().replace("*", ".*"));
  if ((resolvedDomain != null && p.matcher(resolvedDomain).matches())
      || (expressionsDomain != null && p.matcher(expressionsDomain).matches())) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.wildfly/wildfly-jmx

@Override
public boolean accepts(ObjectName objectName) {
  String domain = objectName.getDomain();
  if (!objectName.isDomainPattern()) {
    return domain.equals(configuredDomains.getLegacyDomain()) || domain.equals(configuredDomains.getExprDomain());
  }
  Pattern p = Pattern.compile(objectName.getDomain().replace("*", ".*"));
  return p.matcher(configuredDomains.getLegacyDomain()).matches() || p.matcher(configuredDomains.getExprDomain()).matches();
}

代码示例来源:origin: org.jboss.as/jboss-as-jmx

@Override
public boolean accepts(ObjectName objectName) {
  String domain = objectName.getDomain();
  if (!objectName.isDomainPattern()) {
    return domain.equals(configuredDomains.getLegacyDomain()) || domain.equals(configuredDomains.getExprDomain());
  }
  Pattern p = Pattern.compile(objectName.getDomain().replace("*", ".*"));
  return p.matcher(configuredDomains.getLegacyDomain()).matches() || p.matcher(configuredDomains.getExprDomain()).matches();
}

代码示例来源:origin: org.jboss.as/jboss-as-jmx

private ModelControllerMBeanHelper getHelper(ObjectName name) {
    String domain = name.getDomain();
    if (domain.equals(configuredDomains.getLegacyDomain()) || name.isDomainPattern()) {
      return legacyHelper;
    }
    if (domain.equals(configuredDomains.getExprDomain())) {
      return exprHelper;
    }
    //This should not happen
    throw MESSAGES.unknownDomain(domain);
  }
}

代码示例来源:origin: org.glassfish.common/amx-core

public static boolean domainMatches(
    final String defaultDomain,
    final ObjectName pattern,
    final ObjectName candidate)
{
  boolean matches = false;
  final String candidateDomain = candidate.getDomain();
  if (pattern.isDomainPattern())
  {
    final String regex =
        RegexUtil.wildcardToJavaRegex(pattern.getDomain());
    matches = Pattern.matches(regex, candidateDomain);
  }
  else
  {
    // domain is not a pattern
    String patternDomain = pattern.getDomain();
    if (patternDomain.length() == 0)
    {
      patternDomain = defaultDomain;
    }
    matches = patternDomain.equals(candidateDomain);
  }
  //dm( "MBeanProxyMgrImpl.domainMatches: " + matches + " " + pattern + " vs " + candidate );
  return (matches);
}

代码示例来源:origin: wildfly/wildfly-core

private ModelControllerMBeanHelper getHelper(ObjectName name) {
  String domain = name.getDomain();
  if (domain.equals(configuredDomains.getLegacyDomain()) || name.isDomainPattern()) {
    return legacyHelper;
  }
  if (domain.equals(configuredDomains.getExprDomain())) {
    return exprHelper;
  }
  //This should not happen
  throw JmxLogger.ROOT_LOGGER.unknownDomain(domain);
}

代码示例来源:origin: org.wildfly/wildfly-jmx

private ModelControllerMBeanHelper getHelper(ObjectName name) {
  String domain = name.getDomain();
  if (domain.equals(configuredDomains.getLegacyDomain()) || name.isDomainPattern()) {
    return legacyHelper;
  }
  if (domain.equals(configuredDomains.getExprDomain())) {
    return exprHelper;
  }
  //This should not happen
  throw MESSAGES.unknownDomain(domain);
}

代码示例来源:origin: org.glassfish.main.common/amx-core

public static boolean domainMatches(
    final String defaultDomain,
    final ObjectName pattern,
    final ObjectName candidate)
{
  boolean matches;
  final String candidateDomain = candidate.getDomain();
  if (pattern.isDomainPattern())
  {
    final String regex =
        RegexUtil.wildcardToJavaRegex(pattern.getDomain());
    matches = Pattern.matches(regex, candidateDomain);
  }
  else
  {
    // domain is not a pattern
    String patternDomain = pattern.getDomain();
    if (patternDomain.length() == 0)
    {
      patternDomain = defaultDomain;
    }
    matches = patternDomain.equals(candidateDomain);
  }
  //dm( "MBeanProxyMgrImpl.domainMatches: " + matches + " " + pattern + " vs " + candidate );
  return (matches);
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public boolean accepts(ObjectName objectName) {
  String domain = objectName.getDomain();
  if (!objectName.isDomainPattern()) {
    return domain.equals(configuredDomains.getLegacyDomain()) || domain.equals(configuredDomains.getExprDomain());
  }
  Pattern p = Pattern.compile(objectName.getDomain().replace("*", ".*"));
  String legacyDomain = configuredDomains.getLegacyDomain();
  if (legacyDomain != null && p.matcher(legacyDomain).matches()) {
    return true;
  }
  String exprDomain = configuredDomains.getExprDomain();
  if (exprDomain != null && p.matcher(exprDomain).matches()) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.jboss.as/jboss-as-jmx

public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryMBeans(name, query);
  } else {
    Set<ObjectInstance> instances = new HashSet<ObjectInstance>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryMBeans(name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryMBeans(name, query));
    }
    return instances;
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-jmx

public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryNames(name, query);
  } else {
    Set<ObjectName> instances = new HashSet<ObjectName>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryNames(name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryNames(name, query));
    }
    return instances;
  }
}

代码示例来源:origin: org.wildfly/wildfly-jmx

public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryMBeans(name, query);
  } else {
    Set<ObjectInstance> instances = new HashSet<ObjectInstance>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryMBeans(name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryMBeans(name, query));
    }
    return instances;
  }
}

代码示例来源:origin: org.wildfly/wildfly-jmx

public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryNames(name, query);
  } else {
    Set<ObjectName> instances = new HashSet<ObjectName>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryNames(name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryNames(name, query));
    }
    return instances;
  }
}

代码示例来源:origin: wildfly/wildfly-core

public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryMBeans(mbeanServer, name, query);
  } else {
    Set<ObjectInstance> instances = new HashSet<ObjectInstance>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryMBeans(mbeanServer, name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryMBeans(mbeanServer, name, query));
    }
    return instances;
  }
}

代码示例来源:origin: wildfly/wildfly-core

public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
  if (name != null && !name.isDomainPattern()) {
    return getHelper(name).queryNames(mbeanServer, name, query);
  } else {
    Set<ObjectName> instances = new HashSet<ObjectName>();
    if (legacyHelper != null) {
      instances.addAll(legacyHelper.queryNames(mbeanServer, name, query));
    }
    if (exprHelper != null) {
      instances.addAll(exprHelper.queryNames(mbeanServer, name, query));
    }
    return instances;
  }
}

代码示例来源:origin: com.caucho/resin

return true;
if (! queryName.isDomainPattern() &&
  ! name.getDomain().equals(queryName.getDomain()))
 return false;

相关文章