当前位置: 首页>>代码示例>>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;未经允许,请勿转载。