Insert a provider into Security at the provided slot number.

@param newProvider
@param slot
513440
public static void insertProviderAt(Provider newProvider, int slot) {
        Provider[] provider_list = Security.getProviders();
        if (null == provider_list || 0 == provider_list.length) {
            return;
        }

        // add the new provider to the new list at the correct slot #.
        Provider[] newList = new Provider[provider_list.length + 2];
        newList[slot] = newProvider;

        int newListIndex = 1;
        // add the rest of the providers
        for (int i = 0; i < provider_list.length; i++) {
            Provider currentProvider = provider_list[i];

            if (currentProvider != null && !currentProvider.getName().equals(newProvider.getName())) {
                // keep incrementing until we find the first available slot.
                while (newList[newListIndex] != null) {
                    newListIndex++;
                }

                newList[newListIndex] = currentProvider;
                newListIndex++;
            }
        }

        removeAllProviders();

        // add the rest of the providers to the list.
        for (int i = 0; i < newList.length; i++) {
            Provider currentProvider = newList[i];

            if (currentProvider != null) {
                int position = Security.insertProviderAt(currentProvider, (i + 1));
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, currentProvider.getName() + " provider added at position " + position);
            }
        }
    }
1311195
public <T extends InvocationMarshaller<?>> T registerProvider (
        InvocationProvider provider, Class<T> mclass)
    {
        return registerProvider(provider, mclass, null);
    }
1306854
function initialize (provider, configuration) {
  configuration.profile = true
  configuration.passReqToCallback = true

  return new OpenIDStrategy(configuration, verifier)
}
454352
public static ServiceProvider init(ServiceProvider serviceProvider) {
        Objects.requireNonNull(serviceProvider);
        synchronized (LOCK) {
            if (Objects.isNull(Bootstrap.serviceProviderDelegate)) {
                Bootstrap.serviceProviderDelegate = serviceProvider;
                Logger.getLogger(Bootstrap.class.getName())
                        .info("Money Bootstrap: new ServiceProvider set: " + serviceProvider.getClass().getName());
                return null;
            } else {
                ServiceProvider prevProvider = Bootstrap.serviceProviderDelegate;
                Bootstrap.serviceProviderDelegate = serviceProvider;
                Logger.getLogger(Bootstrap.class.getName())
                        .warning("Money Bootstrap: ServiceProvider replaced: " + serviceProvider.getClass().getName());
                return prevProvider;
            }
        }
    }
555070
public void setProvider(String provider)
    {
        if (provider != null && provider.endsWith(".class"))
        {
            this.provider = provider.substring(0, provider.length() - 6);
        }
        this.provider = provider;
    }
384372
<T> InternalProviderImpl<T> toProvider(Binding<T> binding) {
    if (binding == null) {
      throw new IllegalStateException("null binding are not allowed. Should not happen unless getBindingSet is overridden.");
    }
    ConfigurationHolder.configuration.checkIllegalBinding(binding, this);

    switch (binding.getMode()) {
      case SIMPLE:
        return createInternalProvider(this,
            binding.getKey(),
            false,
            binding.isCreatingInstancesInScope(),
            binding.isCreatingSingletonInScope(),
            false);
      case CLASS:
        return createInternalProvider(this,
            binding.getImplementationClass(),
            false,
            binding.isCreatingInstancesInScope(),
            binding.isCreatingSingletonInScope(),
            false);
      case INSTANCE:
        return new InternalProviderImpl<>(binding.getInstance());
      case PROVIDER_INSTANCE:
        // to ensure providers do not have to deal with concurrency, we wrap them in a thread safe provider
        // We do not need to pass the scope here because the provider won't use any scope to create the instance
        return new InternalProviderImpl<>(binding.getProviderInstance(), binding.isProvidingSingletonInScope());
      case PROVIDER_CLASS:
        return createInternalProvider(this,
            binding.getProviderClass(),
            true,
            binding.isCreatingInstancesInScope(),
            binding.isCreatingSingletonInScope(),
            binding.isProvidingSingletonInScope());
      //JACOCO:OFF
      default:
        throw new IllegalStateException(format("mode is not handled: %s. This should not happen.", binding.getMode()));
        //JACOCO:ON
    }
  }
1185853
void launchAddServiceProviderDialog(final String federation) {
        ComboBoxItem securityDomains = new ComboBoxItem("security-domain", "Security Domain");
        securityDomains.setRequired(true);
        securityDomains.setValueMap(this.securityDomains);

        DefaultWindow dialog = new DefaultWindow(Console.MESSAGES.newTitle("Service Provider"));
        ResourceDescription resourceDescription = descriptionRegistry.lookup(SERVICE_PROVIDER_TEMPLATE);
        //noinspection Duplicates
        AddResourceDialog addDialog = new AddResourceDialog(securityContext, resourceDescription,
                new AddResourceDialog.Callback() {
                    @Override
                    public void onAdd(ModelNode payload) {
                        dialog.hide();

                        String name = payload.get("name").asString();
                        ResourceAddress address = SERVICE_PROVIDER_TEMPLATE.resolve(statementContext, federation, name);
                        payload.get(OP).set(ADD);
                        payload.get(ADDRESS).set(address);
                        dispatcher.execute(new DMRAction(payload), new SimpleCallback<DMRResponse>() {
                            @Override
                            public void onFailure(Throwable caught) {
                                super.onFailure(caught);
                                readServiceProvider(federation);
                            }

                            @Override
                            public void onSuccess(DMRResponse dmrResponse) {
                                Console.info(Console.MESSAGES.successfullyAdded((name)));
                                readServiceProvider(federation);
                            }
                        });
                    }

                    @Override
                    public void onCancel() {
                        dialog.hide();
                    }
                })
                .addFactory("security-domain", attributeDescription -> securityDomains)
                .include();

        dialog.setWidth(640);
        dialog.setHeight(480);
        dialog.setWidget(addDialog);
        dialog.setGlassEnabled(true);
        dialog.center();
    }
931072
function Provider(id, secret) {
  if (!(this instanceof Provider)) {
    return new Provider(id, secret);
  }

  this.client = new AWS.SQS({
    accessKeyId: id,
    secretAccessKey: secret,
    region: 'us-east-1'
  });

  this.queues = {};
}
304147
@SuppressWarnings("unchecked")
	public <T> RestBuilder addProvider(Class<? extends ContextProvider<T>> provider) {

		Assert.notNull(provider, "Missing context provider!");
		registeredProviders.put(null, provider);
		return this;
	}
765946
public void setProvider(com.google.api.ads.admanager.axis.v201811.GrpProvider provider) {
        this.provider = provider;
    }
669311
public function addProvider($provider) {
        $this->validateProvider($provider);

        if (is_object($provider)) {
            $class = get_class($provider);
            $instance = $provider;
        } else {
            $class = $provider;
            $instance = null;
        }

        if ( ! array_has($this->providers, $class)) {
            $this->providers[$class] = [
                'instance' => $instance,
                'tags' => [],
            ];
        }
    }
1333400
private void addWSAddressingInterceptors(InterceptorProvider provider) {
        MAPAggregator mapAggregator = new MAPAggregator();
        MAPCodec mapCodec = new MAPCodec();

        provider.getInInterceptors().add(mapAggregator);
        provider.getInInterceptors().add(mapCodec);

        provider.getOutInterceptors().add(mapAggregator);
        provider.getOutInterceptors().add(mapCodec);

        provider.getInFaultInterceptors().add(mapAggregator);
        provider.getInFaultInterceptors().add(mapCodec);

        provider.getOutFaultInterceptors().add(mapAggregator);
        provider.getOutFaultInterceptors().add(mapCodec);
    }
651303
public static InjectionProvider<?>[] providersToArray(final Collection<InjectionProvider<?>> providers) {
        return providers == null ? new InjectionProvider<?>[0] : providers
                .toArray(new InjectionProvider<?>[providers.size()]);
    }
501329
@Override
    public void installProvider(boolean clientSide, List<Object> providers, Set<String> features) {
        if (!clientSide) {
            if (getAddCustomExceptionMapperFlag(providers))
            {
                providers.add(new CustomWebApplicationExceptionMapper());
            }
        }

    }
536004
public static void injectWith(InjectionProvider provider) {

		injectionProvider = provider;
		if (injectionProvider != null) {
			log.info("Registered injection provider: " + injectionProvider.getClass().getName());
		}
	}
1296944
public B setProviderNames(List<String> providers) {
        Objects.requireNonNull(providers);
        return set(AbstractQuery.KEY_QUERY_PROVIDERS, providers);
    }
577925
private <T> Provider<T> createProvider(Key<T> key)
  {
    Class<T> type = (Class<T>) key.rawClass();

    if (Provider.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Provider.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderProvider(key, -10, provider(subkey));
    }
    else if (Optional.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Optional.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderOptional(key, -10, provider(subkey));
    }
    else if (type.isInterface() || Modifier.isAbstract(type.getModifiers())) {
      return new ProviderNull(key, -10000, new InjectScopeSingleton());
    }

    int priority = -10;

    // auto-provider is factory
    InjectScope<T> scope = findScope(type);

    BindingAmp<T> binding = new ProviderConstructor<>(this, key, priority, scope, type);

    binding.bind();

    return binding.provider();
  }