当前位置: 首页>>代码示例>>Java>>正文


Java BeanDefinitionRegistryPostProcessor类代码示例

本文整理汇总了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);
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:20,代码来源:SingletonTests.java

示例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);
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:11,代码来源:AbstractDelegatedExecutionApplicationContext.java

示例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);
                    });
        }
    };
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml-samples,代码行数:29,代码来源:FilterCleanupConfig.java

示例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


注:本文中的org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。