Skip to content

Commit

Permalink
Upgrade quarkus to v0.19.0 apache#60
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Jul 10, 2019
1 parent eb38927 commit 0e0d0b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.quarkus.core.runtime.CamelConfig;
import org.apache.camel.quarkus.core.runtime.CamelProducers;
import org.apache.camel.quarkus.core.runtime.CamelRecorder;
import org.apache.camel.quarkus.core.runtime.CamelRuntime;
import org.apache.camel.quarkus.core.runtime.CamelTemplate;
import org.apache.camel.quarkus.core.runtime.CamelConfig.BuildTime;
import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry;
import org.eclipse.microprofile.config.Config;
Expand Down Expand Up @@ -70,7 +70,7 @@ class CamelInitProcessor {

@Record(ExecutionTime.STATIC_INIT)
@BuildStep(applicationArchiveMarkers = { CamelSupport.CAMEL_SERVICE_BASE_PATH, CamelSupport.CAMEL_ROOT_PACKAGE_DIRECTORY })
CamelRuntimeBuildItem createInitTask(RecorderContext recorderContext, CamelTemplate template,
CamelRuntimeBuildItem createInitTask(RecorderContext recorderContext, CamelRecorder recorder,
BuildProducer<RuntimeBeanBuildItem> runtimeBeans) {
Properties properties = new Properties();
Config configProvider = ConfigProvider.getConfig();
Expand All @@ -93,7 +93,7 @@ CamelRuntimeBuildItem createInitTask(RecorderContext recorderContext, CamelTempl
recorderContext.newInstance(type.getName()));
});

RuntimeValue<CamelRuntime> camelRuntime = template.create(registry, properties, builders);
RuntimeValue<CamelRuntime> camelRuntime = recorder.create(registry, properties, builders);

runtimeBeans
.produce(RuntimeBeanBuildItem.builder(CamelRuntime.class).setRuntimeValue(camelRuntime).build());
Expand All @@ -106,11 +106,11 @@ CamelRuntimeBuildItem createInitTask(RecorderContext recorderContext, CamelTempl
AdditionalBeanBuildItem createCamelProducers(
RecorderContext recorderContext,
CamelRuntimeBuildItem runtime,
CamelTemplate template,
CamelRecorder recorder,
BuildProducer<BeanContainerListenerBuildItem> listeners) {

listeners
.produce(new BeanContainerListenerBuildItem(template.initRuntimeInjection(runtime.getRuntime())));
.produce(new BeanContainerListenerBuildItem(recorder.initRuntimeInjection(runtime.getRuntime())));

return AdditionalBeanBuildItem.unremovableOf(CamelProducers.class);
}
Expand All @@ -120,21 +120,21 @@ AdditionalBeanBuildItem createCamelProducers(
void createInitTask(
BeanContainerBuildItem beanContainerBuildItem,
CamelRuntimeBuildItem runtime,
CamelTemplate template) throws Exception {
CamelRecorder recorder) throws Exception {

template.init(beanContainerBuildItem.getValue(), runtime.getRuntime(), buildTimeConfig);
recorder.init(beanContainerBuildItem.getValue(), runtime.getRuntime(), buildTimeConfig);
}

@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep(applicationArchiveMarkers = { CamelSupport.CAMEL_SERVICE_BASE_PATH, CamelSupport.CAMEL_ROOT_PACKAGE_DIRECTORY })
void createRuntimeInitTask(
CamelTemplate template,
CamelRecorder recorder,
CamelRuntimeBuildItem runtime,
ShutdownContextBuildItem shutdown,
CamelConfig.Runtime runtimeConfig)
throws Exception {

template.start(shutdown, runtime.getRuntime(), runtimeConfig);
recorder.start(shutdown, runtime.getRuntime(), runtimeConfig);
}

protected Stream<String> getBuildTimeRouteBuilderClasses() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
import java.util.Properties;
import java.util.stream.Collectors;

import org.apache.camel.RoutesBuilder;
import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime;
import org.apache.camel.spi.Registry;

import io.quarkus.arc.runtime.BeanContainer;
import io.quarkus.arc.runtime.BeanContainerListener;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.ShutdownContext;
import io.quarkus.runtime.annotations.Template;
import io.quarkus.runtime.annotations.Recorder;
import org.apache.camel.RoutesBuilder;
import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime;
import org.apache.camel.spi.Registry;

@Template
public class CamelTemplate {
@Recorder
public class CamelRecorder {

public RuntimeValue<CamelRuntime> create(
Registry registry,
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<camel.version>3.0.0-M2</camel.version>
<quarkus.version>0.18.0</quarkus.version>
<quarkus.version>0.19.0</quarkus.version>

<version.compiler.plugin>3.8.0</version.compiler.plugin>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down

0 comments on commit 0e0d0b7

Please sign in to comment.