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


Java EnableBinding類代碼示例

本文整理匯總了Java中org.springframework.cloud.stream.annotation.EnableBinding的典型用法代碼示例。如果您正苦於以下問題:Java EnableBinding類的具體用法?Java EnableBinding怎麽用?Java EnableBinding使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EnableBinding類屬於org.springframework.cloud.stream.annotation包,在下文中一共展示了EnableBinding類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerBeanDefinitions

import org.springframework.cloud.stream.annotation.EnableBinding; //導入依賴的package包/類
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata,
		BeanDefinitionRegistry registry) {
	AnnotationAttributes attrs = AnnotatedElementUtils.getMergedAnnotationAttributes(
			ClassUtils.resolveClassName(metadata.getClassName(), null),
			EnableBinding.class);
	for (Class<?> type : collectClasses(attrs, metadata.getClassName())) {
		if (!registry.containsBeanDefinition(type.getName())) {
			BindingBeanDefinitionRegistryUtils.registerBindingTargetBeanDefinitions(type,
					type.getName(), registry);
			BindingBeanDefinitionRegistryUtils.registerBindingTargetsQualifiedBeanDefinitions(
					ClassUtils.resolveClassName(metadata.getClassName(), null), type,
					registry);
		}
	}
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-stream,代碼行數:17,代碼來源:BindingBeansRegistrar.java

示例2: getCompleteConfiguration

import org.springframework.cloud.stream.annotation.EnableBinding; //導入依賴的package包/類
/**
 * Utility operation to return an array of configuration classes
 * defined in {@link EnableBinding} annotation.
 * Typically used for tests that do not rely on creating an SCSt boot
 * application annotated with {@link EnableBinding}, yet require
 * full {@link Binder} configuration.
 */
public static Class<?>[] getCompleteConfiguration() {
	List<Class<?>> configClasses = new ArrayList<>();
	configClasses.add(SpringIntegrationBinderConfiguration.class);
	Import annotation = AnnotationUtils.getAnnotation(EnableBinding.class, Import.class);
	Map<String, Object> annotationAttributes = AnnotationUtils.getAnnotationAttributes(annotation);
	configClasses.addAll(Arrays.asList((Class<?>[])annotationAttributes.get("value")));
	return configClasses.toArray(new Class<?>[] {});
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-stream,代碼行數:16,代碼來源:SpringIntegrationBinderConfiguration.java

示例3: collectClasses

import org.springframework.cloud.stream.annotation.EnableBinding; //導入依賴的package包/類
private Class<?>[] collectClasses(AnnotationAttributes attrs, String className) {
	EnableBinding enableBinding = AnnotationUtils.synthesizeAnnotation(attrs,
			EnableBinding.class, ClassUtils.resolveClassName(className, null));
	return enableBinding.value();
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-stream,代碼行數:6,代碼來源:BindingBeansRegistrar.java


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