Search in sources :

Example 6 with RuntimeValue

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

the class CamelOpenTracingRecorder method createCamelOpenTracingTracer.

public RuntimeValue<OpenTracingTracer> createCamelOpenTracingTracer(CamelOpenTracingConfig camelOpenTracingConfig, BeanContainer beanContainer) {
    Tracer tracer = beanContainer.instance(Tracer.class);
    OpenTracingTracer openTracingTracer = new OpenTracingTracer();
    if (tracer != null) {
        openTracingTracer.setTracer(tracer);
        openTracingTracer.setEncoding(camelOpenTracingConfig.encoding);
        if (camelOpenTracingConfig.excludePatterns.isPresent()) {
            openTracingTracer.setExcludePatterns(new LinkedHashSet<>(camelOpenTracingConfig.excludePatterns.get()));
        }
    }
    return new RuntimeValue<>(openTracingTracer);
}
Also used : Tracer(io.opentracing.Tracer) OpenTracingTracer(org.apache.camel.opentracing.OpenTracingTracer) OpenTracingTracer(org.apache.camel.opentracing.OpenTracingTracer) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Example 7 with RuntimeValue

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

the class CamelJfrRecorder method createStartupStepRecorder.

public RuntimeValue<CamelContextCustomizer> createStartupStepRecorder(RuntimeCamelJfrConfig config) {
    CamelContextCustomizer flightRecorderCustomizer = new CamelContextCustomizer() {

        @Override
        public void configure(CamelContext camelContext) {
            FlightRecorderStartupStepRecorder flightRecorder = new FlightRecorderStartupStepRecorder();
            if (config.startupRecorderRecording.isPresent()) {
                flightRecorder.setRecording(config.startupRecorderRecording.get());
            }
            if (config.startupRecorderProfile.isPresent()) {
                flightRecorder.setRecordingProfile(config.startupRecorderProfile.get());
            }
            if (config.startupRecorderMaxDepth.isPresent()) {
                flightRecorder.setMaxDepth(config.startupRecorderMaxDepth.get());
            }
            if (config.startupRecorderDuration.isPresent()) {
                flightRecorder.setStartupRecorderDuration(config.startupRecorderDuration.get());
            }
            if (config.startupRecorderDir.isPresent()) {
                flightRecorder.setRecordingDir(config.startupRecorderDir.get());
            }
            camelContext.getExtension(ExtendedCamelContext.class).setStartupStepRecorder(flightRecorder);
            flightRecorder.setEnabled(true);
            flightRecorder.start();
        }
    };
    return new RuntimeValue<>(flightRecorderCustomizer);
}
Also used : CamelContext(org.apache.camel.CamelContext) ExtendedCamelContext(org.apache.camel.ExtendedCamelContext) CamelContextCustomizer(org.apache.camel.spi.CamelContextCustomizer) ExtendedCamelContext(org.apache.camel.ExtendedCamelContext) RuntimeValue(io.quarkus.runtime.RuntimeValue) FlightRecorderStartupStepRecorder(org.apache.camel.startup.jfr.FlightRecorderStartupStepRecorder)

Example 8 with RuntimeValue

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

the class CamelJpaRecorder method createJpaComponent.

public RuntimeValue<JpaComponent> createJpaComponent() {
    TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
    UserTransaction userTransaction = com.arjuna.ats.jta.UserTransaction.userTransaction();
    JpaComponent component = new JpaComponent();
    component.setTransactionManager(new JtaTransactionManager(userTransaction, transactionManager));
    return new RuntimeValue<>(component);
}
Also used : UserTransaction(javax.transaction.UserTransaction) JtaTransactionManager(org.springframework.transaction.jta.JtaTransactionManager) JtaTransactionManager(org.springframework.transaction.jta.JtaTransactionManager) TransactionManager(javax.transaction.TransactionManager) RuntimeValue(io.quarkus.runtime.RuntimeValue) JpaComponent(org.apache.camel.component.jpa.JpaComponent)

Example 9 with RuntimeValue

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

the class FhirContextRecorder method createR4FhirContext.

public RuntimeValue<FhirContext> createR4FhirContext(Collection<String> resourceDefinitions) {
    FhirContext fhirContext = FhirContext.forR4();
    initContext(resourceDefinitions, fhirContext);
    return new RuntimeValue<>(fhirContext);
}
Also used : FhirContext(ca.uhn.fhir.context.FhirContext) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Example 10 with RuntimeValue

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

the class CamelFreemarkerRecorder method createComponent.

public RuntimeValue<FreemarkerComponent> createComponent(BeanContainer beanContainer) {
    final Configuration configuration = beanContainer.instance(Configuration.class);
    final FreemarkerComponent component = new FreemarkerComponent();
    component.setConfiguration(configuration);
    return new RuntimeValue<>(component);
}
Also used : Configuration(freemarker.template.Configuration) FreemarkerComponent(org.apache.camel.component.freemarker.FreemarkerComponent) 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