Validates the given {@link CacheConfig}.

@param cacheConfig         the {@link CacheConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolve merge policy classes
340257
public static void checkCacheConfig(CacheConfig cacheConfig, CacheMergePolicyProvider mergePolicyProvider) {
        checkCacheConfig(cacheConfig.getInMemoryFormat(), cacheConfig.getEvictionConfig(), cacheConfig.getMergePolicy(),
                cacheConfig, mergePolicyProvider);
    }
777220
public void delCacheEntry(CacheEntry ce, int cause, int source, boolean fromDepIdTemplateInvalidation) {
        htod.delCacheEntry(ce, cause, source, fromDepIdTemplateInvalidation);
    }
459252
public static PoliciesCache fromSourceProvider(
            final SourceProvider provider,
            final Set<Attribute> forcedContext
    )
    {
        return new PoliciesCache(provider, forcedContext);
    }
874182
boolean validateIssuer(String consumerConfigId, String issuers, String tokenIssuer) throws InvalidClaimException {
		boolean isIssuer = false;
		if (issuers == null || issuers.isEmpty()) {
			String msg = Tr.formatMessage(tc, "JWT_TRUSTED_ISSUERS_NULL",
					new Object[] { tokenIssuer, consumerConfigId });
			throw new InvalidClaimException(msg);
		}

		StringTokenizer st = new StringTokenizer(issuers, ",");
		while (st.hasMoreTokens()) {
			String iss = st.nextToken().trim();
			if (tc.isDebugEnabled()) {
				Tr.debug(tc, "Trusted issuer: " + iss);
			}
			if (Constants.ALL_ISSUERS.equals(iss) || (tokenIssuer != null && tokenIssuer.equals(iss))) {
				isIssuer = true;
				break;
			}
		}

		if (!isIssuer) {
			String msg = Tr.formatMessage(tc, "JWT_ISSUER_NOT_TRUSTED",
					new Object[] { tokenIssuer, consumerConfigId, issuers });
			throw new InvalidClaimException(msg);
		}
		return isIssuer;
	}
562093
public static cachepolicy_cachepolicylabel_binding[] get(nitro_service service, String policyname) throws Exception{
		cachepolicy_cachepolicylabel_binding obj = new cachepolicy_cachepolicylabel_binding();
		obj.set_policyname(policyname);
		cachepolicy_cachepolicylabel_binding response[] = (cachepolicy_cachepolicylabel_binding[]) obj.get_resources(service);
		return response;
	}
1054868
@SuppressWarnings("ConstantConditions")
    public static void checkEvictionConfig(EvictionConfig evictionConfig, boolean isNearCache) {
        if (evictionConfig == null) {
            throw new IllegalArgumentException("Eviction config cannot be null!");
        }
        EvictionPolicy evictionPolicy = evictionConfig.getEvictionPolicy();
        String comparatorClassName = evictionConfig.getComparatorClassName();
        EvictionPolicyComparator comparator = evictionConfig.getComparator();

        checkEvictionConfig(evictionPolicy, comparatorClassName, comparator, isNearCache);
    }
1194314
private <K, V> CacheConfiguration<K, V> adjustConfigurationWithCacheManagerDefaults(String alias, CacheConfiguration<K, V> config) {
    ClassLoader cacheClassLoader = config.getClassLoader();

    List<ServiceConfiguration<?>> configurationList = new ArrayList<>();
    configurationList.addAll(config.getServiceConfigurations());

    CacheLoaderWriterConfiguration loaderWriterConfiguration = findSingletonAmongst(CacheLoaderWriterConfiguration.class, config.getServiceConfigurations());
    if (loaderWriterConfiguration == null) {
      CacheLoaderWriterProvider loaderWriterProvider = serviceLocator.getService(CacheLoaderWriterProvider.class);
      ServiceConfiguration<CacheLoaderWriterProvider> preConfiguredCacheLoaderWriterConfig = loaderWriterProvider.getPreConfiguredCacheLoaderWriterConfig(alias);
      if (preConfiguredCacheLoaderWriterConfig != null) {
        configurationList.add(preConfiguredCacheLoaderWriterConfig);
      }
      if (loaderWriterProvider.isLoaderJsrProvided(alias)) {
        configurationList.add(new CacheLoaderWriterConfiguration() {
        });
      }
    }

    ServiceConfiguration<?>[] serviceConfigurations = new ServiceConfiguration<?>[configurationList.size()];
    configurationList.toArray(serviceConfigurations);

    if (cacheClassLoader == null) {
      cacheClassLoader = cacheManagerClassLoader;
    }
    if (cacheClassLoader != config.getClassLoader() ) {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
        config.getEvictionAdvisor(), cacheClassLoader, config.getExpiryPolicy(),
        config.getResourcePools(), serviceConfigurations);
    } else {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
              config.getEvictionAdvisor(), config.getClassLoader(), config.getExpiryPolicy(),
              config.getResourcePools(), serviceConfigurations);
    }
    return config;
  }
1097172
public static PutFromLoadValidator removeFromCache(AdvancedCache cache) {
      AsyncInterceptorChain chain = cache.getAsyncInterceptorChain();
      BasicComponentRegistry cr = cache.getComponentRegistry().getComponent(BasicComponentRegistry.class);

		chain.removeInterceptor(TxPutFromLoadInterceptor.class);
		chain.removeInterceptor(NonTxPutFromLoadInterceptor.class);

      chain.getInterceptors().stream()
            .filter(BaseInvalidationInterceptor.class::isInstance).findFirst().map(AsyncInterceptor::getClass)
            .ifPresent(invalidationClass -> {
               InvalidationInterceptor invalidationInterceptor = new InvalidationInterceptor();
               cr.replaceComponent(InvalidationInterceptor.class.getName(), invalidationInterceptor, true);
               cr.getComponent(InvalidationInterceptor.class).running();
               chain.replaceInterceptor(invalidationInterceptor, invalidationClass);
            });

      chain.getInterceptors().stream()
            .filter(LockingInterceptor.class::isInstance).findFirst().map(AsyncInterceptor::getClass)
            .ifPresent(invalidationClass -> {
               NonTransactionalLockingInterceptor lockingInterceptor = new NonTransactionalLockingInterceptor();
               cr.replaceComponent(NonTransactionalLockingInterceptor.class.getName(), lockingInterceptor, true);
               cr.getComponent(NonTransactionalLockingInterceptor.class).running();
               chain.replaceInterceptor(lockingInterceptor, LockingInterceptor.class);
            });

		CacheCommandInitializer cci = cr.getComponent(CacheCommandInitializer.class).running();
		return cci.removePutFromLoadValidator(cache.getName());
	}
658659
public void deregister(CacheEntryListenerConfiguration<K, V> configuration) {
    requireNonNull(configuration);
    dispatchQueues.keySet().removeIf(registration ->
        configuration.equals(registration.getConfiguration()));
  }
1080230
public static ConfigProvider getConfigProvider(String configProviderClassName) {
    ConfigProvider configProvider = null;

    if (configProviderClassName != null && !"".equals(configProviderClassName)) {
      Class userConfigProviderClass = null;
      try {
        userConfigProviderClass = Class.forName(configProviderClassName);
      } catch (Exception e) {
        thisLogger.error("Could not get the config provider class: {}.",
                configProviderClassName, e.getMessage());
      }
      if (userConfigProviderClass != null) {
        try {
          Constructor<ConfigProvider> constructor = userConfigProviderClass.getConstructor();
          configProvider = constructor.newInstance();
        } catch (Exception e) {
          thisLogger.error("Could not create the config provider.", e);
        }
      }
    }
    return configProvider;
  }
927904
protected boolean isValidJREVersion(ILaunchConfiguration config) {
		final IVMInstall install = this.fJREBlock.getJRE();
		if (install instanceof IVMInstall2) {
			final String version = ((IVMInstall2) install).getJavaVersion();
			if (version == null) {
				setErrorMessage(MessageFormat.format(
						Messages.RuntimeEnvironmentTab_3, install.getName()));
				return false;
			}
			if (!Utils.isCompatibleJREVersion(version)) {
				setErrorMessage(MessageFormat.format(
						Messages.RuntimeEnvironmentTab_4,
						install.getName(),
						version,
						SARLVersion.MINIMAL_JDK_VERSION,
						SARLVersion.MAXIMAL_JDK_VERSION));
				return false;
			}
		}
		return true;
	}
439824
@Trivial
    public static String normalizeCacheName(String cacheName, CacheConfig cacheConfig) {

        String tempCacheName = cacheName;

        if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_BASE_JNDI_NAME)) {
            tempCacheName = DCacheBase.DEFAULT_CACHE_NAME;

        } else if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_DMAP_JNDI_NAME)) {
            tempCacheName = DCacheBase.DEFAULT_DISTRIBUTED_MAP_NAME;
        }

        // Make sure the input cacheName matched with cacheConfig's cacheName.
        // If not match, set to the input cacheName for cacheConfig
        if (null != cacheConfig && !tempCacheName.equals(cacheConfig.cacheName)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "normalized cacheName=" + cacheName + " does not match with cacheConfig cacheName=" + cacheConfig.cacheName);
            }
            cacheConfig.cacheName = tempCacheName;
        }

        return tempCacheName;
    }
1048723
protected SplitBrainMergePolicy<V, T> getMergePolicy(MergePolicyConfig mergePolicyConfig) {
        String mergePolicyName = mergePolicyConfig.getPolicy();
        return splitBrainMergePolicyProvider.getMergePolicy(mergePolicyName);
    }
255300
public final Cache2kBuilder<K,V> resiliencePolicy(ResiliencePolicy<K,V> v) {
    config().setResiliencePolicy(wrapCustomizationInstance(v));
    return this;
  }
1219780
public static boolean isMergeFolders() {
        Configuration config = ConfigUtils.getCurrentConfig();
        if (config != null) {
            return config.getBoolean(MERGE_FOLDERS_CONFIG_KEY, false);
        } else {
            return false;
        }
    }
953294
public static cachepolicy_binding get(nitro_service service, String policyname) throws Exception{
		cachepolicy_binding obj = new cachepolicy_binding();
		obj.set_policyname(policyname);
		cachepolicy_binding response = (cachepolicy_binding) obj.get_resource(service);
		return response;
	}
1159118
protected MergePolicyConfig mergePolicyConfig(boolean mergePolicyExist, String mergePolicy, int batchSize) {
        if (mergePolicyExist) {
            MergePolicyConfig config = new MergePolicyConfig(mergePolicy, batchSize);
            return config;
        }
        return new MergePolicyConfig();
    }