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

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

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

Configuration.getManagementRESTService介绍

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

代码示例

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

private void testAddManagementRESTService() {
  ManagementRESTServiceConfiguration managementRESTServiceConfiguration = configuration.getManagementRESTService();
  if (managementRESTServiceConfiguration != null) {
    addChildElement(new ManagementRESTServiceConfigurationElement(this, managementRESTServiceConfiguration));
  }
}

代码示例来源: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

ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
if (managementRESTService == null && clustered && ManagementServerLoader.isManagementAvailable()) {
  managementRESTService = getDefaultClusteredManagementRESTServiceConfiguration(configuration);

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

/**
 * Instantiates a new statistics placeholder.
 * 
 * @param ehcache the ehcache
 * @param executor the executor
 */
public StatisticsGateway(Ehcache ehcache, ScheduledExecutorService executor) {
  StatisticsManager statsManager = new StatisticsManager();
  statsManager.root(ehcache);
  this.assocCacheName = ehcache.getName();
  ManagementRESTServiceConfiguration mRest = null;
  if (ehcache != null && ehcache.getCacheManager() != null && 
      ehcache.getCacheManager().getConfiguration() != null) {
    mRest = ehcache.getCacheManager().getConfiguration().getManagementRESTService();
  }
  this.extended = new ExtendedStatisticsImpl(statsManager, executor, DEFAULT_TIME_TO_DISABLE_MINS, TimeUnit.MINUTES,
      getProperSampleHistorySize(mRest), 
      getProperSampleIntervalSeconds(mRest), 
      getProperSampleSearchIntervalSeconds(mRest));
  this.core = new CoreStatisticsImpl(extended);
}

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

private void testAddManagementRESTService() {
  ManagementRESTServiceConfiguration managementRESTServiceConfiguration = configuration.getManagementRESTService();
  if (managementRESTServiceConfiguration != null) {
    addChildElement(new ManagementRESTServiceConfigurationElement(this, managementRESTServiceConfiguration));
  }
}

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

private void testAddManagementRESTService() {
  ManagementRESTServiceConfiguration managementRESTServiceConfiguration = configuration.getManagementRESTService();
  if (managementRESTServiceConfiguration != null) {
    addChildElement(new ManagementRESTServiceConfigurationElement(this, managementRESTServiceConfiguration));
  }
}

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

private void testAddManagementRESTService() {
  ManagementRESTServiceConfiguration managementRESTServiceConfiguration = configuration.getManagementRESTService();
  if (managementRESTServiceConfiguration != null) {
    addChildElement(new ManagementRESTServiceConfigurationElement(this, managementRESTServiceConfiguration));
  }
}

代码示例来源: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 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.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * {@inheritDoc}
 */
public void setSampledStatisticsEnabled(final boolean enableStatistics) {
  if (cacheManager == null) {
    throw new IllegalStateException("You must add the cache to a CacheManager before enabling/disabling sampled statistics.");
  }
  boolean oldValue = isSampledStatisticsEnabled();
  if (oldValue != enableStatistics) {
    if (enableStatistics) {
      ManagementRESTServiceConfiguration mgmtRESTConfigSvc = cacheManager.getConfiguration().getManagementRESTService();
      if (mgmtRESTConfigSvc != null && mgmtRESTConfigSvc.isEnabled()) {
        sampledCacheStatistics.enableSampledStatistics(cacheManager.getTimer(), mgmtRESTConfigSvc.makeSampledCounterConfig(),
            mgmtRESTConfigSvc.makeSampledGetRateCounterConfig(), mgmtRESTConfigSvc.makeSampledSearchRateCounterConfig());
      } else {
        sampledCacheStatistics.enableSampledStatistics(cacheManager.getTimer());
      }
      setStatisticsEnabled(true);
    } else {
      sampledCacheStatistics.disableSampledStatistics();
    }
    firePropertyChange("SampledStatisticsEnabled", oldValue, enableStatistics);
  }
}

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

ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
if (managementRESTService == null && clustered && ManagementServerLoader.isManagementAvailable()) {
  managementRESTService = getDefaultClusteredManagementRESTServiceConfiguration(configuration);

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

ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
if (managementRESTService == null && clustered && ManagementServerLoader.isManagementAvailable()) {
  managementRESTService = getDefaultClusteredManagementRESTServiceConfiguration(configuration);

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

ManagementRESTServiceConfiguration managementRESTService = configuration.getManagementRESTService();
if (managementRESTService != null && managementRESTService.isEnabled()) {

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

/**
 * Instantiates a new statistics placeholder.
 * 
 * @param ehcache the ehcache
 * @param executor the executor
 */
public StatisticsGateway(Ehcache ehcache, ScheduledExecutorService executor) {
  StatisticsManager statsManager = new StatisticsManager();
  statsManager.root(ehcache);
  this.assocCacheName = ehcache.getName();
  ManagementRESTServiceConfiguration mRest = null;
  if (ehcache != null && ehcache.getCacheManager() != null && 
      ehcache.getCacheManager().getConfiguration() != null) {
    mRest = ehcache.getCacheManager().getConfiguration().getManagementRESTService();
  }
  this.extended = new ExtendedStatisticsImpl(statsManager, executor, DEFAULT_TIME_TO_DISABLE_MINS, TimeUnit.MINUTES,
      getProperSampleHistorySize(mRest), 
      getProperSampleIntervalSeconds(mRest), 
      getProperSampleSearchIntervalSeconds(mRest));
  this.core = new CoreStatisticsImpl(extended);
}

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

/**
 * Instantiates a new statistics placeholder.
 * 
 * @param ehcache the ehcache
 * @param executor the executor
 */
public StatisticsGateway(Ehcache ehcache, ScheduledExecutorService executor) {
  StatisticsManager statsManager = new StatisticsManager();
  statsManager.root(ehcache);
  this.assocCacheName = ehcache.getName();
  ManagementRESTServiceConfiguration mRest = null;
  if (ehcache != null && ehcache.getCacheManager() != null && 
      ehcache.getCacheManager().getConfiguration() != null) {
    mRest = ehcache.getCacheManager().getConfiguration().getManagementRESTService();
  }
  this.extended = new ExtendedStatisticsImpl(statsManager, executor, DEFAULT_TIME_TO_DISABLE_MINS, TimeUnit.MINUTES,
      getProperSampleHistorySize(mRest), 
      getProperSampleIntervalSeconds(mRest), 
      getProperSampleSearchIntervalSeconds(mRest));
  this.core = new CoreStatisticsImpl(extended);
}

相关文章

微信公众号

最新文章

更多

Configuration类方法