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