if (hasId(factory)) { beans.add(camelContextBean(null, factory, url));
hasId(exporter) ? NamedLiteral.of(exporter.getId()) : DEFAULT), type, bean -> "imported bean [" + Objects.toString(exporter.getId(), "export") + "] "
private SyntheticBean<?> routesDefinitionBean(RoutesDefinition definition, URL url) { return new SyntheticBean<>(manager, // TODO: should be @Named if the id is set new SyntheticAnnotated(RoutesDefinition.class, manager.createAnnotatedType(RoutesDefinition.class).getTypeClosure(), ANY, DEFAULT), RoutesDefinition.class, new SyntheticInjectionTarget<>(() -> definition), bean -> "imported routes definition " + (hasId(definition) ? "[" + definition.getId() + "] " : "") + "from resource [" + url + "]"); }
private SyntheticBean<?> camelContextBean(Bean<?> context, AbstractCamelFactoryBean<?> factory, URL url) { if (factory instanceof BeanManagerAware) { ((BeanManagerAware) factory).setBeanManager(manager); } Set<Annotation> annotations = new HashSet<>(); annotations.add(ANY); // FIXME: should add @ContextName if the Camel context bean has it annotations.add(hasId(factory) ? NamedLiteral.of(factory.getId()) : DEFAULT); // TODO: should that be @Singleton to enable injection points with bean instance type? if (factory.isSingleton()) { annotations.add(APPLICATION_SCOPED); } return new SyntheticBean<>(manager, new SyntheticAnnotated(factory.getObjectType(), manager.createAnnotatedType(factory.getObjectType()).getTypeClosure(), annotations), factory.getObjectType(), new XmlFactoryBeanInjectionTarget<>(manager, factory, context), bean -> "imported bean [" + factory.getId() + "] " + "from resource [" + url + "] " + "with qualifiers " + bean.getQualifiers()); }
private SyntheticBean<?> camelContextBean(CamelContextFactoryBean factory, URL url, AnnotatedType annotatedType) { Set<Annotation> annotations = new HashSet<>(); annotations.add(ANY); if (hasId(factory)) { addAll(annotations, ContextName.Literal.of(factory.getId()), NamedLiteral.of(factory.getId()));