net.sf.ehcache.config.Configuration.validate()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(102)

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

Configuration.validate介绍

[英]Validates the current configuration
[中]验证当前配置

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * Freezes part of the configuration that need to be, and runs validation checks on the Configuration.
 *
 * @param cacheManager the CacheManager instance being configured
 * @throws InvalidConfigurationException With all the associated errors
 */
public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException {
  if (cfg != null) {
    if (cfg.cacheManager == cacheManager) {
      return cfg;
    } else if (cfg.cacheManager.getStatus() != Status.STATUS_SHUTDOWN) {
      throw new IllegalStateException("You cannot share a Configuration instance across multiple running CacheManager instances");
    }
  }
  final Collection<ConfigError> errors = validate();
  if (!errors.isEmpty()) {
    throw new InvalidConfigurationException(errors);
  }
  cfg = new Configuration.RuntimeCfg(cacheManager, fallbackName);
  return cfg;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * Freezes part of the configuration that need to be, and runs validation checks on the Configuration.
 *
 * @param cacheManager the CacheManager instance being configured
 * @throws InvalidConfigurationException With all the associated errors
 */
public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException {
  if (cfg != null) {
    return cfg;
  }
  final Collection<ConfigError> errors = validate();
  if (!errors.isEmpty()) {
    throw new InvalidConfigurationException(errors);
  }
  cfg = new Configuration.RuntimeCfg(cacheManager, fallbackName);
  return cfg;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * Freezes part of the configuration that need to be, and runs validation checks on the Configuration.
 *
 * @param cacheManager the CacheManager instance being configured
 * @throws InvalidConfigurationException With all the associated errors
 */
public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException {
  if (cfg != null) {
    if (cfg.cacheManager == cacheManager) {
      return cfg;
    } else if (cfg.cacheManager.getStatus() != Status.STATUS_SHUTDOWN) {
      throw new IllegalStateException("You cannot share a Configuration instance across multiple running CacheManager instances");
    }
  }
  final Collection<ConfigError> errors = validate();
  if (!errors.isEmpty()) {
    throw new InvalidConfigurationException(errors);
  }
  cfg = new Configuration.RuntimeCfg(cacheManager, fallbackName);
  return cfg;
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * Freezes part of the configuration that need to be, and runs validation checks on the Configuration.
 *
 * @param cacheManager the CacheManager instance being configured
 * @throws InvalidConfigurationException With all the associated errors
 */
public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException {
  if (cfg != null) {
    if (cfg.cacheManager == cacheManager) {
      return cfg;
    } else if (cfg.cacheManager.getStatus() != Status.STATUS_SHUTDOWN) {
      throw new IllegalStateException("You cannot share a Configuration instance across multiple running CacheManager instances");
    }
  }
  final Collection<ConfigError> errors = validate();
  if (!errors.isEmpty()) {
    throw new InvalidConfigurationException(errors);
  }
  cfg = new Configuration.RuntimeCfg(cacheManager, fallbackName);
  return cfg;
}

相关文章

Configuration类方法