當前位置: 首頁>>代碼示例>>Java>>正文


Java GenericBeanDefinition.setRole方法代碼示例

本文整理匯總了Java中org.springframework.beans.factory.support.GenericBeanDefinition.setRole方法的典型用法代碼示例。如果您正苦於以下問題:Java GenericBeanDefinition.setRole方法的具體用法?Java GenericBeanDefinition.setRole怎麽用?Java GenericBeanDefinition.setRole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.beans.factory.support.GenericBeanDefinition的用法示例。


在下文中一共展示了GenericBeanDefinition.setRole方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createObjectMapperFactoryDefinition

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private GenericBeanDefinition createObjectMapperFactoryDefinition(Object source) {
	GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
	beanDefinition.setBeanClass(Jackson2ObjectMapperFactoryBean.class);
	beanDefinition.setSource(source);
	beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	return beanDefinition;
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:8,代碼來源:AnnotationDrivenBeanDefinitionParser.java

示例2: registerMessageConverter

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private RuntimeBeanReference registerMessageConverter(Element element, ParserContext context, Object source) {
	Element convertersElement = DomUtils.getChildElementByTagName(element, "message-converters");
	ManagedList<? super Object> converters = new ManagedList<Object>();
	if (convertersElement != null) {
		converters.setSource(source);
		for (Element beanElement : DomUtils.getChildElementsByTagName(convertersElement, "bean", "ref")) {
			Object object = context.getDelegate().parsePropertySubElement(beanElement, null);
			converters.add(object);
		}
	}
	if (convertersElement == null || Boolean.valueOf(convertersElement.getAttribute("register-defaults"))) {
		converters.setSource(source);
		converters.add(new RootBeanDefinition(StringMessageConverter.class));
		converters.add(new RootBeanDefinition(ByteArrayMessageConverter.class));
		if (jackson2Present) {
			RootBeanDefinition jacksonConverterDef = new RootBeanDefinition(MappingJackson2MessageConverter.class);
			RootBeanDefinition resolverDef = new RootBeanDefinition(DefaultContentTypeResolver.class);
			resolverDef.getPropertyValues().add("defaultMimeType", MimeTypeUtils.APPLICATION_JSON);
			jacksonConverterDef.getPropertyValues().add("contentTypeResolver", resolverDef);
			// Use Jackson factory in order to have JSR-310 and Joda-Time modules registered automatically
			GenericBeanDefinition jacksonFactoryDef = new GenericBeanDefinition();
			jacksonFactoryDef.setBeanClass(Jackson2ObjectMapperFactoryBean.class);
			jacksonFactoryDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
			jacksonFactoryDef.setSource(source);
			jacksonConverterDef.getPropertyValues().add("objectMapper", jacksonFactoryDef);
			converters.add(jacksonConverterDef);
		}
	}
	ConstructorArgumentValues cavs = new ConstructorArgumentValues();
	cavs.addIndexedArgumentValue(0, converters);
	RootBeanDefinition messageConverterDef = new RootBeanDefinition(CompositeMessageConverter.class, cavs, null);
	return new RuntimeBeanReference(registerBeanDef(messageConverterDef, context, source));
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:34,代碼來源:MessageBrokerBeanDefinitionParser.java

示例3: addPostProcessor

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private void addPostProcessor(BeanDefinitionRegistry registry, Set<String> packagesToScan) {
    GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
    beanDefinition.setBeanClass(ServletComponentRegisteringPostProcessor.class);
    beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(packagesToScan);
    beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
    registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
}
 
開發者ID:PebbleTemplates,項目名稱:pebble-spring-boot-starter,代碼行數:8,代碼來源:ServletComponentScanRegistrar.java

示例4: addPostProcessor

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private void addPostProcessor(BeanDefinitionRegistry registry,
		Set<String> packagesToScan) {
	GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
	beanDefinition.setBeanClass(ServletComponentRegisteringPostProcessor.class);
	beanDefinition.getConstructorArgumentValues()
			.addGenericArgumentValue(packagesToScan);
	beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:ServletComponentScanRegistrar.java

示例5: addEntityScanBeanPostProcessor

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private void addEntityScanBeanPostProcessor(BeanDefinitionRegistry registry,
		Set<String> packagesToScan) {
	GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
	beanDefinition.setBeanClass(EntityScanBeanPostProcessor.class);
	beanDefinition.getConstructorArgumentValues()
			.addGenericArgumentValue(toArray(packagesToScan));
	beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	// We don't need this one to be post processed otherwise it can cause a
	// cascade of bean instantiation that we would rather avoid.
	beanDefinition.setSynthetic(true);
	registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:13,代碼來源:EntityScanRegistrar.java

示例6: registerBeanDefinitions

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
		BeanDefinitionRegistry registry) {
	if (!registry.containsBeanDefinition(BEAN_NAME)) {
		GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
		beanDefinition.setBeanClass(DataSourceInitializerPostProcessor.class);
		beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		// We don't need this one to be post processed otherwise it can cause a
		// cascade of bean instantiation that we would rather avoid.
		beanDefinition.setSynthetic(true);
		registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
	}
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:14,代碼來源:DataSourceInitializerPostProcessor.java

示例7: registerBeanDefinitions

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
		BeanDefinitionRegistry registry) {
	if (!registry.containsBeanDefinition(BEAN_NAME)) {
		GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
		beanDefinition.setBeanClass(DataSourceInitializedPublisher.class);
		beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		// We don't need this one to be post processed otherwise it can cause a
		// cascade of bean instantiation that we would rather avoid.
		beanDefinition.setSynthetic(true);
		registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
	}
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:14,代碼來源:DataSourceInitializedPublisher.java

示例8: addEntityScanBeanPostProcessor

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private void addEntityScanBeanPostProcessor(BeanDefinitionRegistry registry,
		Set<String> packagesToScan) {
	GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
	beanDefinition.setBeanClass(this.beanPostProcessorType);
	beanDefinition.getConstructorArgumentValues()
			.addGenericArgumentValue(toArray(packagesToScan));
	beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	// We don't need this one to be post processed otherwise it can cause a
	// cascade of bean instantiation that we would rather avoid.
	beanDefinition.setSynthetic(true);
	registry.registerBeanDefinition(this.beanPostProcessorName, beanDefinition);
}
 
開發者ID:philwebb,項目名稱:spring-boot-concourse,代碼行數:13,代碼來源:AbstractEntityScanRegistrar.java

示例9: createBeanReferenceDefinition

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
private AbstractBeanDefinition createBeanReferenceDefinition(String beanName) {
	GenericBeanDefinition def = new GenericBeanDefinition();
	def.setBeanClass(BeanReferenceFactoryBean.class);
	def.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	MutablePropertyValues mpv = new MutablePropertyValues();
	mpv.addPropertyValue(TARGET_BEAN_NAME_PROP, beanName);
	def.setPropertyValues(mpv);
	return def;
}
 
開發者ID:BeamFoundry,項目名稱:spring-osgi,代碼行數:10,代碼來源:AbstractReferenceDefinitionParser.java


注:本文中的org.springframework.beans.factory.support.GenericBeanDefinition.setRole方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。