Source:
static ResourceDefinition getProviderHttpServerMechanismFactoryDefinition() { AttributeDefinition[] attributes = new AttributeDefinition[] { PROVIDERS }; AbstractAddStepHandler add = new TrivialAddHandler<HttpServerAuthenticationMechanismFactory>(HttpServerAuthenticationMechanismFactory.class, attributes, HTTP_SERVER_MECHANISM_FACTORY_RUNTIME_CAPABILITY) { @Override protected ValueSupplier<HttpServerAuthenticationMechanismFactory> getValueSupplier( ServiceBuilder<HttpServerAuthenticationMechanismFactory> serviceBuilder, OperationContext context, ModelNode model) throws OperationFailedException { String providers = PROVIDERS.resolveModelAttribute(context, model).asStringOrNull(); final Supplier<Provider[]> providerSupplier; if (providers != null) { final InjectedValue<Provider[]> providersInjector = new InjectedValue<Provider[]>(); serviceBuilder.addDependency(context.getCapabilityServiceName( buildDynamicCapabilityName(PROVIDERS_CAPABILITY, providers), Provider[].class), Provider[].class, providersInjector); providerSupplier = providersInjector::getValue; } else { providerSupplier = Security::getProviders; } Predicate<Provider.Service> serviceFilter = (Provider.Service s) -> HttpServerAuthenticationMechanismFactory.class.getSimpleName().equals(s.getType()); return () -> { if ( org.wildfly.security.util.ProviderUtil.findProviderService(providerSupplier, serviceFilter) == null ) { throw ROOT_LOGGER.noSuitableProvider(HttpServerAuthenticationMechanismFactory.class.getSimpleName()); } return new SetMechanismInformationMechanismFactory(new SecurityProviderServerMechanismFactory(providerSupplier)); }; } }; return wrapFactory(new TrivialResourceDefinition(ElytronDescriptionConstants.PROVIDER_HTTP_SERVER_MECHANISM_FACTORY, add, attributes, HTTP_SERVER_MECHANISM_FACTORY_RUNTIME_CAPABILITY)); }

Target:
static ResourceDefinition getProviderHttpServerMechanismFactoryDefinition() { AttributeDefinition[] attributes = new AttributeDefinition[] { PROVIDERS }; AbstractAddStepHandler add = new TrivialAddHandler<HttpServerAuthenticationMechanismFactory>(HttpServerAuthenticationMechanismFactory.class, attributes, HTTP_SERVER_MECHANISM_FACTORY_RUNTIME_CAPABILITY) { @Override protected ValueSupplier<HttpServerAuthenticationMechanismFactory> getValueSupplier( ServiceBuilder<HttpServerAuthenticationMechanismFactory> serviceBuilder, OperationContext context, ModelNode model) throws OperationFailedException { String providers = PROVIDERS.resolveModelAttribute(context, model).asStringOrNull(); final Supplier<Provider[]> providerSupplier; if (providers != null) { final InjectedValue<Provider[]> providersInjector = new InjectedValue<Provider[]>(); serviceBuilder.addDependency(context.getCapabilityServiceName( buildDynamicCapabilityName(PROVIDERS_CAPABILITY, providers), Provider[].class), Provider[].class, providersInjector); providerSupplier = providersInjector::getValue; } else { providerSupplier = Security::getProviders; } Predicate<Provider.Service> serviceFilter = (Provider.Service s) -> HttpServerAuthenticationMechanismFactory.class.getSimpleName().equals(s.getType()); return () -> { if ( findProviderService(providerSupplier, serviceFilter) == null ) { throw ROOT_LOGGER.noSuitableProvider(HttpServerAuthenticationMechanismFactory.class.getSimpleName()); } return new SetMechanismInformationMechanismFactory(new SecurityProviderServerMechanismFactory(providerSupplier)); }; } }; return wrapFactory(new TrivialResourceDefinition(ElytronDescriptionConstants.PROVIDER_HTTP_SERVER_MECHANISM_FACTORY, add, attributes, HTTP_SERVER_MECHANISM_FACTORY_RUNTIME_CAPABILITY)); }