本文整理汇总了Java中org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor类的典型用法代码示例。如果您正苦于以下问题:Java BeanDefinitionRegistryPostProcessor类的具体用法?Java BeanDefinitionRegistryPostProcessor怎么用?Java BeanDefinitionRegistryPostProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeanDefinitionRegistryPostProcessor类属于org.springframework.beans.factory.support包,在下文中一共展示了BeanDefinitionRegistryPostProcessor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processor
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; //导入依赖的package包/类
@Bean
public static BeanDefinitionRegistryPostProcessor processor() {
return new BeanDefinitionRegistryPostProcessor() {
@Override
public void postProcessBeanFactory(
ConfigurableListableBeanFactory beanFactory)
throws BeansException {
}
@Override
public void postProcessBeanDefinitionRegistry(
BeanDefinitionRegistry registry) throws BeansException {
// Simulates what happens when you add a compiled function
RootBeanDefinition beanDefinition = new RootBeanDefinition(MySupplier.class);
registry.registerBeanDefinition("words", beanDefinition);
}
};
}
示例2: invokeBeanDefinitionRegistryPostProcessors
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; //导入依赖的package包/类
/**
* Invoke the given BeanDefinitionRegistryPostProcessor beans.
*/
private static void invokeBeanDefinitionRegistryPostProcessors(
Collection<? extends BeanDefinitionRegistryPostProcessor> postProcessors, BeanDefinitionRegistry registry) {
for (BeanDefinitionRegistryPostProcessor postProcessor : postProcessors) {
postProcessor.postProcessBeanDefinitionRegistry(registry);
}
}
示例3: removeUnwantedAutomaticFilterRegistration
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; //导入依赖的package包/类
@Bean
public static BeanDefinitionRegistryPostProcessor removeUnwantedAutomaticFilterRegistration() {
return new BeanDefinitionRegistryPostProcessor() {
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException {
DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) bf;
Set<String> filtersToDisable = ImmutableSet.of("samlEntryPoint", "samlFilter", "samlIDPDiscovery", "metadataDisplayFilter",
"samlWebSSOHoKProcessingFilter", "samlWebSSOProcessingFilter",
"samlLogoutProcessingFilter", "samlLogoutFilter", "metadataGeneratorFilter");
Arrays.stream(beanFactory.getBeanNamesForType(javax.servlet.Filter.class))
.filter(filtersToDisable::contains)
.forEach(name -> {
BeanDefinition definition = BeanDefinitionBuilder
.genericBeanDefinition(FilterRegistrationBean.class)
.setScope(BeanDefinition.SCOPE_SINGLETON)
.addConstructorArgReference(name)
.addConstructorArgValue(new ServletRegistrationBean[]{})
.addPropertyValue("enabled", false)
.getBeanDefinition();
beanFactory.registerBeanDefinition(name + "FilterRegistrationBean", definition);
});
}
};
}
示例4: setDependsOn
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; //导入依赖的package包/类
/**
* @param dependsOn
* the dependsOn to set
*/
public void setDependsOn(final List<BeanDefinitionRegistryPostProcessor> dependsOn)
{
this.dependsOn = dependsOn;
}
开发者ID:Acosix,项目名称:alfresco-simple-content-stores,代码行数:9,代码来源:SimpleContentStoresBeanDefinitionEmitter.java