本文整理匯總了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();
}