Search in sources :

Example 1 with UnremovableBeanBuildItem

use of io.quarkus.arc.deployment.UnremovableBeanBuildItem in project camel-quarkus by apache.

the class GooglePubsubProcessor method markObjectMapperUnremovable.

@BuildStep
public void markObjectMapperUnremovable(BuildProducer<UnremovableBeanBuildItem> unremovable) {
    unremovable.produce(new UnremovableBeanBuildItem(new UnremovableBeanBuildItem.BeanClassNameExclusion(ObjectMapper.class.getName())));
    unremovable.produce(new UnremovableBeanBuildItem(new UnremovableBeanBuildItem.BeanClassNameExclusion(ObjectMapperProducer.class.getName())));
}
Also used : ObjectMapperProducer(io.quarkus.jackson.runtime.ObjectMapperProducer) UnremovableBeanBuildItem(io.quarkus.arc.deployment.UnremovableBeanBuildItem) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Example 2 with UnremovableBeanBuildItem

use of io.quarkus.arc.deployment.UnremovableBeanBuildItem 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);
}
Also used : IndexView(org.jboss.jandex.IndexView) SchemaResource(org.apache.camel.quarkus.core.deployment.catalog.SchemaResource) Logger(org.slf4j.Logger) UnremovableBeanBuildItem(io.quarkus.arc.deployment.UnremovableBeanBuildItem) Collection(java.util.Collection) DotName(org.jboss.jandex.DotName) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) ClassInfo(org.jboss.jandex.ClassInfo) BuildTimeCamelCatalog(org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog) Collectors(java.util.stream.Collectors) CombinedIndexBuildItem(io.quarkus.deployment.builditem.CombinedIndexBuildItem) HashSet(java.util.HashSet) BuildStep(io.quarkus.deployment.annotations.BuildStep) List(java.util.List) Stream(java.util.stream.Stream) BuildTimeCamelCatalogBuildItem(org.apache.camel.quarkus.core.deployment.spi.BuildTimeCamelCatalogBuildItem) Dataformat(org.apache.camel.spi.annotations.Dataformat) InterceptStrategy(org.apache.camel.spi.InterceptStrategy) AnnotationInstance(org.jboss.jandex.AnnotationInstance) Component(org.apache.camel.spi.annotations.Component) Language(org.apache.camel.spi.annotations.Language) BuildTimeJsonSchemaResolver(org.apache.camel.quarkus.core.deployment.catalog.BuildTimeJsonSchemaResolver) BaseOptionModel(org.apache.camel.tooling.model.BaseOptionModel) BuildTimeCamelCatalog(org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog) BaseOptionModel(org.apache.camel.tooling.model.BaseOptionModel) DotName(org.jboss.jandex.DotName) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

UnremovableBeanBuildItem (io.quarkus.arc.deployment.UnremovableBeanBuildItem)2 BuildStep (io.quarkus.deployment.annotations.BuildStep)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 CombinedIndexBuildItem (io.quarkus.deployment.builditem.CombinedIndexBuildItem)1 ObjectMapperProducer (io.quarkus.jackson.runtime.ObjectMapperProducer)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 BuildTimeCamelCatalog (org.apache.camel.quarkus.core.deployment.catalog.BuildTimeCamelCatalog)1 BuildTimeJsonSchemaResolver (org.apache.camel.quarkus.core.deployment.catalog.BuildTimeJsonSchemaResolver)1 SchemaResource (org.apache.camel.quarkus.core.deployment.catalog.SchemaResource)1 BuildTimeCamelCatalogBuildItem (org.apache.camel.quarkus.core.deployment.spi.BuildTimeCamelCatalogBuildItem)1 InterceptStrategy (org.apache.camel.spi.InterceptStrategy)1 Component (org.apache.camel.spi.annotations.Component)1 Dataformat (org.apache.camel.spi.annotations.Dataformat)1 Language (org.apache.camel.spi.annotations.Language)1 BaseOptionModel (org.apache.camel.tooling.model.BaseOptionModel)1