當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。