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


Java GenericBeanDefinition.getBeanClassName方法代碼示例

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


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

示例1: processBeanDefinitions

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
/**
 * Process the bean definitions.
 *
 * @param beanDefinitions the bean definitions
 */
private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {

    for (BeanDefinitionHolder beanDefinition : beanDefinitions) {
        GenericBeanDefinition definition = (GenericBeanDefinition) beanDefinition.getBeanDefinition();

        final String serviceClassName = definition.getBeanClassName();

        definition.setBeanClass(JaxRsClientProxyFactoryBean.class);
        definition.getPropertyValues().add("serviceClass", serviceClassName);
        definition.getPropertyValues().add("serviceUrl", serviceUrl);
        definition.getPropertyValues().add("serviceUrlProvider", serviceUrlProvider);
    }
}
 
開發者ID:jmnarloch,項目名稱:spring-jax-rs-client-proxy,代碼行數:19,代碼來源:JaxRsClientClassPathScanner.java

示例2: doScan

import org.springframework.beans.factory.support.GenericBeanDefinition; //導入方法依賴的package包/類
/**
 * Calls the parent search that will search and register all the candidates.
 * Then the registered objects are post processed to set them as
 * MapperFactoryBeans
 */
@Override
public Set<BeanDefinitionHolder> doScan(String... basePackages) {
	Set<BeanDefinitionHolder> beanDefinitions = super.doScan(basePackages);

	if (beanDefinitions.isEmpty()) {
		logger.warn("No DaoService was found in '"
				+ Arrays.toString(basePackages)
				+ "' package. Please check your configuration.");
	} else {
		for (BeanDefinitionHolder holder : beanDefinitions) {
			GenericBeanDefinition definition = (GenericBeanDefinition) holder
					.getBeanDefinition();

			if (logger.isDebugEnabled()) {
				logger.debug("Creating DaoFactoryBean with name '"
						+ holder.getBeanName() + "' and '"
						+ definition.getBeanClassName() + "' daoInterface");
			}

			// the mapper interface is the original class of the bean
			// but, the actual class of the bean is HibernateDaoFactoryBean
			definition.getPropertyValues().add("daoInterface",
					definition.getBeanClassName());
			definition.getPropertyValues().add("funcs", functions);
			String className = definition.getBeanClassName();
			int idx = className.lastIndexOf(".");
			if (idx > 0)
				className = className.substring(idx + 1);
			String em = daoEntityManagerNames.get(className);
			if (em == null)
				em = entityManagerName;
			String sf = daoSessionFactoryNames.get(className);
			if (sf == null)
				sf = sessionFactoryName;
			definition.getPropertyValues().add("entityManagerName", em);
			definition.getPropertyValues().add("sessionFactoryName", sf);
			definition.setBeanClass(DaoFactoryBean.class);

			definition
					.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
		}
	}

	return beanDefinitions;
}
 
開發者ID:yangjm,項目名稱:winlet,代碼行數:51,代碼來源:DaoScanner.java


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