当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeBeanReference.getBeanName方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.config.RuntimeBeanReference.getBeanName方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeBeanReference.getBeanName方法的具体用法?Java RuntimeBeanReference.getBeanName怎么用?Java RuntimeBeanReference.getBeanName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.config.RuntimeBeanReference的用法示例。


在下文中一共展示了RuntimeBeanReference.getBeanName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRefIfNeeded

import org.springframework.beans.factory.config.RuntimeBeanReference; //导入方法依赖的package包/类
private void addRefIfNeeded(Object v, List<String> refs) {
         if(v == null) return;
         
         if(v instanceof RuntimeBeanReference) {
            RuntimeBeanReference r = (RuntimeBeanReference)v;
            String name = r.getBeanName();
            
            addRefIfNeeded(name, refs);
            
            if(name == null || name.length() == 0) {
               System.err.println("Warning - empty reference " + r);
            }
         } else if(v instanceof BeanDefinitionHolder) {
            // Nested bean definition
            BeanDefinitionHolder bdh = (BeanDefinitionHolder)v;
            processBeanDefinition(bdh.getBeanName(), bdh.getBeanDefinition());
         } else if(v instanceof ManagedList<?>) {
            ManagedList<?> ml = (ManagedList<?>)v;
            for(Object le : ml) {
               addRefIfNeeded(le, refs);
            }
//       } else {
//          System.err.println(v.getClass());
         }
      }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:ContextDependencyLister.java

示例2: resolveReference

import org.springframework.beans.factory.config.RuntimeBeanReference; //导入方法依赖的package包/类
/**
 * Resolve a reference to another bean in the factory.
 */
private Object resolveReference(Object argName, RuntimeBeanReference ref) {
	try {
		String refName = ref.getBeanName();
		refName = String.valueOf(evaluate(refName));
		if (ref.isToParent()) {
			if (this.beanFactory.getParentBeanFactory() == null) {
				throw new BeanCreationException(
						this.beanDefinition.getResourceDescription(), this.beanName,
						"Can't resolve reference to bean '" + refName +
						"' in parent factory: no parent factory available");
			}
			return this.beanFactory.getParentBeanFactory().getBean(refName);
		}
		else {
			Object bean = this.beanFactory.getBean(refName);
			this.beanFactory.registerDependentBean(refName, this.beanName);
			return bean;
		}
	}
	catch (BeansException ex) {
		throw new BeanCreationException(
				this.beanDefinition.getResourceDescription(), this.beanName,
				"Cannot resolve reference to bean '" + ref.getBeanName() + "' while setting " + argName, ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:BeanDefinitionValueResolver.java

示例3: registerWebSocketMessageBrokerStats

import org.springframework.beans.factory.config.RuntimeBeanReference; //导入方法依赖的package包/类
private void registerWebSocketMessageBrokerStats(RootBeanDefinition broker, RuntimeBeanReference inChannel,
		RuntimeBeanReference outChannel, ParserContext context, Object source) {

	RootBeanDefinition beanDef = new RootBeanDefinition(WebSocketMessageBrokerStats.class);

	RuntimeBeanReference webSocketHandler = new RuntimeBeanReference(WEB_SOCKET_HANDLER_BEAN_NAME);
	beanDef.getPropertyValues().add("subProtocolWebSocketHandler", webSocketHandler);

	if (StompBrokerRelayMessageHandler.class == broker.getBeanClass()) {
		beanDef.getPropertyValues().add("stompBrokerRelay", broker);
	}
	String name = inChannel.getBeanName() + "Executor";
	if (context.getRegistry().containsBeanDefinition(name)) {
		beanDef.getPropertyValues().add("inboundChannelExecutor", context.getRegistry().getBeanDefinition(name));
	}
	name = outChannel.getBeanName() + "Executor";
	if (context.getRegistry().containsBeanDefinition(name)) {
		beanDef.getPropertyValues().add("outboundChannelExecutor", context.getRegistry().getBeanDefinition(name));
	}
	name = SCHEDULER_BEAN_NAME;
	if (context.getRegistry().containsBeanDefinition(name)) {
		beanDef.getPropertyValues().add("sockJsTaskScheduler", context.getRegistry().getBeanDefinition(name));
	}
	registerBeanDefByName("webSocketMessageBrokerStats", beanDef, context, source);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:26,代码来源:MessageBrokerBeanDefinitionParser.java

示例4: resolveReference

import org.springframework.beans.factory.config.RuntimeBeanReference; //导入方法依赖的package包/类
/**
 * Resolve a reference to another bean in the factory.
 */
private Object resolveReference(Object argName, RuntimeBeanReference ref) {
	try {
		String refName = ref.getBeanName();
		refName = String.valueOf(doEvaluate(refName));
		if (ref.isToParent()) {
			if (this.beanFactory.getParentBeanFactory() == null) {
				throw new BeanCreationException(
						this.beanDefinition.getResourceDescription(), this.beanName,
						"Can't resolve reference to bean '" + refName +
						"' in parent factory: no parent factory available");
			}
			return this.beanFactory.getParentBeanFactory().getBean(refName);
		}
		else {
			Object bean = this.beanFactory.getBean(refName);
			this.beanFactory.registerDependentBean(refName, this.beanName);
			return bean;
		}
	}
	catch (BeansException ex) {
		throw new BeanCreationException(
				this.beanDefinition.getResourceDescription(), this.beanName,
				"Cannot resolve reference to bean '" + ref.getBeanName() + "' while setting " + argName, ex);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:29,代码来源:BeanDefinitionValueResolver.java


注:本文中的org.springframework.beans.factory.config.RuntimeBeanReference.getBeanName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。