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


Java ObjectUtils.getIdentityHexString方法代码示例

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


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

示例1: createDefaultTaskExecutor

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
private TaskExecutor createDefaultTaskExecutor() {
	// create thread-pool for starting contexts
	ThreadGroup threadGroup =
			new ThreadGroup("eclipse-gemini-blueprint-extender[" + ObjectUtils.getIdentityHexString(this) + "]-threads");
	threadGroup.setDaemon(false);

	ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
	taskExecutor.setMaxPoolSize(Runtime.getRuntime().availableProcessors());
	taskExecutor.setThreadGroup(threadGroup);
	taskExecutor.setThreadNamePrefix("EclipseGeminiBlueprintExtenderThread-");
	taskExecutor.initialize();

	isTaskExecutorManagedInternally = true;

	return taskExecutor;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:17,代码来源:ExtenderConfiguration.java

示例2: generateBeanName

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Generate a bean name for the given bean definition, unique within the
 * given bean factory.
 * @param definition the bean definition to generate a bean name for
 * @param registry the bean factory that the definition is going to be
 * registered with (to check for existing bean names)
 * @param isInnerBean whether the given bean definition will be registered
 * as inner bean or as top-level bean (allowing for special name generation
 * for inner beans versus top-level beans)
 * @return the generated bean name
 * @throws BeanDefinitionStoreException if no unique name can be generated
 * for the given bean definition
 */
public static String generateBeanName(
		BeanDefinition definition, BeanDefinitionRegistry registry, boolean isInnerBean)
		throws BeanDefinitionStoreException {

	String generatedBeanName = definition.getBeanClassName();
	if (generatedBeanName == null) {
		if (definition.getParentName() != null) {
			generatedBeanName = definition.getParentName() + "$child";
		}
		else if (definition.getFactoryBeanName() != null) {
			generatedBeanName = definition.getFactoryBeanName() + "$created";
		}
	}
	if (!StringUtils.hasText(generatedBeanName)) {
		throw new BeanDefinitionStoreException("Unnamed bean definition specifies neither " +
				"'class' nor 'parent' nor 'factory-bean' - can't generate bean name");
	}

	String id = generatedBeanName;
	if (isInnerBean) {
		// Inner bean: generate identity hashcode suffix.
		id = generatedBeanName + GENERATED_BEAN_NAME_SEPARATOR + ObjectUtils.getIdentityHexString(definition);
	}
	else {
		// Top-level bean: use plain class name.
		// Increase counter until the id is unique.
		int counter = -1;
		while (counter == -1 || registry.containsBeanDefinition(id)) {
			counter++;
			id = generatedBeanName + GENERATED_BEAN_NAME_SEPARATOR + counter;
		}
	}
	return id;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:48,代码来源:BeanDefinitionReaderUtils.java

示例3: parseNestedCustomElement

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
private BeanDefinitionHolder parseNestedCustomElement(Element ele, BeanDefinition containingBd) {
	BeanDefinition innerDefinition = parseCustomElement(ele, containingBd);
	if (innerDefinition == null) {
		error("Incorrect usage of element '" + ele.getNodeName() + "' in a nested manner. " +
				"This tag cannot be used nested inside <property>.", ele);
		return null;
	}
	String id = ele.getNodeName() + BeanDefinitionReaderUtils.GENERATED_BEAN_NAME_SEPARATOR +
			ObjectUtils.getIdentityHexString(innerDefinition);
	if (logger.isDebugEnabled()) {
		logger.debug("Using generated bean name [" + id +
				"] for nested custom element '" + ele.getNodeName() + "'");
	}
	return new BeanDefinitionHolder(innerDefinition, id);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:BeanDefinitionParserDelegate.java

示例4: doSmth

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
public Object doSmth() {
	return ObjectUtils.getIdentityHexString(this);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:4,代码来源:OsgiServiceProxyEqualityTest.java


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