use of org.springframework.boot.autoconfigure.condition.ConditionalOnBean in project spring-boot by spring-projects.
the class SecurityFilterAutoConfiguration method securityFilterChainRegistration.
@Bean
@ConditionalOnBean(name = DEFAULT_FILTER_NAME)
public DelegatingFilterProxyRegistrationBean securityFilterChainRegistration(SecurityProperties securityProperties) {
DelegatingFilterProxyRegistrationBean registration = new DelegatingFilterProxyRegistrationBean(DEFAULT_FILTER_NAME);
registration.setOrder(securityProperties.getFilterOrder());
registration.setDispatcherTypes(getDispatcherTypes(securityProperties));
return registration;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnBean in project spring-boot by spring-projects.
the class BatchAutoConfiguration method jobExplorer.
@Bean
@ConditionalOnMissingBean
@ConditionalOnBean(DataSource.class)
public JobExplorer jobExplorer(DataSource dataSource) throws Exception {
JobExplorerFactoryBean factory = new JobExplorerFactoryBean();
factory.setDataSource(dataSource);
String tablePrefix = this.properties.getTablePrefix();
if (StringUtils.hasText(tablePrefix)) {
factory.setTablePrefix(tablePrefix);
}
factory.afterPropertiesSet();
return factory.getObject();
}
Aggregations