use of org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog in project camel-quarkus by apache.
the class CamelProcessor method componentNameResolver.
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
CamelComponentNameResolverBuildItem componentNameResolver(BuildTimeCamelCatalogBuildItem camelCatalog, CamelRecorder recorder) {
BuildTimeCamelCatalog catalog = camelCatalog.getCatalog();
BuildTimeJsonSchemaResolver jSonSchemaResolver = catalog.getJSonSchemaResolver();
Set<String> componentNames = jSonSchemaResolver.getSchemaResources().stream().filter(resource -> resource.getType().equals("component")).map(SchemaResource::getName).collect(Collectors.collectingAndThen(Collectors.toUnmodifiableSet(), TreeSet::new));
return new CamelComponentNameResolverBuildItem(recorder.createComponentNameResolver(componentNames));
}
use of org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog in project camel-quarkus by apache.
the class CamelUnremovableBeansProcessor method unremovableCamelBeans.
@BuildStep
UnremovableBeanBuildItem unremovableCamelBeans(BuildTimeCamelCatalogBuildItem camelCatalogBuildItem) {
BuildTimeCamelCatalog catalog = camelCatalogBuildItem.getCatalog();
Set<DotName> unremovableClasses = catalog.getAllOptions().stream().filter(option -> option.getType().equals("object")).filter(option -> !option.getJavaType().startsWith("java.lang")).map(BaseOptionModel::getJavaType).map(DotName::createSimple).collect(Collectors.toSet());
if (LOGGER.isDebugEnabled()) {
unremovableClasses.stream().forEach(unremovableClass -> LOGGER.debug("Registering camel unremovable bean class: {}", unremovableClass));
}
return UnremovableBeanBuildItem.beanTypes(unremovableClasses);
}
use of org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog in project camel-quarkus by apache.
the class CamelUnremovableBeansProcessor method buildTimeCamelCatalog.
@BuildStep
BuildTimeCamelCatalogBuildItem buildTimeCamelCatalog(CombinedIndexBuildItem combinedIndex) {
Set<SchemaResource> resources = new HashSet<>();
IndexView index = combinedIndex.getIndex();
List<AnnotationInstance> annotations = Stream.of(CATALOG_SCHEMA_TYPES).map(index::getAnnotations).flatMap(Collection::stream).collect(Collectors.toList());
for (AnnotationInstance instance : annotations) {
SchemaResource resource = new SchemaResource();
resource.setName(instance.value().asString());
resource.setType(instance.name().withoutPackagePrefix().toLowerCase());
resource.setClassName(instance.target().asClass().name());
resources.add(resource);
}
BuildTimeJsonSchemaResolver resolver = new BuildTimeJsonSchemaResolver(resources);
BuildTimeCamelCatalog catalog = new BuildTimeCamelCatalog(resolver);
return new BuildTimeCamelCatalogBuildItem(catalog);
}
Aggregations