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

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

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

Configuration.getTerracottaConfiguration介绍

[英]Gets the TerracottaClientConfiguration
[中]获取TerracottaClientConfiguration

代码示例

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

/**
 * @return Whether terracotta clustering is being used and rejoin is enabled
 */
public boolean isTerracottaRejoin() {
  TerracottaClientConfiguration terracottaConfiguration = getTerracottaConfiguration();
  return terracottaConfiguration != null && terracottaConfiguration.isRejoin();
}

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

private void testAddTerracottaElement() {
    TerracottaClientConfiguration terracottaConfiguration = configuration.getTerracottaConfiguration();
    if (terracottaConfiguration != null) {
      addChildElement(new TerracottaConfigConfigurationElement(this, terracottaConfiguration));
    }
  }
}

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

private ManagementRESTServiceConfiguration getDefaultClusteredManagementRESTServiceConfiguration(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService;
  managementRESTService = new ManagementRESTServiceConfiguration();
  String url = configuration.getTerracottaConfiguration().getUrl();
  if (url != null && url.contains("@")) {
    managementRESTService.setSslEnabled(true);
  }
  managementRESTService.setEnabled(true);
  managementRESTService.setBind(ManagementRESTServiceConfiguration.NO_BIND);
  managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
  return managementRESTService;
}

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

private void assertManagementRESTServiceConfigurationIsCorrect(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
  if (managementRESTService == null || !managementRESTService.isEnabled()) {
    return;
  }
  String url = configuration.getTerracottaConfiguration() != null ? configuration.getTerracottaConfiguration().getUrl() : null;
  boolean connectingToSecureCluster = url != null && url.contains("@");
  if (connectingToSecureCluster && !managementRESTService.isSslEnabled()) {
    throw new InvalidConfigurationException("The REST agent cannot be bound to a port when SSL is disabled and" +
                        " connecting to a secure cluster. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration sslEnabled=\"true\" .../>" +
                        " or remove the ManagementRESTServiceConfiguration element.");
  }
  if (connectingToSecureCluster && managementRESTService.getSecurityServiceLocation() == null) {
    managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
    LOG.warn("The REST agent must have a non-null Security Service Location when SSL is enabled." +
         " Using ManagementRESTServiceConfiguration.AUTO_LOCATION as a connection to a secure cluster" +
         " is configured.");
  }
  if (managementRESTService.isSslEnabled() && managementRESTService.getSecurityServiceLocation() == null) {
    throw new InvalidConfigurationException("The REST agent must have a non-null Security Service Location when" +
                        " SSL is enabled. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration securityServiceLocation=\"...\" .../>.");
  }
}

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

void setUpWanConfig() {
 if (!cache.getCacheManager().getConfiguration().getTerracottaConfiguration().isWanEnabledTSA()) {
  toolkitInstanceFactory.markCacheWanDisabled(cache.getCacheManager().getName(), cache.getName());
 }
}

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

private void doInit(Configuration configuration) {
  if (configuration.getTerracottaConfiguration() != null) {
    configuration.getTerracottaConfiguration().freezeConfig();
  terracottaClient = new TerracottaClient(this, configuration.getTerracottaConfiguration());
  if (terracottaClient.createClusteredInstanceFactory()) {
    clustered = true;
  if (configuration.getTerracottaConfiguration() != null) {
    if (configuration.getTerracottaConfiguration().isWanEnabledTSA()) {
      terracottaClient.waitForOrchestrator(getName());

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

/**
 * @return Whether terracotta clustering is being used and rejoin is enabled
 */
public boolean isTerracottaRejoin() {
  TerracottaClientConfiguration terracottaConfiguration = getTerracottaConfiguration();
  return terracottaConfiguration != null && terracottaConfiguration.isRejoin();
}

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

/**
 * @return Whether terracotta clustering is being used and rejoin is enabled
 */
public boolean isTerracottaRejoin() {
  TerracottaClientConfiguration terracottaConfiguration = getTerracottaConfiguration();
  return terracottaConfiguration != null && terracottaConfiguration.isRejoin();
}

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

/**
 * @return Whether terracotta clustering is being used and rejoin is enabled
 */
public boolean isTerracottaRejoin() {
  TerracottaClientConfiguration terracottaConfiguration = getTerracottaConfiguration();
  return terracottaConfiguration != null && terracottaConfiguration.isRejoin();
}

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

private void testAddTerracottaElement() {
    TerracottaClientConfiguration terracottaConfiguration = configuration.getTerracottaConfiguration();
    if (terracottaConfiguration != null) {
      addChildElement(new TerracottaConfigConfigurationElement(this, terracottaConfiguration));
    }
  }
}

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

private void testAddTerracottaElement() {
    TerracottaClientConfiguration terracottaConfiguration = configuration.getTerracottaConfiguration();
    if (terracottaConfiguration != null) {
      addChildElement(new TerracottaConfigConfigurationElement(this, terracottaConfiguration));
    }
  }
}

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

private void testAddTerracottaElement() {
    TerracottaClientConfiguration terracottaConfiguration = configuration.getTerracottaConfiguration();
    if (terracottaConfiguration != null) {
      addChildElement(new TerracottaConfigConfigurationElement(this, terracottaConfiguration));
    }
  }
}

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

private void validateTerracottaConfig(final Configuration configuration, final Collection<ConfigError> errors) {
  final TerracottaClientConfiguration clientConfiguration = configuration.getTerracottaConfiguration();
  if (clientConfiguration != null && clientConfiguration.isRejoin() && !getTerracottaConfiguration().isNonstopEnabled()) {
    errors.add(new CacheConfigError("Terracotta clustered caches must be nonstop when rejoin is enabled.", getName()));
  }
}

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

private ManagementRESTServiceConfiguration getDefaultClusteredManagementRESTServiceConfiguration(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService;
  managementRESTService = new ManagementRESTServiceConfiguration();
  String url = configuration.getTerracottaConfiguration().getUrl();
  if (url != null && url.contains("@")) {
    managementRESTService.setSslEnabled(true);
  }
  managementRESTService.setEnabled(true);
  managementRESTService.setBind(ManagementRESTServiceConfiguration.NO_BIND);
  managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
  return managementRESTService;
}

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

private ManagementRESTServiceConfiguration getDefaultClusteredManagementRESTServiceConfiguration(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService;
  managementRESTService = new ManagementRESTServiceConfiguration();
  String url = configuration.getTerracottaConfiguration().getUrl();
  if (url != null && url.contains("@")) {
    managementRESTService.setSslEnabled(true);
  }
  managementRESTService.setEnabled(true);
  managementRESTService.setBind(ManagementRESTServiceConfiguration.NO_BIND);
  managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
  return managementRESTService;
}

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

private void assertManagementRESTServiceConfigurationIsCorrect(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
  if (managementRESTService == null || !managementRESTService.isEnabled()) {
    return;
  }
  String url = configuration.getTerracottaConfiguration() != null ? configuration.getTerracottaConfiguration().getUrl() : null;
  boolean connectingToSecureCluster = url != null && url.contains("@");
  if (connectingToSecureCluster && !managementRESTService.isSslEnabled()) {
    throw new InvalidConfigurationException("The REST agent cannot be bound to a port when SSL is disabled and" +
                        " connecting to a secure cluster. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration sslEnabled=\"true\" .../>" +
                        " or remove the ManagementRESTServiceConfiguration element.");
  }
  if (connectingToSecureCluster && managementRESTService.getSecurityServiceLocation() == null) {
    managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
    LOG.warn("The REST agent must have a non-null Security Service Location when SSL is enabled." +
         " Using ManagementRESTServiceConfiguration.AUTO_LOCATION as a connection to a secure cluster" +
         " is configured.");
  }
  if (managementRESTService.isSslEnabled() && managementRESTService.getSecurityServiceLocation() == null) {
    throw new InvalidConfigurationException("The REST agent must have a non-null Security Service Location when" +
                        " SSL is enabled. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration securityServiceLocation=\"...\" .../>.");
  }
}

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

private void assertManagementRESTServiceConfigurationIsCorrect(Configuration configuration) {
  ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
  if (managementRESTService == null || !managementRESTService.isEnabled()) {
    return;
  }
  String url = configuration.getTerracottaConfiguration() != null ? configuration.getTerracottaConfiguration().getUrl() : null;
  boolean connectingToSecureCluster = url != null && url.contains("@");
  if (connectingToSecureCluster && !managementRESTService.isSslEnabled()) {
    throw new InvalidConfigurationException("The REST agent cannot be bound to a port when SSL is disabled and" +
                        " connecting to a secure cluster. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration sslEnabled=\"true\" .../>" +
                        " or remove the ManagementRESTServiceConfiguration element.");
  }
  if (connectingToSecureCluster && managementRESTService.getSecurityServiceLocation() == null) {
    managementRESTService.setSecurityServiceLocation(ManagementRESTServiceConfiguration.AUTO_LOCATION);
    LOG.warn("The REST agent must have a non-null Security Service Location when SSL is enabled." +
         " Using ManagementRESTServiceConfiguration.AUTO_LOCATION as a connection to a secure cluster" +
         " is configured.");
  }
  if (managementRESTService.isSslEnabled() && managementRESTService.getSecurityServiceLocation() == null) {
    throw new InvalidConfigurationException("The REST agent must have a non-null Security Service Location when" +
                        " SSL is enabled. Change your configuration to" +
                        " <ManagementRESTServiceConfiguration securityServiceLocation=\"...\" .../>.");
  }
}

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

private void doInit(Configuration configuration) {
  if (configuration.getTerracottaConfiguration() != null) {
    configuration.getTerracottaConfiguration().freezeConfig();
  terracottaClient = new TerracottaClient(this, configuration.getTerracottaConfiguration());
  if (terracottaClient.createClusteredInstanceFactory()) {
    clustered = true;
  if (configuration.getTerracottaConfiguration() != null) {
    if (configuration.getTerracottaConfiguration().isWanEnabledTSA()) {
      terracottaClient.waitForOrchestrator(getName());

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

private void doInit(Configuration configuration) {
  if (configuration.getTerracottaConfiguration() != null) {
    configuration.getTerracottaConfiguration().freezeConfig();
  terracottaClient = new TerracottaClient(this, configuration.getTerracottaConfiguration());
  if (terracottaClient.createClusteredInstanceFactory()) {
    clustered = true;
  if (configuration.getTerracottaConfiguration() != null) {
    if (configuration.getTerracottaConfiguration().isWanEnabledTSA()) {
      terracottaClient.waitForOrchestrator(getName());

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

private void doInit(Configuration configuration) {
  if (configuration.getTerracottaConfiguration() != null) {
    configuration.getTerracottaConfiguration().freezeConfig();
  terracottaClient = new TerracottaClient(this, cacheRejoinAction, configuration.getTerracottaConfiguration());

相关文章

Configuration类方法