io.quarkus.deployment.annotations.Record Java Examples

The following examples show how to use io.quarkus.deployment.annotations.Record. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HibernateOrmProcessor.java    From quarkus with Apache License 2.0 7 votes vote down vote up
@BuildStep
@Record(STATIC_INIT)
public void build(HibernateOrmRecorder recorder,
        Capabilities capabilities, BuildProducer<BeanContainerListenerBuildItem> buildProducer,
        List<PersistenceUnitDescriptorBuildItem> descriptors,
        JpaEntitiesBuildItem jpaEntities, List<NonJpaModelBuildItem> nonJpaModels) throws Exception {
    if (!hasEntities(jpaEntities, nonJpaModels)) {
        return;
    }
    MultiTenancyStrategy strategy = MultiTenancyStrategy
            .valueOf(hibernateConfig.multitenant.orElse(MultiTenancyStrategy.NONE.name()));
    buildProducer.produce(new BeanContainerListenerBuildItem(
            recorder.initializeJpa(capabilities.isPresent(Capability.TRANSACTIONS), strategy,
                    hibernateConfig.multitenantSchemaDatasource.orElse(null))));

    // Bootstrap all persistence units
    for (PersistenceUnitDescriptorBuildItem persistenceUnitDescriptor : descriptors) {
        buildProducer.produce(new BeanContainerListenerBuildItem(
                recorder.registerPersistenceUnit(persistenceUnitDescriptor.getDescriptor().getName())));
    }
    buildProducer.produce(new BeanContainerListenerBuildItem(recorder.initDefaultPersistenceUnit()));
}
 
Example #2
Source File: PanacheMongoResourceProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
@Record(ExecutionTime.STATIC_INIT)
void buildReplacementMap(List<PropertyMappingClassBuildStep> propertyMappingClasses, CombinedIndexBuildItem index,
        PanacheMongoRecorder recorder) {
    Map<String, Map<String, String>> replacementMap = new ConcurrentHashMap<>();
    for (PropertyMappingClassBuildStep classToMap : propertyMappingClasses) {
        DotName dotName = DotName.createSimple(classToMap.getClassName());
        ClassInfo classInfo = index.getIndex().getClassByName(dotName);
        if (classInfo != null) {
            // only compute field replacement for types inside the index
            Map<String, String> classReplacementMap = replacementMap.computeIfAbsent(classToMap.getClassName(),
                    className -> computeReplacement(classInfo));
            if (classToMap.getAliasClassName() != null) {
                // also register the replacement map for the projection classes
                replacementMap.put(classToMap.getAliasClassName(), classReplacementMap);
            }
        }
    }

    recorder.setReplacementCache(replacementMap);
}
 
Example #3
Source File: HttpSecurityProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
SyntheticBeanBuildItem initBasicAuth(
        HttpSecurityRecorder recorder,
        HttpBuildTimeConfig buildTimeConfig) {
    if ((buildTimeConfig.auth.form.enabled || isMtlsClientAuthenticationEnabled(buildTimeConfig))
            && !buildTimeConfig.auth.basic) {
        //if form auth is enabled and we are not then we don't install
        return null;
    }
    SyntheticBeanBuildItem.ExtendedBeanConfigurator configurator = SyntheticBeanBuildItem
            .configure(BasicAuthenticationMechanism.class)
            .types(HttpAuthenticationMechanism.class)
            .setRuntimeInit()
            .scope(Singleton.class)
            .supplier(recorder.setupBasicAuth(buildTimeConfig));
    if (!buildTimeConfig.auth.form.enabled && !isMtlsClientAuthenticationEnabled(buildTimeConfig)
            && !buildTimeConfig.auth.basic) {
        //if not explicitly enabled we make this a default bean, so it is the fallback if nothing else is defined
        configurator.defaultBean();
    }

    return configurator.done();
}
 
Example #4
Source File: TestProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
/**
 * Load a DSAPublicKey from a resource and create an instance of it
 *
 * @param recorder - runtime recorder
 * @return PublicKeyBuildItem for the DSAPublicKey
 * @throws IOException - on resource load failure
 * @throws GeneralSecurityException - on key creation failure
 */
@BuildStep
@Record(STATIC_INIT)
PublicKeyBuildItem loadDSAPublicKey(TestRecorder recorder,
        BuildProducer<ObjectSubstitutionBuildItem> substitutions) throws IOException, GeneralSecurityException {
    String path = configRoot.dsaKeyLocation;
    try (InputStream is = getClass().getResourceAsStream(path)) {
        if (is == null) {
            throw new IOException("Failed to load resource: " + path);
        }
        BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
        String base64 = reader.readLine();
        reader.close();
        byte[] encoded = Base64.getDecoder().decode(base64);
        KeyFactory keyFactory = KeyFactory.getInstance("DSA");
        X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded);
        DSAPublicKey publicKey = (DSAPublicKey) keyFactory.generatePublic(publicKeySpec);
        // Register how to serialize DSAPublicKey
        ObjectSubstitutionBuildItem.Holder<DSAPublicKey, KeyProxy> holder = new ObjectSubstitutionBuildItem.Holder(
                DSAPublicKey.class, KeyProxy.class, DSAPublicKeyObjectSubstitution.class);
        ObjectSubstitutionBuildItem keySub = new ObjectSubstitutionBuildItem(holder);
        substitutions.produce(keySub);
        log.info("loadDSAPublicKey run");
        return new PublicKeyBuildItem(publicKey);
    }
}
 
Example #5
Source File: TestProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
/**
 * Test for https://github.com/quarkusio/quarkus/issues/1633
 *
 * @param recorder - runtime recorder
 */
@BuildStep
@Record(RUNTIME_INIT)
void referencePrimitiveTypeClasses(TestRecorder recorder) {
    HashSet<Class<?>> allPrimitiveTypes = new HashSet<>();
    allPrimitiveTypes.add(byte.class);
    allPrimitiveTypes.add(char.class);
    allPrimitiveTypes.add(short.class);
    allPrimitiveTypes.add(int.class);
    allPrimitiveTypes.add(long.class);
    allPrimitiveTypes.add(float.class);
    allPrimitiveTypes.add(double.class);
    allPrimitiveTypes.add(byte[].class);
    allPrimitiveTypes.add(char[].class);
    allPrimitiveTypes.add(short[].class);
    allPrimitiveTypes.add(int[].class);
    allPrimitiveTypes.add(long[].class);
    allPrimitiveTypes.add(float[].class);
    allPrimitiveTypes.add(double[].class);
    recorder.validateTypes(allPrimitiveTypes);
}
 
Example #6
Source File: SmallRyeFaultToleranceProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
// needs to be RUNTIME_INIT because we need to read MP Config
@Record(ExecutionTime.RUNTIME_INIT)
void validateFaultToleranceAnnotations(SmallRyeFaultToleranceRecorder recorder,
        ValidationPhaseBuildItem validationPhase,
        BeanArchiveIndexBuildItem beanArchiveIndexBuildItem) {
    AnnotationStore annotationStore = validationPhase.getContext().get(BuildExtension.Key.ANNOTATION_STORE);
    Set<String> beanNames = new HashSet<>();
    IndexView index = beanArchiveIndexBuildItem.getIndex();

    for (BeanInfo info : validationPhase.getContext().beans()) {
        if (hasFTAnnotations(index, annotationStore, info.getImplClazz())) {
            beanNames.add(info.getBeanClass().toString());
        }
    }

    recorder.createFaultToleranceOperation(beanNames);
}
 
Example #7
Source File: DeploymentProcessor.java    From camel-k-runtime with Apache License 2.0 6 votes vote down vote up
@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep
CamelRuntimeBeanBuildItem knativeComponent(
    KnativeRecorder recorder,
    CoreVertxBuildItem vertx,
    VertxWebRouterBuildItem router,
    BodyHandlerBuildItem bodyHandlerBuildItem) {

    return new CamelRuntimeBeanBuildItem(
        KnativeConstants.SCHEME,
        KnativeComponent.class.getName(),
        recorder.createKnativeComponent(
            vertx.getVertx(),
            router.getRouter(),
            bodyHandlerBuildItem.getHandler())
    );
}
 
Example #8
Source File: SmallRyeMetricsProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
/**
 * Register metrics required by other Quarkus extensions.
 */
@BuildStep
@Record(STATIC_INIT)
void extensionMetrics(SmallRyeMetricsRecorder recorder,
        List<MetricBuildItem> additionalMetrics,
        BuildProducer<UnremovableBeanBuildItem> unremovableBeans) {
    if (metrics.extensionsEnabled) {
        if (!additionalMetrics.isEmpty()) {
            unremovableBeans.produce(new UnremovableBeanBuildItem(
                    new UnremovableBeanBuildItem.BeanClassNameExclusion(MetricRegistry.class.getName())));
            unremovableBeans.produce(new UnremovableBeanBuildItem(
                    new UnremovableBeanBuildItem.BeanClassNameExclusion(MetricRegistries.class.getName())));
        }
        for (MetricBuildItem additionalMetric : additionalMetrics) {
            if (additionalMetric.isEnabled()) {
                TagHolder[] tags = Arrays.stream(additionalMetric.getTags())
                        .map(TagHolder::from)
                        .toArray(TagHolder[]::new);
                recorder.registerMetric(additionalMetric.getRegistryType(),
                        MetadataHolder.from(additionalMetric.getMetadata()),
                        tags,
                        additionalMetric.getImplementor());
            }
        }
    }
}
 
Example #9
Source File: CacheProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
@Record(RUNTIME_INIT)
void recordCachesBuild(CombinedIndexBuildItem combinedIndex, BeanContainerBuildItem beanContainer, CacheConfig config,
        CaffeineCacheBuildRecorder caffeineRecorder,
        List<AdditionalCacheNameBuildItem> additionalCacheNames,
        Optional<ManagedExecutorInitializedBuildItem> managedExecutorInitialized) {
    Set<String> cacheNames = getCacheNames(combinedIndex.getIndex());
    for (AdditionalCacheNameBuildItem additionalCacheName : additionalCacheNames) {
        cacheNames.add(additionalCacheName.getName());
    }
    switch (config.type) {
        case CacheDeploymentConstants.CAFFEINE_CACHE_TYPE:
            Set<CaffeineCacheInfo> cacheInfos = CaffeineCacheInfoBuilder.build(cacheNames, config);
            caffeineRecorder.buildCaches(managedExecutorInitialized.isPresent(), beanContainer.getValue(), cacheInfos);
            break;
        default:
            throw new DeploymentException("Unknown cache type: " + config.type);
    }
}
 
Example #10
Source File: SmallRyeMetricsProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
@Record(STATIC_INIT)
void createRoute(BuildProducer<RouteBuildItem> routes,
        SmallRyeMetricsRecorder recorder,
        HttpRootPathBuildItem httpRoot,
        BuildProducer<NotFoundPageDisplayableEndpointBuildItem> displayableEndpoints,
        LaunchModeBuildItem launchModeBuildItem) {
    Function<Router, Route> route = recorder.route(metrics.path + (metrics.path.endsWith("/") ? "*" : "/*"));
    Function<Router, Route> slash = recorder.route(metrics.path);

    // add metrics endpoint for not found display in dev or test mode
    if (launchModeBuildItem.getLaunchMode().isDevOrTest()) {
        displayableEndpoints.produce(new NotFoundPageDisplayableEndpointBuildItem(metrics.path));
    }
    routes.produce(new RouteBuildItem(route, recorder.handler(httpRoot.adjustPath(metrics.path)), HandlerType.BLOCKING));
    routes.produce(new RouteBuildItem(slash, recorder.handler(httpRoot.adjustPath(metrics.path)), HandlerType.BLOCKING));
}
 
Example #11
Source File: FunctionScannerBuildStep.java    From quarkus with Apache License 2.0 6 votes vote down vote up
@BuildStep
@Record(STATIC_INIT)
public FunctionInitializedBuildItem staticInit(FunctionRecorder recorder, List<FunctionBuildItem> functions,
        RecorderContext context) {
    if (functions == null || functions.isEmpty())
        return null;
    recorder.init();
    for (FunctionBuildItem function : functions) {
        if (function.getFunctionName() == null) {
            recorder.register(context.classProxy(function.getClassName()), function.getMethodName());
        } else {
            recorder.register(context.classProxy(function.getClassName()), function.getMethodName(),
                    function.getFunctionName());
        }
    }
    return FunctionInitializedBuildItem.SINGLETON;
}
 
Example #12
Source File: ElytronSecurityLdapProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
/**
 * Check to see if a LdapRealmConfig was specified and enabled and create a
 * {@linkplain org.wildfly.security.auth.realm.ldap.LdapSecurityRealm}
 *
 * @param recorder - runtime security recorder
 * @param securityRealm - the producer factory for the SecurityRealmBuildItem
 * @throws Exception - on any failure
 */
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void configureLdapRealmAuthConfig(LdapRecorder recorder,
        BuildProducer<SecurityRealmBuildItem> securityRealm,
        BeanContainerBuildItem beanContainerBuildItem //we need this to make sure ArC is initialized
) throws Exception {
    if (ldap.enabled) {
        RuntimeValue<SecurityRealm> realm = recorder.createRealm(ldap);
        securityRealm.produce(new SecurityRealmBuildItem(realm, ldap.realmName, null));
    }
}
 
Example #13
Source File: SmallRyeMetricsProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(RUNTIME_INIT)
void registerBaseAndVendorMetrics(SmallRyeMetricsRecorder metrics,
        ShutdownContextBuildItem shutdown,
        SmallRyeMetricsConfig config) {
    if (config.micrometerCompatibility) {
        metrics.registerMicrometerJvmMetrics(shutdown);
    } else {
        metrics.registerBaseMetrics();
        metrics.registerVendorMetrics();
    }
}
 
Example #14
Source File: OgnlProcessor.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
/**
 * Remove this once this extension starts supporting the native mode.
 */
@BuildStep(onlyIf = NativeBuild.class)
@Record(value = ExecutionTime.RUNTIME_INIT)
void warnJvmInNative(JvmOnlyRecorder recorder) {
    JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
    recorder.warnJvmInNative(FEATURE); // warn at runtime
}
 
Example #15
Source File: KafkaStreamsProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void configureAndLoadRocksDb(KafkaStreamsRecorder recorder, KafkaStreamsRuntimeConfig runtimeConfig) {
    // Explicitly loading RocksDB native libs, as that's normally done from within
    // static initializers which already ran during build
    recorder.loadRocksDb();

    recorder.configureRuntimeProperties(runtimeConfig);
}
 
Example #16
Source File: ReactiveDB2ClientProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
ServiceStartBuildItem build(BuildProducer<FeatureBuildItem> feature,
        BuildProducer<DB2PoolBuildItem> db2Pool,
        BuildProducer<VertxPoolBuildItem> vertxPool,
        DB2PoolRecorder recorder,
        VertxBuildItem vertx,
        BuildProducer<SyntheticBeanBuildItem> syntheticBeans, ShutdownContextBuildItem shutdown,
        DataSourcesBuildTimeConfig dataSourcesBuildTimeConfig, DataSourcesRuntimeConfig dataSourcesRuntimeConfig,
        DataSourceReactiveBuildTimeConfig dataSourceReactiveBuildTimeConfig,
        DataSourceReactiveRuntimeConfig dataSourceReactiveRuntimeConfig,
        DataSourceReactiveDB2Config dataSourceReactiveDB2Config) {

    feature.produce(new FeatureBuildItem(Feature.REACTIVE_DB2_CLIENT));
    // Make sure the DB2PoolProducer is initialized before the StartupEvent is fired
    ServiceStartBuildItem serviceStart = new ServiceStartBuildItem("reactive-db2-client");

    // Note: we had to tweak that logic to support the legacy configuration
    if (dataSourcesBuildTimeConfig.defaultDataSource.dbKind.isPresent()
            && (!DatabaseKind.isDB2(dataSourcesBuildTimeConfig.defaultDataSource.dbKind.get())
                    || !dataSourceReactiveBuildTimeConfig.enabled)) {
        return serviceStart;
    }

    RuntimeValue<DB2Pool> db2PoolValue = recorder.configureDB2Pool(vertx.getVertx(),
            dataSourcesRuntimeConfig, dataSourceReactiveRuntimeConfig, dataSourceReactiveDB2Config,
            shutdown);
    db2Pool.produce(new DB2PoolBuildItem(db2PoolValue));

    // Synthetic bean for DB2Pool
    syntheticBeans.produce(SyntheticBeanBuildItem.configure(DB2Pool.class).addType(Pool.class).scope(Singleton.class)
            .runtimeValue(db2PoolValue)
            .setRuntimeInit().done());

    boolean isDefault = true; // assume always the default pool for now
    vertxPool.produce(new VertxPoolBuildItem(db2PoolValue, DatabaseKind.DB2, isDefault));

    return serviceStart;
}
 
Example #17
Source File: AmazonLambdaProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
/**
 * This should only run when building a native image
 */
@BuildStep(onlyIf = NativeBuild.class)
@Record(value = ExecutionTime.RUNTIME_INIT)
void startPoolLoop(AmazonLambdaRecorder recorder,
        ShutdownContextBuildItem shutdownContextBuildItem,
        List<ServiceStartBuildItem> orderServicesFirst // try to order this after service recorders
) {
    recorder.startPollLoop(shutdownContextBuildItem);
}
 
Example #18
Source File: LifecycleEventsBuildStep.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(RUNTIME_INIT)
ApplicationStartBuildItem startupEvent(ArcRecorder recorder,
        List<ServiceStartBuildItem> startList,
        BeanContainerBuildItem beanContainer,
        ShutdownContextBuildItem shutdown) {
    recorder.handleLifecycleEvents(shutdown, beanContainer.getValue());
    return new ApplicationStartBuildItem();
}
 
Example #19
Source File: SqsProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void setupTransport(List<AmazonClientBuildItem> amazonClients, SqsRecorder recorder,
        AmazonClientTransportRecorder transportRecorder,
        SqsConfig runtimeConfig, BuildProducer<AmazonClientTransportsBuildItem> clientTransportBuildProducer) {

    createTransportBuilders(amazonClients,
            transportRecorder,
            buildTimeConfig.syncClient,
            recorder.getSyncConfig(runtimeConfig),
            recorder.getAsyncConfig(runtimeConfig),
            clientTransportBuildProducer);
}
 
Example #20
Source File: TestProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
/**
 * Have the runtime recorder start the service and install a shutdown hook
 *
 * @param recorder - runtime recorder
 * @param shutdownContextBuildItem - ShutdownContext information
 * @param serviceBuildItem - previously created RuntimeXmlConfigService container
 * @return ServiceStartBuildItem - build item indicating the RuntimeXmlConfigService startup
 * @throws IOException - on resource load failure
 */
@BuildStep
@Record(RUNTIME_INIT)
ServiceStartBuildItem startRuntimeService(TestRecorder recorder, ShutdownContextBuildItem shutdownContextBuildItem,
        RuntimeServiceBuildItem serviceBuildItem) throws IOException {
    if (serviceBuildItem != null) {
        log.info("Registering service start");
        recorder.startRuntimeService(shutdownContextBuildItem, serviceBuildItem.getService());
    } else {
        log.info("No RuntimeServiceBuildItem seen, check config.xml");
    }
    return new ServiceStartBuildItem("RuntimeXmlConfigService");
}
 
Example #21
Source File: PanacheJpaCommonResourceProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.STATIC_INIT)
void buildNamedQueryMap(List<PanacheNamedQueryEntityClassBuildStep> namedQueryEntityClasses,
        PanacheHibernateRecorder panacheHibernateRecorder) {
    Map<String, Set<String>> namedQueryMap = new HashMap<>();
    for (PanacheNamedQueryEntityClassBuildStep entityNamedQueries : namedQueryEntityClasses) {
        namedQueryMap.put(entityNamedQueries.getClassName(), entityNamedQueries.getNamedQueries());
    }

    panacheHibernateRecorder.setNamedQueryMap(namedQueryMap);
}
 
Example #22
Source File: MicroProfileMetricsProcessor.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep
RuntimeCamelContextCustomizerBuildItem runtimeContextCustomizer(
        CamelMicroProfileMetricsRecorder recorder,
        CamelMicroProfileMetricsConfig config) {

    return new RuntimeCamelContextCustomizerBuildItem(recorder.createRuntimeContextCustomizer(config));
}
 
Example #23
Source File: MicroProfileMetricsProcessor.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
CamelContextCustomizerBuildItem contextCustomizer(
        CamelMicroProfileMetricsRecorder recorder,
        CamelMicroProfileMetricsConfig config) {

    return new CamelContextCustomizerBuildItem(recorder.createContextCustomizer(config));
}
 
Example #24
Source File: DynamodbProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void setupTransport(List<AmazonClientBuildItem> amazonClients, DynamodbRecorder recorder,
        AmazonClientTransportRecorder transportRecorder,
        DynamodbConfig runtimeConfig, BuildProducer<AmazonClientTransportsBuildItem> clientTransportBuildProducer) {

    createTransportBuilders(amazonClients,
            transportRecorder,
            buildTimeConfig.syncClient,
            recorder.getSyncConfig(runtimeConfig),
            recorder.getAsyncConfig(runtimeConfig),
            clientTransportBuildProducer);
}
 
Example #25
Source File: FunqyLambdaBuildStep.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep()
@Record(STATIC_INIT)
public void init(List<FunctionBuildItem> functions,
        FunqyLambdaBindingRecorder recorder,
        Optional<FunctionInitializedBuildItem> hasFunctions,
        LambdaObjectMapperInitializedBuildItem mapperDependency,
        BeanContainerBuildItem beanContainer) throws Exception {
    if (!hasFunctions.isPresent() || hasFunctions.get() == null)
        return;
    recorder.init(beanContainer.getValue());
}
 
Example #26
Source File: ThreadPoolSetup.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(value = ExecutionTime.RUNTIME_INIT)
public ExecutorBuildItem createExecutor(ExecutorRecorder recorder, ShutdownContextBuildItem shutdownContextBuildItem,
        LaunchModeBuildItem launchModeBuildItem,
        ThreadPoolConfig threadPoolConfig) {
    return new ExecutorBuildItem(
            recorder.setupRunTime(shutdownContextBuildItem, threadPoolConfig, launchModeBuildItem.getLaunchMode()));
}
 
Example #27
Source File: TikaProcessor.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
CamelRuntimeBeanBuildItem tikaComponent(BeanContainerBuildItem beanContainer, TikaRecorder recorder) {
    return new CamelRuntimeBeanBuildItem(
            "tika",
            TikaComponent.class.getName(),
            recorder.createTikaComponent(beanContainer.getValue()));
}
 
Example #28
Source File: Neo4jDriverProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void configureDriverProducer(Neo4jDriverRecorder recorder, BeanContainerBuildItem beanContainerBuildItem,
        Neo4jConfiguration configuration,
        ShutdownContextBuildItem shutdownContext) {

    recorder.configureNeo4jProducer(beanContainerBuildItem.getValue(), configuration, shutdownContext);
}
 
Example #29
Source File: HttpSecurityProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
SyntheticBeanBuildItem initMtlsClientAuth(
        HttpSecurityRecorder recorder,
        HttpBuildTimeConfig buildTimeConfig) {
    if (isMtlsClientAuthenticationEnabled(buildTimeConfig)) {
        return SyntheticBeanBuildItem.configure(MtlsAuthenticationMechanism.class)
                .types(HttpAuthenticationMechanism.class)
                .setRuntimeInit()
                .scope(Singleton.class)
                .supplier(recorder.setupMtlsClientAuth()).done();
    }
    return null;
}
 
Example #30
Source File: AvroProcessor.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
/**
 * Remove this once this extension starts supporting the native mode.
 */
@BuildStep(onlyIf = NativeBuild.class)
@Record(value = ExecutionTime.RUNTIME_INIT)
void warnJvmInNative(JvmOnlyRecorder recorder) {
    JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
    recorder.warnJvmInNative(FEATURE); // warn at runtime
}