Search in sources :

Example 1 with CamelComponentNameResolverBuildItem

use of org.apache.camel.quarkus.core.deployment.spi.CamelComponentNameResolverBuildItem 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));
}
Also used : BuildTimeCamelCatalog(org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog) BuildTimeJsonSchemaResolver(org.apache.camel.quarkus.core.deployment.catalog.BuildTimeJsonSchemaResolver) CamelComponentNameResolverBuildItem(org.apache.camel.quarkus.core.deployment.spi.CamelComponentNameResolverBuildItem) Record(io.quarkus.deployment.annotations.Record) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

BuildStep (io.quarkus.deployment.annotations.BuildStep)1 Record (io.quarkus.deployment.annotations.Record)1 BuildTimeCamelCatalog (org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog)1 BuildTimeJsonSchemaResolver (org.apache.camel.quarkus.core.deployment.catalog.BuildTimeJsonSchemaResolver)1 CamelComponentNameResolverBuildItem (org.apache.camel.quarkus.core.deployment.spi.CamelComponentNameResolverBuildItem)1