本文整理匯總了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