當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。