Search in sources :

Example 1 with RuntimeValue

use of io.quarkus.runtime.RuntimeValue in project keycloak by keycloak.

the class KeycloakRecorder method createCacheInitializer.

public RuntimeValue<CacheManagerFactory> createCacheInitializer(String config, ShutdownContext shutdownContext) {
    try {
        CacheManagerFactory cacheManagerFactory = new CacheManagerFactory(config);
        shutdownContext.addShutdownTask(new Runnable() {

            @Override
            public void run() {
                DefaultCacheManager cacheManager = cacheManagerFactory.getOrCreate();
                if (cacheManager != null) {
                    cacheManager.stop();
                }
            }
        });
        return new RuntimeValue<>(cacheManagerFactory);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) RuntimeValue(io.quarkus.runtime.RuntimeValue) CacheManagerFactory(org.keycloak.quarkus.runtime.storage.infinispan.CacheManagerFactory)

Example 2 with RuntimeValue

use of io.quarkus.runtime.RuntimeValue in project camunda-bpm-platform by camunda.

the class CamundaEngineRecorder method createProcessEngineConfiguration.

public RuntimeValue<ProcessEngineConfigurationImpl> createProcessEngineConfiguration(BeanContainer beanContainer, CamundaEngineConfig config) {
    QuarkusProcessEngineConfiguration configuration = beanContainer.instance(QuarkusProcessEngineConfiguration.class);
    // apply properties from config before any other configuration.
    PropertyHelper.applyProperties(configuration, config.genericConfig, PropertyHelper.KEBAB_CASE);
    if (configuration.getDataSource() == null) {
        String datasource = config.datasource.orElse(DEFAULT_DATASOURCE_NAME);
        configuration.setDataSource(DataSources.fromName(datasource));
    }
    if (configuration.getTransactionManager() == null) {
        configuration.setTransactionManager(transactionManager());
    }
    // if not already configured by a custom configuration
    if (configuration.getJobExecutor() == null) {
        configureJobExecutor(configuration, config);
    }
    configureCdiEventBridge(configuration);
    return new RuntimeValue<>(configuration);
}
Also used : RuntimeValue(io.quarkus.runtime.RuntimeValue) QuarkusProcessEngineConfiguration(org.camunda.bpm.quarkus.engine.extension.QuarkusProcessEngineConfiguration)

Example 3 with RuntimeValue

use of io.quarkus.runtime.RuntimeValue in project quarkus-logging-logback by quarkiverse.

the class LogbackRecorder method createHandler.

public RuntimeValue<Optional<Handler>> createHandler() {
    started = true;
    for (DelayedStart i : DELAYED_START_HANDLERS) {
        i.doQuarkusDelayedStart();
    }
    DELAYED_START_HANDLERS.clear();
    return new RuntimeValue<>(Optional.of(new ExtHandler() {

        @Override
        public final void doPublish(final ExtLogRecord record) {
            if (defaultLoggerContext == null) {
                return;
            }
            Logger logger = defaultLoggerContext.getLogger(record.getLoggerName());
            logger.callAppenders(new LoggingEventWrapper(record, getFormatter()));
        }

        @Override
        public void flush() {
        }

        @Override
        public void close() throws SecurityException {
        }
    }));
}
Also used : ExtHandler(org.jboss.logmanager.ExtHandler) ExtLogRecord(org.jboss.logmanager.ExtLogRecord) RuntimeValue(io.quarkus.runtime.RuntimeValue) Logger(ch.qos.logback.classic.Logger)

Example 4 with RuntimeValue

use of io.quarkus.runtime.RuntimeValue in project camel-quarkus by apache.

the class PlatformHttpRecorder method createComponent.

public RuntimeValue<PlatformHttpComponent> createComponent(RuntimeValue<PlatformHttpEngine> engine) {
    PlatformHttpComponent component = new PlatformHttpComponent();
    component.setEngine(engine.getValue());
    return new RuntimeValue<>(component);
}
Also used : PlatformHttpComponent(org.apache.camel.component.platform.http.PlatformHttpComponent) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Example 5 with RuntimeValue

use of io.quarkus.runtime.RuntimeValue in project camel-quarkus by apache.

the class CamelMyBatisRecorder method createMyBatisBeanComponent.

public RuntimeValue<MyBatisBeanComponent> createMyBatisBeanComponent(RuntimeValue<SqlSessionFactory> sqlSessionFactory) {
    MyBatisBeanComponent component = new MyBatisBeanComponent();
    component.setSqlSessionFactory(sqlSessionFactory.getValue());
    return new RuntimeValue<>(component);
}
Also used : MyBatisBeanComponent(org.apache.camel.component.mybatis.MyBatisBeanComponent) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Aggregations

RuntimeValue (io.quarkus.runtime.RuntimeValue)31 FhirContext (ca.uhn.fhir.context.FhirContext)4 BuildStep (io.quarkus.deployment.annotations.BuildStep)2 Record (io.quarkus.deployment.annotations.Record)2 CamelContext (org.apache.camel.CamelContext)2 Component (org.apache.camel.Component)2 KnativeComponent (org.apache.camel.component.knative.KnativeComponent)2 CamelProducers (org.apache.camel.quarkus.core.CamelProducers)2 ComponentCustomizer (org.apache.camel.spi.ComponentCustomizer)2 Logger (ch.qos.logback.classic.Logger)1 AWSLogs (com.amazonaws.services.logs.AWSLogs)1 AWSLogsClientBuilder (com.amazonaws.services.logs.AWSLogsClientBuilder)1 Configuration (freemarker.template.Configuration)1 Tracer (io.opentracing.Tracer)1 CloudWatchCredentialsProvider (io.quarkiverse.logging.cloudwatch.auth.CloudWatchCredentialsProvider)1 AdditionalBeanBuildItem (io.quarkus.arc.deployment.AdditionalBeanBuildItem)1 BeanRegistrationPhaseBuildItem (io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem)1 UnremovableBeanBuildItem (io.quarkus.arc.deployment.UnremovableBeanBuildItem)1 BuildExtension (io.quarkus.arc.processor.BuildExtension)1 ApplicationArchive (io.quarkus.deployment.ApplicationArchive)1