本文整理汇总了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);
}
}
}
示例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<?>[] {});
}
示例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();
}