Set the strategy used to locate the {@link Assertion} to operate on.

@param strategy
strategy used to locate the {@link Assertion} to operate on
176580
public void setAssertionLookupStrategy(final Function<ProfileRequestContext, Assertion> strategy) {
    ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
    this.assertionLookupStrategy = Constraint.isNotNull(strategy, "Assertion lookup strategy cannot be null");
  }
563230
function Strategy(options, verify) {

  if (typeof options != 'object') options = {};

  if (!options.secretOrPublicKey) throw new TypeError(
    'JwtCookieComboStrategy requires a secret or public key'
  );

  if (!verify) throw new TypeError(
    'JwtCookieComboStrategy requires a verify callback'
  );

  passport.Strategy.call(this);

  this.name = 'jwt-cookiecombo';
  this._verify = verify;

  this._jwtVerifyOptions = Object.assign({}, options.jwtVerifyOptions);
  this._passReqToCallback = options.passReqToCallback || false;
  this._jwtHeaderKey = options.jwtHeaderKey || 'authorization';
  this._jwtCookieName = options.jwtCookieName || 'jwt';
  this._jwtCookieSecure = options.jwtCookieSecure !== false;
  this._secretOrPublicKey = options.secretOrPublicKey;

  this._jwtHeaderKey = this._jwtHeaderKey.toLowerCase();

}
1235399
public void setInputLocalStrategy(int inputNum, LocalStrategy strategy) {
		this.config.setInteger(INPUT_LOCAL_STRATEGY_PREFIX + inputNum, strategy.ordinal());
	}
29732
protected function buildStrategies()
    {
        foreach ($this->strategies as $parameterName => &$strategy) {

            // only build strategies we will actually use

            if ($this->isParameterIgnored($parameterName)) continue;

            // get the value for the filter parameter
            // and if it is empty, we're not filtering by it and should skip it
            $parameterValue = $this->parameterValue($parameterName);

            if ($this->isParameterValueUnset($parameterName, $parameterValue)) continue;

            // check if the strategy is a string that should be instantiated as a class
            if (is_string($strategy) && $strategy !== static::SETTING) {

                try {

                    $reflection = new ReflectionClass($strategy);

                    if ( ! $reflection->IsInstantiable()) {
                        throw new ParameterStrategyInvalidException("Uninstantiable string provided as strategy for '{$strategy}'");
                    }

                    $strategy = new $strategy();

                } catch (\Exception $e) {

                    throw new ParameterStrategyInvalidException(
                        "Exception thrown while trying to reflect or instantiate string provided as strategy for '{$strategy}'",
                        0, $e
                    );
                }

                // check if it is of the correct type
                if ( ! is_a($strategy, ParameterFilterInterface::class)) {

                    throw new ParameterStrategyInvalidException(
                        "Instantiated string provided is not a ParameterFilter: '" . get_class($strategy) . "'"
                    );
                }
            }
        }

        unset($strategy);

        return $this->strategies;
    }
1213508
protected function _resolveStrategy($strategy)
    {
        $key = Security::salt();

        if (!$strategy) {
            $class = self::DEFAULT_STRATEGY;
            $strategy = new $class($key);
        }

        if (is_string($strategy) && class_exists($strategy)) {
            $strategy = new $strategy($key);
        }

        if (!($strategy instanceof StrategyInterface)) {
            throw new Exception('Invalid "strategy" configuration.');
        }

        return $strategy;
    }
874705
public function strategy($strategy = null)
    {
        if (is_null($strategy)) {
            $strategy = $this->defaultStrategy ?: OrderStrategy::class;
        }

        if (!class_exists($strategy)) {
            $strategy = __NAMESPACE__ . '\strategies\\' . ucfirst($strategy);
        }

        if (!class_exists($strategy)) {
            throw new InvalidArgumentException("Unsupported strategy \"{$strategy}\"");
        }

        if (empty($this->strategies[$strategy]) || !($this->strategies[$strategy] instanceof StrategyInterface)) {
            $this->strategies[$strategy] = new $strategy($this);
        }

        return $this->strategies[$strategy];
    }
1028270
def set_sync_strategy
      case @options['sync_strategy']
      when 'rsync'
        @sync_strategy = DockerSync::SyncStrategy::Rsync.new(@sync_name, @options)
      when 'unison'
        @sync_strategy = DockerSync::SyncStrategy::Unison.new(@sync_name, @options)
      when 'native'
        @sync_strategy = DockerSync::SyncStrategy::Native.new(@sync_name, @options)
      when 'native_osx'
        @sync_strategy = DockerSync::SyncStrategy::NativeOsx.new(@sync_name, @options)
      else
        raise "Unknown sync_strategy #{@options['sync_strategy']}"
      end
    end
645936
protected function _prepareStrategy (ModularStrategyInterface $strategy)
    {
        $this->env->makeFollower($strategy);
        
        if (!$strategy->shouldProcess()) {
            return false;
        }
        
        $strategy->prepare();
        
        return true;
    }
700828
public ObjectMarshallingStrategy getStrategyObject(String strategyName) {
        if( StringUtils.isEmpty(strategyName) ) { 
            return null;
        }
        if (strategyName.startsWith("org.drools.marshalling.impl")) {
            strategyName = strategyName.replaceFirst("org.drools.marshalling.impl", "org.drools.core.marshalling.impl");
        }
        
        for( int i = 0; i < this.strategiesList.length; ++i ) { 
        	 if( strategiesList[i].getName().equals(strategyName) ) {
            		return strategiesList[i];
            }
        }
        throw new RuntimeException( "Unable to find PlaceholderResolverStrategy for name : " + strategyName );
    }
121667
public function setSaveStrategy($strategy)
    {
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
            throw new InvalidArgumentException($msg);
        }

        $this->_saveStrategy = $strategy;

        return $this;
    }
31867
protected function resolveContextStrategy($strategy)
    {
        if ( ! $strategy) {
            $strategy = config('cms-models.strategies.repository.default-strategy');
        }

        if ( ! ($strategyClass = $this->resolveContextStrategyClass($strategy))) {
            return null;
        }

        return app($strategyClass);
    }
671329
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new SecureRandomStrategy<T>(broker, preferLocal);
	}
884709
def inherit_strategy(strategy)
      AvoDeploy::Deployment.instance.log.debug "Loading deployment strategy #{strategy.to_s}..."

      strategy_file_path = File.dirname(__FILE__) + "/strategy/#{strategy.to_s}.rb"

      if File.exist?(strategy_file_path)
        require strategy_file_path
      else
        raise RuntimeError, "The requested strategy '#{strategy.to_s}' does not exist"
      end
    end
753737
@Override
	public <T extends Endpoint> Strategy<T> create() {
		if (transporter == null) {
			return new RoundRobinStrategy<T>(broker, preferLocal);
		}
		return new NetworkLatencyStrategy<T>(broker, preferLocal, maxTries, this);
	}
1127919
public AuthSource findByStrategy(String strategy) {
    EntityManager entityManager = getEntityManager();
    
    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<AuthSource> criteria = criteriaBuilder.createQuery(AuthSource.class);
    Root<AuthSource> root = criteria.from(AuthSource.class);
    criteria.select(root);
    criteria.where(
      criteriaBuilder.equal(root.get(AuthSource_.strategy), strategy)
    );

    return getSingleResult(entityManager.createQuery(criteria)); 
  }
472481
function Strategy(options, verify) {
  ['domain',
    'clientID',
    'clientSecret',
    'callbackURL'].forEach(function (k) {
    if(!options[k]){
      throw new Error('You must provide the ' + k + ' configuration value to use passport-auth0.');
    }
  });


  this.options = xtend({}, options, {
    authorizationURL: 'https://' + options.domain + '/authorize',
    tokenURL:         'https://' + options.domain + '/oauth/token',
    userInfoURL:      'https://' + options.domain + '/userinfo',
    apiUrl:           'https://' + options.domain + '/api'
  });

  if (this.options.state === undefined) {
    this.options.state = true;
  }

  this._base = Object.getPrototypeOf(Strategy.prototype);
  this._base.constructor.call(this, this.options, verify);

  this.name = 'auth0';
}
1049786
public static boolean isField(Schema schema, PartitionStrategy strategy,
                                String name) {
    Schema.Field field = schema.getField(name);
    return ((field != null) ||
        (strategy != null && Accessor.getDefault().hasPartitioner(strategy, name)));
  }