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


Java RootBeanDefinition.setSource方法代碼示例

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


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

示例1: createAdvisorBeanDefinition

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
/**
 * Create a {@link RootBeanDefinition} for the advisor described in the supplied. Does <strong>not</strong>
 * parse any associated '{@code pointcut}' or '{@code pointcut-ref}' attributes.
 */
private AbstractBeanDefinition createAdvisorBeanDefinition(Element advisorElement, ParserContext parserContext) {
	RootBeanDefinition advisorDefinition = new RootBeanDefinition(DefaultBeanFactoryPointcutAdvisor.class);
	advisorDefinition.setSource(parserContext.extractSource(advisorElement));

	String adviceRef = advisorElement.getAttribute(ADVICE_REF);
	if (!StringUtils.hasText(adviceRef)) {
		parserContext.getReaderContext().error(
				"'advice-ref' attribute contains empty value.", advisorElement, this.parseState.snapshot());
	}
	else {
		advisorDefinition.getPropertyValues().add(
				ADVICE_BEAN_NAME, new RuntimeBeanNameReference(adviceRef));
	}

	if (advisorElement.hasAttribute(ORDER_PROPERTY)) {
		advisorDefinition.getPropertyValues().add(
				ORDER_PROPERTY, advisorElement.getAttribute(ORDER_PROPERTY));
	}

	return advisorDefinition;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:26,代碼來源:ConfigBeanDefinitionParser.java

示例2: registerOrEscalateApcAsRequired

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
private static BeanDefinition registerOrEscalateApcAsRequired(Class<?> cls, BeanDefinitionRegistry registry, Object source) {
	Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
	if (registry.containsBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME)) {
		BeanDefinition apcDefinition = registry.getBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME);
		if (!cls.getName().equals(apcDefinition.getBeanClassName())) {
			int currentPriority = findPriorityForClass(apcDefinition.getBeanClassName());
			int requiredPriority = findPriorityForClass(cls);
			if (currentPriority < requiredPriority) {
				apcDefinition.setBeanClassName(cls.getName());
			}
		}
		return null;
	}
	RootBeanDefinition beanDefinition = new RootBeanDefinition(cls);
	beanDefinition.setSource(source);
	beanDefinition.getPropertyValues().add("order", Ordered.HIGHEST_PRECEDENCE);
	beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	registry.registerBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME, beanDefinition);
	return beanDefinition;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:21,代碼來源:AopConfigUtils.java

示例3: doParse

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
private synchronized void doParse(Element element, ParserContext parserContext) {
    String[] basePackages = StringUtils.tokenizeToStringArray(element.getAttribute("base-package"), ",; \t\n");
    AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(parserContext, element);
    if (!parserContext.getRegistry().containsBeanDefinition(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME)) {
        Object eleSource = parserContext.extractSource(element);

        RootBeanDefinition configMapDef = new RootBeanDefinition(ConcurrentHashMap.class);
        configMapDef.setSource(eleSource);
        configMapDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
        String configMapName = parserContext.getReaderContext().registerWithGeneratedName(configMapDef);

        RootBeanDefinition interceptorDef = new RootBeanDefinition(JetCacheInterceptor.class);
        interceptorDef.setSource(eleSource);
        interceptorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
        interceptorDef.getPropertyValues().addPropertyValue(new PropertyValue("cacheConfigMap", new RuntimeBeanReference(configMapName)));
        String interceptorName = parserContext.getReaderContext().registerWithGeneratedName(interceptorDef);

        RootBeanDefinition advisorDef = new RootBeanDefinition(CacheAdvisor.class);
        advisorDef.setSource(eleSource);
        advisorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
        advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("adviceBeanName", interceptorName));
        advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("cacheConfigMap", new RuntimeBeanReference(configMapName)));
        advisorDef.getPropertyValues().addPropertyValue(new PropertyValue("basePackages", basePackages));
        parserContext.getRegistry().registerBeanDefinition(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME, advisorDef);

        CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(),
                eleSource);
        compositeDef.addNestedComponent(new BeanComponentDefinition(configMapDef, configMapName));
        compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));
        compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, CacheAdvisor.CACHE_ADVISOR_BEAN_NAME));
        parserContext.registerComponent(compositeDef);
    }
}
 
開發者ID:alibaba,項目名稱:jetcache,代碼行數:34,代碼來源:CacheAnnotationParser.java

示例4: registerBeanDefinitions

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
	Assert.notNull(importingClassMetadata, "AnnotationMetadata must not be null!");
	Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");

	// Guard against calls for sub-classes
	//if (importingClassMetadata.getAnnotationAttributes(getAnnotation().getName()) == null) {
	//	return;
	//}

	RootBeanDefinition repositoryInterfacePostProcessor = new RootBeanDefinition(REPOSITORY_INTERFACE_POST_PROCESSOR);
	repositoryInterfacePostProcessor.setSource(importingClassMetadata);
	registry.registerBeanDefinition(REPOSITORY_INTERFACE_POST_PROCESSOR, repositoryInterfacePostProcessor);
	
	BeanDefinition storeServiceBeanDef = createBeanDefinition(ContentStoreServiceImpl.class);
	registry.registerBeanDefinition("contentStoreService", storeServiceBeanDef);

	BeanDefinition annotatedStoreEventHandlerDef = createBeanDefinition(AnnotatedStoreEventInvoker.class);
	registry.registerBeanDefinition("annotatedStoreEventHandler", annotatedStoreEventHandlerDef);

	BeanDefinition renditionServiceBeanDef = createBeanDefinition(RenditionServiceImpl.class);
	registry.registerBeanDefinition("renditionService", renditionServiceBeanDef);

	createOperationsBean(registry);
	
	registerContentStoreBeanDefinitions(importingClassMetadata, registry);
}
 
開發者ID:paulcwarren,項目名稱:spring-content,代碼行數:27,代碼來源:AbstractStoreBeanDefinitionRegistrar.java

示例5: registerUrlProvider

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
private void registerUrlProvider(ParserContext parserContext, Object source) {
	if (!parserContext.getRegistry().containsBeanDefinition(RESOURCE_URL_PROVIDER)) {
		RootBeanDefinition urlProvider = new RootBeanDefinition(ResourceUrlProvider.class);
		urlProvider.setSource(source);
		urlProvider.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		parserContext.getRegistry().registerBeanDefinition(RESOURCE_URL_PROVIDER, urlProvider);
		parserContext.registerComponent(new BeanComponentDefinition(urlProvider, RESOURCE_URL_PROVIDER));

		RootBeanDefinition interceptor = new RootBeanDefinition(ResourceUrlProviderExposingInterceptor.class);
		interceptor.setSource(source);
		interceptor.getConstructorArgumentValues().addIndexedArgumentValue(0, urlProvider);

		RootBeanDefinition mappedInterceptor = new RootBeanDefinition(MappedInterceptor.class);
		mappedInterceptor.setSource(source);
		mappedInterceptor.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		mappedInterceptor.getConstructorArgumentValues().addIndexedArgumentValue(0, (Object) null);
		mappedInterceptor.getConstructorArgumentValues().addIndexedArgumentValue(1, interceptor);
		String mappedInterceptorName = parserContext.getReaderContext().registerWithGeneratedName(mappedInterceptor);
		parserContext.registerComponent(new BeanComponentDefinition(mappedInterceptor, mappedInterceptorName));
	}
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:22,代碼來源:ResourcesBeanDefinitionParser.java

示例6: registerUrlPathHelper

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
/**
 * Adds an alias to an existing well-known name or registers a new instance of a {@link UrlPathHelper}
 * under that well-known name, unless already registered.
 * @return a RuntimeBeanReference to this {@link UrlPathHelper} instance
 */
public static RuntimeBeanReference registerUrlPathHelper(RuntimeBeanReference urlPathHelperRef, ParserContext parserContext, Object source) {
	if (urlPathHelperRef != null) {
		if (parserContext.getRegistry().isAlias(URL_PATH_HELPER_BEAN_NAME)) {
			parserContext.getRegistry().removeAlias(URL_PATH_HELPER_BEAN_NAME);
		}
		parserContext.getRegistry().registerAlias(urlPathHelperRef.getBeanName(), URL_PATH_HELPER_BEAN_NAME);
	}
	else if (!parserContext.getRegistry().isAlias(URL_PATH_HELPER_BEAN_NAME)
			&& !parserContext.getRegistry().containsBeanDefinition(URL_PATH_HELPER_BEAN_NAME)) {
		RootBeanDefinition urlPathHelperDef = new RootBeanDefinition(UrlPathHelper.class);
		urlPathHelperDef.setSource(source);
		urlPathHelperDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		parserContext.getRegistry().registerBeanDefinition(URL_PATH_HELPER_BEAN_NAME, urlPathHelperDef);
		parserContext.registerComponent(new BeanComponentDefinition(urlPathHelperDef, URL_PATH_HELPER_BEAN_NAME));
	}
	return new RuntimeBeanReference(URL_PATH_HELPER_BEAN_NAME);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:23,代碼來源:MvcNamespaceUtils.java

示例7: registerPathMatcher

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
/**
 * Adds an alias to an existing well-known name or registers a new instance of a {@link PathMatcher}
 * under that well-known name, unless already registered.
 * @return a RuntimeBeanReference to this {@link PathMatcher} instance
 */
public static RuntimeBeanReference registerPathMatcher(RuntimeBeanReference pathMatcherRef, ParserContext parserContext, Object source) {
	if (pathMatcherRef != null) {
		if (parserContext.getRegistry().isAlias(PATH_MATCHER_BEAN_NAME)) {
			parserContext.getRegistry().removeAlias(PATH_MATCHER_BEAN_NAME);
		}
		parserContext.getRegistry().registerAlias(pathMatcherRef.getBeanName(), PATH_MATCHER_BEAN_NAME);
	}
	else if (!parserContext.getRegistry().isAlias(PATH_MATCHER_BEAN_NAME)
			&& !parserContext.getRegistry().containsBeanDefinition(PATH_MATCHER_BEAN_NAME)) {
		RootBeanDefinition pathMatcherDef = new RootBeanDefinition(AntPathMatcher.class);
		pathMatcherDef.setSource(source);
		pathMatcherDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		parserContext.getRegistry().registerBeanDefinition(PATH_MATCHER_BEAN_NAME, pathMatcherDef);
		parserContext.registerComponent(new BeanComponentDefinition(pathMatcherDef, PATH_MATCHER_BEAN_NAME));
	}
	return new RuntimeBeanReference(PATH_MATCHER_BEAN_NAME);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:23,代碼來源:MvcNamespaceUtils.java

示例8: getRedirectView

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
private RootBeanDefinition getRedirectView(Element element, HttpStatus status, Object source) {
	RootBeanDefinition redirectView = new RootBeanDefinition(RedirectView.class);
	redirectView.setSource(source);
	redirectView.getConstructorArgumentValues().addIndexedArgumentValue(0, element.getAttribute("redirect-url"));

	if (status != null) {
		redirectView.getPropertyValues().add("statusCode", status);
	}

	if (element.hasAttribute("context-relative")) {
		redirectView.getPropertyValues().add("contextRelative", element.getAttribute("context-relative"));
	}
	else {
		redirectView.getPropertyValues().add("contextRelative", true);
	}

	if (element.hasAttribute("keep-query-params")) {
		redirectView.getPropertyValues().add("propagateQueryParams", element.getAttribute("keep-query-params"));
	}

	return redirectView;
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:23,代碼來源:ViewControllerBeanDefinitionParser.java

示例9: createContentNegotiatingViewResolver

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
private BeanDefinition createContentNegotiatingViewResolver(Element resolverElement, ParserContext context) {
	RootBeanDefinition beanDef = new RootBeanDefinition(ContentNegotiatingViewResolver.class);
	beanDef.setSource(context.extractSource(resolverElement));
	beanDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	MutablePropertyValues values = beanDef.getPropertyValues();

	List<Element> elements = DomUtils.getChildElementsByTagName(resolverElement, new String[] {"default-views"});
	if (!elements.isEmpty()) {
		ManagedList<Object> list = new ManagedList<Object>();
		for (Element element : DomUtils.getChildElementsByTagName(elements.get(0), "bean", "ref")) {
			list.add(context.getDelegate().parsePropertySubElement(element, null));
		}
		values.add("defaultViews", list);
	}
	if (resolverElement.hasAttribute("use-not-acceptable")) {
		values.add("useNotAcceptableStatusCode", resolverElement.getAttribute("use-not-acceptable"));
	}
	Object manager = getContentNegotiationManager(context);
	if (manager != null) {
		values.add("contentNegotiationManager", manager);
	}
	return beanDef;
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:24,代碼來源:ViewResolversBeanDefinitionParser.java

示例10: registerBeansForRoot

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
@Override
public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource config) {
    super.registerBeansForRoot(registry, config);

    if (!registry.containsBeanDefinition("documentDbMappingContext")) {
        final RootBeanDefinition definition = new RootBeanDefinition(DocumentDbMappingContext.class);
        definition.setRole(AbstractBeanDefinition.ROLE_INFRASTRUCTURE);
        definition.setSource(config.getSource());

        registry.registerBeanDefinition("documentDbMappingContext", definition);
    }
}
 
開發者ID:Microsoft,項目名稱:spring-data-documentdb,代碼行數:13,代碼來源:DocumentDbRepositoryConfigurationExtension.java

示例11: registerBeansForRoot

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
@Override
public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource) {
    String tarantolSyncOpsRef = configurationSource.getAttribute("tarantoolSyncOpsRef");
    // register context
    RootBeanDefinition mappingContextDefinition = createTarantoolMappingContext();
    mappingContextDefinition.setSource(configurationSource.getSource());

    registerIfNotAlreadyRegistered(mappingContextDefinition, registry, MAPPING_CONTEXT_BEAN_NAME, configurationSource);

    // Register converter
    RootBeanDefinition redisConverterDefinition = createTarantoolConverterDefinition();
    redisConverterDefinition.setSource(configurationSource.getSource());

    registerIfNotAlreadyRegistered(redisConverterDefinition, registry, TARANTOOL_CONVERTER_BEAN_NAME, configurationSource);

    // register tarantoolOpsImpl
    RootBeanDefinition tarantoolOpsImplDefinition = new RootBeanDefinition(TarantoolOpsImpl.class);

    ConstructorArgumentValues constructorArgumentValuesForTarantoolOpsImpl = new ConstructorArgumentValues();
    if (StringUtils.hasText(tarantolSyncOpsRef)) {
        constructorArgumentValuesForTarantoolOpsImpl.addIndexedArgumentValue(0,
                new RuntimeBeanReference(tarantolSyncOpsRef));
    }

    tarantoolOpsImplDefinition.setConstructorArgumentValues(constructorArgumentValuesForTarantoolOpsImpl);

    registerIfNotAlreadyRegistered(tarantoolOpsImplDefinition, registry, TARANTOOL_OPS_IMPL_BEAN_NAME,
            configurationSource);

    super.registerBeansForRoot(registry, configurationSource);
}
 
開發者ID:saladinkzn,項目名稱:spring-data-tarantool,代碼行數:32,代碼來源:TarantoolRepositoryConfigurationExtension.java

示例12: configureAutoProxyCreator

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
public static void configureAutoProxyCreator(Element element, ParserContext parserContext) {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(parserContext, element);

	String txAdvisorBeanName = TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME;
	if (!parserContext.getRegistry().containsBeanDefinition(txAdvisorBeanName)) {
		Object eleSource = parserContext.extractSource(element);

		// Create the TransactionAttributeSource definition.
		RootBeanDefinition sourceDef = new RootBeanDefinition(
				"org.springframework.transaction.annotation.AnnotationTransactionAttributeSource");
		sourceDef.setSource(eleSource);
		sourceDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		String sourceName = parserContext.getReaderContext().registerWithGeneratedName(sourceDef);

		// Create the TransactionInterceptor definition.
		RootBeanDefinition interceptorDef = new RootBeanDefinition(TransactionInterceptor.class);
		interceptorDef.setSource(eleSource);
		interceptorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		registerTransactionManager(element, interceptorDef);
		interceptorDef.getPropertyValues().add("transactionAttributeSource", new RuntimeBeanReference(sourceName));
		String interceptorName = parserContext.getReaderContext().registerWithGeneratedName(interceptorDef);

		// Create the TransactionAttributeSourceAdvisor definition.
		RootBeanDefinition advisorDef = new RootBeanDefinition(BeanFactoryTransactionAttributeSourceAdvisor.class);
		advisorDef.setSource(eleSource);
		advisorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		advisorDef.getPropertyValues().add("transactionAttributeSource", new RuntimeBeanReference(sourceName));
		advisorDef.getPropertyValues().add("adviceBeanName", interceptorName);
		if (element.hasAttribute("order")) {
			advisorDef.getPropertyValues().add("order", element.getAttribute("order"));
		}
		parserContext.getRegistry().registerBeanDefinition(txAdvisorBeanName, advisorDef);

		CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), eleSource);
		compositeDef.addNestedComponent(new BeanComponentDefinition(sourceDef, sourceName));
		compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));
		compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, txAdvisorBeanName));
		parserContext.registerComponent(compositeDef);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:41,代碼來源:AnnotationDrivenBeanDefinitionParser.java

示例13: parse

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
	if (!parserContext.getRegistry().containsBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME)) {
		RootBeanDefinition def = new RootBeanDefinition();
		def.setBeanClassName(BEAN_CONFIGURER_ASPECT_CLASS_NAME);
		def.setFactoryMethodName("aspectOf");
		def.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		def.setSource(parserContext.extractSource(element));
		parserContext.registerBeanComponent(new BeanComponentDefinition(def, BEAN_CONFIGURER_ASPECT_BEAN_NAME));
	}
	return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:13,代碼來源:SpringConfiguredBeanDefinitionParser.java

示例14: configureAutoProxyCreator

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
public static void configureAutoProxyCreator(Element element, ParserContext parserContext) {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(parserContext, element);

	if (!parserContext.getRegistry().containsBeanDefinition(CACHE_ADVISOR_BEAN_NAME)) {
		Object eleSource = parserContext.extractSource(element);

		// Create the CacheOperationSource definition.
		RootBeanDefinition sourceDef = new RootBeanDefinition(AnnotationCacheOperationSource.class);
		sourceDef.setSource(eleSource);
		sourceDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		String sourceName = parserContext.getReaderContext().registerWithGeneratedName(sourceDef);

		// Create the CacheInterceptor definition.
		RootBeanDefinition interceptorDef = new RootBeanDefinition(CacheInterceptor.class);
		interceptorDef.setSource(eleSource);
		interceptorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		parseCacheManagerProperty(element, interceptorDef);
		CacheNamespaceHandler.parseKeyGenerator(element, interceptorDef);
		interceptorDef.getPropertyValues().add("cacheOperationSources", new RuntimeBeanReference(sourceName));
		String interceptorName = parserContext.getReaderContext().registerWithGeneratedName(interceptorDef);

		// Create the CacheAdvisor definition.
		RootBeanDefinition advisorDef = new RootBeanDefinition(BeanFactoryCacheOperationSourceAdvisor.class);
		advisorDef.setSource(eleSource);
		advisorDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
		advisorDef.getPropertyValues().add("cacheOperationSource", new RuntimeBeanReference(sourceName));
		advisorDef.getPropertyValues().add("adviceBeanName", interceptorName);
		if (element.hasAttribute("order")) {
			advisorDef.getPropertyValues().add("order", element.getAttribute("order"));
		}
		parserContext.getRegistry().registerBeanDefinition(CACHE_ADVISOR_BEAN_NAME, advisorDef);

		CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(),
				eleSource);
		compositeDef.addNestedComponent(new BeanComponentDefinition(sourceDef, sourceName));
		compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));
		compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, CACHE_ADVISOR_BEAN_NAME));
		parserContext.registerComponent(compositeDef);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:41,代碼來源:AnnotationDrivenCacheBeanDefinitionParser.java

示例15: registerBeansForRoot

import org.springframework.beans.factory.support.RootBeanDefinition; //導入方法依賴的package包/類
@Override
public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource) {
       super.registerBeansForRoot(registry, configurationSource);
       
       RootBeanDefinition mappingContextDefinition = new RootBeanDefinition(ObjectifyMappingContext.class);
       mappingContextDefinition.setSource(configurationSource.getSource());
       
       registerIfNotAlreadyRegistered(mappingContextDefinition, registry, MAPPING_CONTEXT_BEAN_NAME, configurationSource);
   }
 
開發者ID:nhuttrung,項目名稱:spring-data-objectify,代碼行數:10,代碼來源:ObjectifyRepositoryConfigurationExtension.java


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