Adds a {@link ResilienceStrategy} instance to be used with a cache matching the provided alias.

@param alias the cache alias
@param resilienceStrategy the resilience strategy instance

@return this configuration instance
13163
public DefaultResilienceStrategyProviderConfiguration addResilienceStrategyFor(String alias, ResilienceStrategy<?, ?> resilienceStrategy) {
    getDefaults().put(alias, new DefaultResilienceStrategyConfiguration(resilienceStrategy));
    return this;
  }
347698
public static base_response add(nitro_service client, cacheforwardproxy resource) throws Exception {
		cacheforwardproxy addresource = new cacheforwardproxy();
		addresource.ipaddress = resource.ipaddress;
		addresource.port = resource.port;
		return addresource.add_resource(client);
	}
527267
public static PartitionReducerProxy createPartitionReducerProxy(String id, InjectionReferences injectionRefs, RuntimeStepExecution stepContext) throws ArtifactValidationException {
        PartitionReducer loadedArtifact = (PartitionReducer)loadArtifact(id, injectionRefs);
        PartitionReducerProxy proxy = new PartitionReducerProxy(loadedArtifact);
        proxy.setStepContext(stepContext);

        return proxy;
    }
255300
public final Cache2kBuilder<K,V> resiliencePolicy(ResiliencePolicy<K,V> v) {
    config().setResiliencePolicy(wrapCustomizationInstance(v));
    return this;
  }
619328
protected function buildCacheOnce()
    {
        if ($this->aliasCache !== null) {
            return;
        }

        $this->aliasCache = [];

        foreach ($this->aliases as $typeName => $rules) {
            foreach ($rules as $name => $rule) {
                if (isset($this->aliasCache[$name])) {
                    $firstTypeName = $this->aliasCache[$name]['type'];
                    throw new MisConfiguredException("Double entry for name '$name' (under $typeName and $firstTypeName)");
                }

                $this->aliasCache[$name] = [
                    'type' => $typeName,
                    'rule' => $rule,
                ];
            }
        }
    }
119027
@Override
	public <T extends Endpoint> Strategy<T> create() {
		if (transporter == null) {
			return new RoundRobinStrategy<T>(broker, preferLocal);
		}
		return new CpuUsageStrategy<T>(broker, preferLocal, maxTries, lowCpuUsage, transporter);
	}
50300
public void addCacheConfiguration(final String alias, final CacheConfiguration<?, ?> config) {
    if (caches.put(alias, config) != null) {
      throw new IllegalStateException("Cache '" + alias + "' already present!");
    }
  }
843495
public void addAliasToConfigSite(String alias, String redirect, String offset) {

        long timeOffset = 0;
        try {
            timeOffset = Long.parseLong(offset);
        } catch (Throwable e) {
            // ignore
        }
        CmsSiteMatcher siteMatcher = new CmsSiteMatcher(alias, timeOffset);
        boolean redirectVal = new Boolean(redirect).booleanValue();
        siteMatcher.setRedirect(redirectVal);
        m_aliases.add(siteMatcher);
    }
1166053
public void setClientAlias(String alias) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "setClientAlias", new Object[] { alias });
        if (!ks.containsAlias(alias)) {
            String keyFileName = config.getProperty(Constants.SSLPROP_KEY_STORE);
            String tokenLibraryFile = config.getProperty(Constants.SSLPROP_TOKEN_LIBRARY);
            String location = keyFileName != null ? keyFileName : tokenLibraryFile;

            String message = TraceNLSHelper.getInstance().getFormattedMessage("ssl.client.alias.not.found.CWPKI0023E", new Object[] { alias, location },
                                                                              "Client alias " + alias + " not found in keystore.");
            Tr.error(tc, "ssl.client.alias.not.found.CWPKI0023E", new Object[] { alias, location });
            throw new IllegalArgumentException(message);
        }
        this.clientAlias = alias;

        if (customKM != null && customKM instanceof KeyManagerExtendedInfo)
            ((KeyManagerExtendedInfo) customKM).setKeyStoreClientAlias(alias);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "setClientAlias");
    }
980860
@SuppressWarnings( "deprecation" )
    private static SecurityPlan createSecurityPlanImpl( BoltServerAddress address, Config config )
            throws GeneralSecurityException, IOException
    {
        if ( config.encrypted() )
        {
            Logger logger = config.logging().getLog( "SecurityPlan" );
            Config.TrustStrategy trustStrategy = config.trustStrategy();
            boolean hostnameVerificationEnabled = trustStrategy.isHostnameVerificationEnabled();
            switch ( trustStrategy.strategy() )
            {
            case TRUST_ON_FIRST_USE:
                logger.warn(
                        "Option `TRUST_ON_FIRST_USE` has been deprecated and will be removed in a future " +
                        "version of the driver. Please switch to use `TRUST_ALL_CERTIFICATES` instead." );
                return SecurityPlan.forTrustOnFirstUse( trustStrategy.certFile(), hostnameVerificationEnabled, address, logger );
            case TRUST_SIGNED_CERTIFICATES:
                logger.warn(
                        "Option `TRUST_SIGNED_CERTIFICATE` has been deprecated and will be removed in a future " +
                        "version of the driver. Please switch to use `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` instead." );
                // intentional fallthrough

            case TRUST_CUSTOM_CA_SIGNED_CERTIFICATES:
                return SecurityPlan.forCustomCASignedCertificates( trustStrategy.certFile(), hostnameVerificationEnabled );
            case TRUST_SYSTEM_CA_SIGNED_CERTIFICATES:
                return SecurityPlan.forSystemCASignedCertificates( hostnameVerificationEnabled );
            case TRUST_ALL_CERTIFICATES:
                return SecurityPlan.forAllCertificates( hostnameVerificationEnabled );
            default:
                throw new ClientException(
                        "Unknown TLS authentication strategy: " + trustStrategy.strategy().name() );
            }
        }
        else
        {
            return insecure();
        }
    }
1311250
public static AliasedDiscoveryConfig newAliasedDiscoveryConfig(String name) {
        if ("aws".equals(name)) {
            return new ClientAwsConfig();
        } else {
            return AliasedDiscoveryConfigUtils.newConfigFor(name);
        }
    }
982277
public static ConsistentHashFactory pickConsistentHashFactory(GlobalConfiguration globalConfiguration, Configuration configuration) {
      ConsistentHashFactory factory = configuration.clustering().hash().consistentHashFactory();
      if (factory == null) {
         CacheMode cacheMode = configuration.clustering().cacheMode();
         if (cacheMode.isClustered()) {
            if (cacheMode.isDistributed()) {
               if (globalConfiguration.transport().hasTopologyInfo()) {
                  factory = new TopologyAwareSyncConsistentHashFactory();
               } else {
                  factory = new SyncConsistentHashFactory();
               }
            } else if (cacheMode.isReplicated() || cacheMode.isInvalidation()) {
               factory = new SyncReplicatedConsistentHashFactory();
            } else if (cacheMode.isScattered()) {
               factory = new ScatteredConsistentHashFactory();
            } else {
               throw new CacheException("Unexpected cache mode: " + cacheMode);
            }
         }
      }
      return factory;
   }
1205392
public RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy) {
        if (instance == null) {
            throw new IllegalStateException("Using the builder after build() was called is not allowed!");
        }
        instance.setDefaultValueStrategy(strategy);
        return this;
    }
587280
public <K, V> CacheProxy<K, V> createCache(String cacheName, Configuration<K, V> configuration) {
    CaffeineConfiguration<K, V> config = resolveConfigurationFor(configuration);
    return new Builder<>(cacheName, config).build();
  }
752199
private static PersistenceStrategy<?, ?, ?> getPerTableStrategy(
			EmbeddedCacheManager externalCacheManager,
			URL configUrl,
			JtaPlatform platform,
			Set<EntityKeyMetadata> entityTypes,
			Set<AssociationKeyMetadata> associationTypes,
			Set<IdSourceKeyMetadata> idSourceTypes) {

		PerTableKeyProvider keyProvider = new PerTableKeyProvider();

		PerTableCacheManager cacheManager = externalCacheManager != null ?
				new PerTableCacheManager( externalCacheManager, entityTypes, associationTypes, idSourceTypes ) :
				new PerTableCacheManager( configUrl, platform, entityTypes, associationTypes, idSourceTypes );

		return new PersistenceStrategy<PersistentEntityKey, PersistentAssociationKey, PersistentIdSourceKey>( cacheManager, keyProvider );
	}
983810
def add(cache, strategy)
      c = cache.to_sym
      s = strategy.to_sym

      fail Exceptions::UnknownCachingStrategy, "Unknown caching strategy \":#{strategy}\" given. Did you register it in advance?"  unless caching_strategies.key?(strategy)

      caches[c] = caching_strategies[s].new
      caches[c]
    end
481801
public String getResourceAlias(String alias)
    {
        if (_resourceAliases == null)
            return null;
        return (String)_resourceAliases.get(alias);
    }