本文整理匯總了Java中org.springframework.beans.factory.ObjectProvider.getIfAvailable方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectProvider.getIfAvailable方法的具體用法?Java ObjectProvider.getIfAvailable怎麽用?Java ObjectProvider.getIfAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.beans.factory.ObjectProvider
的用法示例。
在下文中一共展示了ObjectProvider.getIfAvailable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: compositeMeterRegistry
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
@Bean
@ConditionalOnMissingBean(MeterRegistry.class)
public CompositeMeterRegistry compositeMeterRegistry(
MetricsProperties config,
ObjectProvider<List<MeterRegistryConfigurer>> configurers,
ObjectProvider<Collection<MetricsExporter>> exportersProvider) {
CompositeMeterRegistry composite =
config.isUseGlobalRegistry() ? Metrics.globalRegistry : new CompositeMeterRegistry();
if (exportersProvider.getIfAvailable() != null) {
exportersProvider.getIfAvailable().forEach(exporter -> {
final MeterRegistry childRegistry = exporter.registry();
if (composite == childRegistry) {
throw new IllegalStateException("cannot add a CompositeMeterRegistry to itself");
}
composite.add(childRegistry);
});
}
if (configurers.getIfAvailable() != null) {
configurers.getIfAvailable().forEach(conf -> conf.configureRegistry(composite));
}
return composite;
}
示例2: DslContextConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public DslContextConfiguration(JooqProperties properties,
ConnectionProvider connectionProvider,
ObjectProvider<TransactionProvider> transactionProviderProvider,
ObjectProvider<RecordMapperProvider> recordMapperProviderProvider,
ObjectProvider<Settings> settingsProvider,
ObjectProvider<RecordListenerProvider[]> recordListenerProvidersProvider,
ExecuteListenerProvider[] executeListenerProviders,
ObjectProvider<VisitListenerProvider[]> visitListenerProvidersProvider) {
this.properties = properties;
this.connectionProvider = connectionProvider;
this.transactionProvider = transactionProviderProvider.getIfAvailable();
this.recordMapperProvider = recordMapperProviderProvider.getIfAvailable();
this.settings = settingsProvider.getIfAvailable();
this.recordListenerProviders = recordListenerProvidersProvider
.getIfAvailable();
this.executeListenerProviders = executeListenerProviders;
this.visitListenerProviders = visitListenerProvidersProvider.getIfAvailable();
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:19,代碼來源:JooqAutoConfiguration.java
示例3: MybatisPlusAutoConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public MybatisPlusAutoConfiguration(MybatisPlusProperties properties,
ObjectProvider<Interceptor[]> interceptorsProvider,
ResourceLoader resourceLoader,
ObjectProvider<DatabaseIdProvider> databaseIdProvider,
ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider) {
this.properties = properties;
this.interceptors = interceptorsProvider.getIfAvailable();
this.resourceLoader = resourceLoader;
this.databaseIdProvider = databaseIdProvider.getIfAvailable();
this.configurationCustomizers = configurationCustomizersProvider.getIfAvailable();
}
示例4: SocialTokenServicesConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public SocialTokenServicesConfiguration(ResourceServerProperties sso,
ObjectProvider<OAuth2ConnectionFactory<?>> connectionFactory,
UserInfoRestTemplateFactory restTemplateFactory,
ObjectProvider<AuthoritiesExtractor> authoritiesExtractor,
ObjectProvider<PrincipalExtractor> principalExtractor) {
this.sso = sso;
this.connectionFactory = connectionFactory.getIfAvailable();
this.restTemplate = restTemplateFactory.getUserInfoRestTemplate();
this.authoritiesExtractor = authoritiesExtractor.getIfAvailable();
this.principalExtractor = principalExtractor.getIfAvailable();
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:12,代碼來源:ResourceServerTokenServicesConfiguration.java
示例5: UserInfoTokenServicesConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public UserInfoTokenServicesConfiguration(ResourceServerProperties sso,
UserInfoRestTemplateFactory restTemplateFactory,
ObjectProvider<AuthoritiesExtractor> authoritiesExtractor,
ObjectProvider<PrincipalExtractor> principalExtractor) {
this.sso = sso;
this.restTemplate = restTemplateFactory.getUserInfoRestTemplate();
this.authoritiesExtractor = authoritiesExtractor.getIfAvailable();
this.principalExtractor = principalExtractor.getIfAvailable();
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:10,代碼來源:ResourceServerTokenServicesConfiguration.java
示例6: JwtTokenServicesConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public JwtTokenServicesConfiguration(ResourceServerProperties resource,
ObjectProvider<List<JwtAccessTokenConverterConfigurer>> configurers,
ObjectProvider<List<JwtAccessTokenConverterRestTemplateCustomizer>> customizers) {
this.resource = resource;
this.configurers = configurers.getIfAvailable();
this.customizers = customizers.getIfAvailable();
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:8,代碼來源:ResourceServerTokenServicesConfiguration.java
示例7: DefaultUserInfoRestTemplateFactory
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public DefaultUserInfoRestTemplateFactory(
ObjectProvider<List<UserInfoRestTemplateCustomizer>> customizers,
ObjectProvider<OAuth2ProtectedResourceDetails> details,
ObjectProvider<OAuth2ClientContext> oauth2ClientContext) {
this.customizers = customizers.getIfAvailable();
this.details = details.getIfAvailable();
this.oauth2ClientContext = oauth2ClientContext.getIfAvailable();
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:9,代碼來源:DefaultUserInfoRestTemplateFactory.java
示例8: OAuth2AuthorizationServerConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public OAuth2AuthorizationServerConfiguration(BaseClientDetails details,
AuthenticationConfiguration authenticationConfiguration,
ObjectProvider<TokenStore> tokenStore,
ObjectProvider<AccessTokenConverter> tokenConverter,
AuthorizationServerProperties properties) throws Exception {
this.details = details;
this.authenticationManager = authenticationConfiguration.getAuthenticationManager();
this.tokenStore = tokenStore.getIfAvailable();
this.tokenConverter = tokenConverter.getIfAvailable();
this.properties = properties;
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:12,代碼來源:OAuth2AuthorizationServerConfiguration.java
示例9: MeterRegistryConfigurationSupport
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
MeterRegistryConfigurationSupport(MeterRegistry registry,
MetricsProperties config,
ObjectProvider<Collection<MeterBinder>> binders) {
if (binders.getIfAvailable() != null) {
binders.getIfAvailable().forEach(binder -> binder.bindTo(registry));
}
if (config.isUseGlobalRegistry() && registry != Metrics.globalRegistry) {
Metrics.addRegistry(registry);
}
}
示例10: DocumentDBAutoConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public DocumentDBAutoConfiguration(DocumentDBProperties properties,
ObjectProvider<ConnectionPolicy> connectionPolicyObjectProvider,
ApplicationContext applicationContext) {
this.properties = properties;
this.connectionPolicy = connectionPolicyObjectProvider.getIfAvailable();
this.applicationContext = applicationContext;
}
示例11: MyBatisMigrationsConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public MyBatisMigrationsConfiguration(MyBatisMigrationsProperties properties,
ObjectProvider<DataSource> dataSource,
@MyBatisMigrationsDataSource ObjectProvider<DataSource> myBatisMigrationsDataSource,
ResourcePatternResolver resourceResolver) {
this.properties = properties;
this.resourceResolver = resourceResolver;
this.dataSource = dataSource.getIfUnique();
this.myBatisMigrationsDataSource = myBatisMigrationsDataSource.getIfAvailable();
}
開發者ID:Bessonov,項目名稱:mybatis-migrations-spring-boot-autoconfigure,代碼行數:11,代碼來源:MyBatisMigrationsAutoConfiguration.java
示例12: MapperAutoConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public MapperAutoConfiguration(MybatisProperties properties,
ObjectProvider<Interceptor[]> interceptorsProvider,
ResourceLoader resourceLoader,
ObjectProvider<DatabaseIdProvider> databaseIdProvider,
ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider) {
this.properties = properties;
this.interceptors = interceptorsProvider.getIfAvailable();
this.resourceLoader = resourceLoader;
this.databaseIdProvider = databaseIdProvider.getIfAvailable();
this.configurationCustomizers = configurationCustomizersProvider.getIfAvailable();
}
示例13: CaffeineCacheConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
CaffeineCacheConfiguration(CacheProperties cacheProperties,
CacheManagerCustomizers customizers,
ObjectProvider<Caffeine<Object, Object>> caffeineProvider,
ObjectProvider<CaffeineSpec> caffeineSpecProvider,
ObjectProvider<CacheLoader<Object, Object>> cacheLoaderProvider) {
this.cacheProperties = cacheProperties;
this.customizers = customizers;
this.caffeine = caffeineProvider.getIfAvailable();
this.caffeineSpec = caffeineSpecProvider.getIfAvailable();
this.cacheLoader = cacheLoaderProvider.getIfAvailable();
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:CaffeineCacheConfiguration.java
示例14: OAuth2AuthorizationServerConfiguration
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
public OAuth2AuthorizationServerConfiguration(BaseClientDetails details,
AuthenticationManager authenticationManager,
ObjectProvider<TokenStore> tokenStoreProvider,
AuthorizationServerProperties properties) {
this.details = details;
this.authenticationManager = authenticationManager;
this.tokenStore = tokenStoreProvider.getIfAvailable();
this.properties = properties;
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:OAuth2AuthorizationServerConfiguration.java
示例15: restDocumentationConfigurer
import org.springframework.beans.factory.ObjectProvider; //導入方法依賴的package包/類
@Bean
@ConfigurationProperties("spring.test.restdocs")
public RestDocsMockMvcBuilderCustomizer restDocumentationConfigurer(
MockMvcRestDocumentationConfigurer configurer,
ObjectProvider<RestDocumentationResultHandler> resultHandler) {
return new RestDocsMockMvcBuilderCustomizer(configurer,
resultHandler.getIfAvailable());
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:RestDocsAutoConfiguration.java