Java Code Examples for org.springframework.beans.factory.support.BeanDefinitionRegistry

Following code examples demonstrate how to use org.springframework.beans.factory.support.BeanDefinitionRegistry from spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.beans.factory.support.BeanDefinitionRegistry and various code implementation of this class.
Example 1
Project : spring-framework Source File : HttpPostScannerConfigurer.java View Source Code on GitHub

	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {

		HttpPostApiScanner scanner = new HttpPostApiScanner(registry);

		scanner.addIncludeFilter(new AnnotationTypeFilter(HttpPostApi.class));

		scanner.scan(StringUtils.tokenizeToStringArray(this.basePackages,
				ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS));

	
	}
			
Example 2
Project : spring-framework Source File : GemfireFunctionBeanPostProcessorRegistrar.java View Source Code on GitHub

	public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

		BeanDefinitionBuilder builder =
			BeanDefinitionBuilder.genericBeanDefinition(GemfireFunctionBeanPostProcessor.class);

		BeanDefinitionReaderUtils.registerWithGeneratedName(builder.getBeanDefinition(), registry);
	}
			
Example 3
Project : spring-framework Source File : MarklogicRepositoryConfigurationExtension.java View Source Code on GitHub

    public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource) {
        super.registerBeansForRoot(registry, configurationSource);

        if (!registry.containsBeanDefinition(BeanNames.MAPPING_CONTEXT_BEAN_NAME)) {
            RootBeanDefinition definition = new RootBeanDefinition(MarklogicMappingContext.class);
            definition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
            definition.setSource(configurationSource.getSource());

            registry.registerBeanDefinition(BeanNames.MAPPING_CONTEXT_BEAN_NAME, definition);
        }
    }
			
Example 4
Project : spring-framework Source File : AbstractBeanDefinitionParser.java View Source Code on GitHub

    }

    protected void registerBeanDefinition(BeanDefinitionRegistry registry,
                                          BeanDefinition definition,
                                          String beanName, String... aliases) {
        registerBeanDefinition(new BeanDefinitionHolder(definition, beanName, aliases), registry);
    }
			
Example 5
Project : spring-framework Source File : ServerBasedFunctionExecutionBeanDefinitionBuilder.java View Source Code on GitHub

	protected BeanDefinitionBuilder getGemfireFunctionOperationsBeanDefinitionBuilder(BeanDefinitionRegistry registry) {

		String resolvedCacheBeanName = Optional.ofNullable(this.configuration.getAttribute("cache"))
			.map(String::valueOf)
			.filter(StringUtils::hasText)
			.orElse(GemfireConstants.DEFAULT_GEMFIRE_CACHE_NAME);

		Optional<String> poolBeanName = Optional.ofNullable(this.configuration.getAttribute("pool"))
			.map(String::valueOf)
			.filter(StringUtils::hasText);

		BeanDefinitionBuilder functionTemplateBuilder =
			BeanDefinitionBuilder.genericBeanDefinition(getGemfireFunctionOperationsClass());

		functionTemplateBuilder.addConstructorArgReference(resolvedCacheBeanName);

		poolBeanName.ifPresent(it -> {
			functionTemplateBuilder.addDependsOn(it);
			functionTemplateBuilder.addPropertyReference("pool", it);
		});

		return functionTemplateBuilder;
	}
			
Example 6
Project : spring-framework Source File : UserAttributeLoaderGenerator.java View Source Code on GitHub

	public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
		String className = definition.getBeanClassName();
		String beanName = ClassUtils.getShortName(className);

		try {
			Class<?> clazz = Class.forName(className);
			if (clazz.isInstance(UserAttributeLoader.class)) {
				UserAttributeLoaderManager.addLoader(beanName);
				return beanName;
			}
		} catch (ClassNotFoundException e) {
		}
		return className;
	}
			
Example 7
Project : spring-framework Source File : HotConfigurablePropertiesBeanDefinitionRegistrar.java View Source Code on GitHub

    public final void registerBeanDefinitions(final AnnotationMetadata importingClassMetadata, final BeanDefinitionRegistry registry) {
        
        final GenericBeanDefinition beanDefConfProps = new GenericBeanDefinition();
        beanDefConfProps.setBeanClass(HotConfigurableProperties.class);
        registry.registerBeanDefinition("configurableProperties", beanDefConfProps);

        final GenericBeanDefinition beanDefConfHooks = new GenericBeanDefinition();
        beanDefConfHooks.setBeanClass(HotConfigurableHooks.class);
        registry.registerBeanDefinition("configurableHooks", beanDefConfHooks);

        final GenericBeanDefinition beanDefPropBeanProcessor = new GenericBeanDefinition();
        beanDefPropBeanProcessor.setBeanClass(HotConfigurablePropertyBeanProcessor.class);
        registry.registerBeanDefinition("configurablePropertyBeanProcessor", beanDefPropBeanProcessor);
    }
			
Example 8
Project : spring-framework Source File : BeanNameGeneratorUtils.java View Source Code on GitHub

	public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
        String beanName = super.generateBeanName(definition, registry);
        if (!beanName.endsWith("Impl")) {
            return beanName;
        }
        return beanName.substring(0, beanName.length() - 4);
    }