This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 6a4f0d5e921818c6e955dac747d78194cf0db9fc Author: Guillaume Nodet <gno...@gmail.com> AuthorDate: Tue Sep 3 15:27:59 2019 +0200 Remove support for defer-init-phase, fixes #172 --- .../camel/quarkus/core/runtime/CamelConfig.java | 6 ---- ..._org_apache_camel_reifier_ProcessorReifier.java | 34 ---------------------- ...camel_reifier_dataformat_DataFormatReifier.java | 34 ---------------------- ...l_reifier_loadbalancer_LoadBalancerReifier.java | 34 ---------------------- ...mel_reifier_transformer_TransformerReifier.java | 34 ---------------------- ...e_camel_reifier_validator_ValidatorReifier.java | 34 ---------------------- .../core/runtime/support/FastCamelRuntime.java | 8 +---- .../camel/quarkus/core/runtime/support/Flags.java | 6 ---- .../aws/src/main/resources/application.properties | 2 -- .../bean/src/main/resources/application.properties | 2 -- .../src/main/resources/application.properties | 2 -- .../src/main/resources/application.properties | 2 -- .../test/src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 3 -- .../src/main/resources/application.properties | 2 -- .../src/main/resources/application.properties | 2 -- .../src/main/resources/application.properties | 2 -- 17 files changed, 1 insertion(+), 207 deletions(-) diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java index a358925..a5bb9b4 100644 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java +++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java @@ -35,12 +35,6 @@ public class CamelConfig { public List<String> routesUris; /** - * Defer Camel context initialization phase until runtime. - */ - @ConfigItem(defaultValue = "false") - public boolean deferInitPhase; - - /** * Camel jaxb support is enabled by default, but in order to trim * down the size of applications, it is possible to disable jaxb support * at runtime. This is useful when routes at loaded at build time and diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_ProcessorReifier.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_ProcessorReifier.java deleted file mode 100644 index 0135441..0000000 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_ProcessorReifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.core.runtime.graal; - -import java.util.Map; -import java.util.function.Function; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.model.ProcessorDefinition; -import org.apache.camel.quarkus.core.runtime.support.Flags; -import org.apache.camel.reifier.ProcessorReifier; - -@TargetClass(className = "org.apache.camel.reifier.ProcessorReifier", onlyWith = Flags.InitAtBuildTime.class) -final class Target_org_apache_camel_reifier_ProcessorReifier { - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias) - private static Map<Class<?>, Function<ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>>> PROCESSORS = null; -} diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_dataformat_DataFormatReifier.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_dataformat_DataFormatReifier.java deleted file mode 100644 index 33a9b12..0000000 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_dataformat_DataFormatReifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.core.runtime.graal; - -import java.util.Map; -import java.util.function.Function; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.model.DataFormatDefinition; -import org.apache.camel.quarkus.core.runtime.support.Flags; -import org.apache.camel.reifier.dataformat.DataFormatReifier; - -@TargetClass(className = "org.apache.camel.reifier.dataformat.DataFormatReifier", onlyWith = Flags.InitAtBuildTime.class) -final class Target_org_apache_camel_reifier_dataformat_DataFormatReifier { - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias) - private static Map<Class<?>, Function<DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>>> DATAFORMATS = null; -} diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_loadbalancer_LoadBalancerReifier.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_loadbalancer_LoadBalancerReifier.java deleted file mode 100644 index b67872a..0000000 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_loadbalancer_LoadBalancerReifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.core.runtime.graal; - -import java.util.Map; -import java.util.function.Function; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.model.LoadBalancerDefinition; -import org.apache.camel.quarkus.core.runtime.support.Flags; -import org.apache.camel.reifier.loadbalancer.LoadBalancerReifier; - -@TargetClass(className = "org.apache.camel.reifier.loadbalancer.LoadBalancerReifier", onlyWith = Flags.InitAtBuildTime.class) -final class Target_org_apache_camel_reifier_loadbalancer_LoadBalancerReifier { - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias) - private static Map<Class<?>, Function<LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>>> LOAD_BALANCERS = null; -} diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_transformer_TransformerReifier.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_transformer_TransformerReifier.java deleted file mode 100644 index 8eb6ce7..0000000 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_transformer_TransformerReifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.core.runtime.graal; - -import java.util.Map; -import java.util.function.Function; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.model.transformer.TransformerDefinition; -import org.apache.camel.quarkus.core.runtime.support.Flags; -import org.apache.camel.reifier.transformer.TransformerReifier; - -@TargetClass(className = "org.apache.camel.reifier.transformer.TransformerReifier", onlyWith = Flags.InitAtBuildTime.class) -final class Target_org_apache_camel_reifier_transformer_TransformerReifier { - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias) - private static Map<Class<?>, Function<TransformerDefinition, TransformerReifier<? extends TransformerDefinition>>> TRANSFORMERS = null; -} diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_validator_ValidatorReifier.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_validator_ValidatorReifier.java deleted file mode 100644 index a5249ca..0000000 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/Target_org_apache_camel_reifier_validator_ValidatorReifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.core.runtime.graal; - -import java.util.Map; -import java.util.function.Function; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.RecomputeFieldValue; -import com.oracle.svm.core.annotate.TargetClass; -import org.apache.camel.model.validator.ValidatorDefinition; -import org.apache.camel.quarkus.core.runtime.support.Flags; -import org.apache.camel.reifier.validator.ValidatorReifier; - -@TargetClass(className = "org.apache.camel.reifier.validator.ValidatorReifier", onlyWith = Flags.InitAtBuildTime.class) -final class Target_org_apache_camel_reifier_validator_ValidatorReifier { - @Alias - @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias) - private static Map<Class<?>, Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>>> VALIDATORS = null; -} diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java index 232c428..efc4a05 100644 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java +++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java @@ -104,10 +104,6 @@ public class FastCamelRuntime implements CamelRuntime { context.adapt(FastCamelContext.class).setModel(model); fireEvent(InitializedEvent.class, new InitializedEvent()); - - if (!buildTimeConfig.deferInitPhase) { - loadRoutes(context); - } } catch (Exception e) { throw RuntimeCamelException.wrapRuntimeCamelException(e); } @@ -116,9 +112,7 @@ public class FastCamelRuntime implements CamelRuntime { public void doStart() throws Exception { fireEvent(StartingEvent.class, new StartingEvent()); - if (buildTimeConfig.deferInitPhase) { - loadRoutes(context); - } + loadRoutes(context); context.start(); fireEvent(StartedEvent.class, new StartedEvent()); diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java index 8b34611..69247e2 100644 --- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java +++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java @@ -38,10 +38,4 @@ public final class Flags { } } - public static final class InitAtBuildTime implements BooleanSupplier { - @Override - public boolean getAsBoolean() { - return !ConfigProvider.getConfig().getOptionalValue("quarkus.camel.defer-init-phase", Boolean.class).orElse(Boolean.TRUE); - } - } } diff --git a/integration-tests/aws/src/main/resources/application.properties b/integration-tests/aws/src/main/resources/application.properties index b40bf30..936ed0f 100644 --- a/integration-tests/aws/src/main/resources/application.properties +++ b/integration-tests/aws/src/main/resources/application.properties @@ -26,8 +26,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel # diff --git a/integration-tests/bean/src/main/resources/application.properties b/integration-tests/bean/src/main/resources/application.properties index b87f452..fe14ab2 100644 --- a/integration-tests/bean/src/main/resources/application.properties +++ b/integration-tests/bean/src/main/resources/application.properties @@ -26,8 +26,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel # diff --git a/integration-tests/core-cdi/src/main/resources/application.properties b/integration-tests/core-cdi/src/main/resources/application.properties index 925ec45..f258d12 100644 --- a/integration-tests/core-cdi/src/main/resources/application.properties +++ b/integration-tests/core-cdi/src/main/resources/application.properties @@ -25,8 +25,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=false quarkus.camel.disable-jaxb=false quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel # diff --git a/integration-tests/core-impl/src/main/resources/application.properties b/integration-tests/core-impl/src/main/resources/application.properties index 8f520a6..775072e 100644 --- a/integration-tests/core-impl/src/main/resources/application.properties +++ b/integration-tests/core-impl/src/main/resources/application.properties @@ -25,8 +25,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel # diff --git a/integration-tests/core/test/src/main/resources/application.properties b/integration-tests/core/test/src/main/resources/application.properties index 83b6cc3..b441636 100644 --- a/integration-tests/core/test/src/main/resources/application.properties +++ b/integration-tests/core/test/src/main/resources/application.properties @@ -25,7 +25,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true # # Camel diff --git a/integration-tests/netty-http/src/main/resources/application.properties b/integration-tests/netty-http/src/main/resources/application.properties index 623b297..603d5f3 100644 --- a/integration-tests/netty-http/src/main/resources/application.properties +++ b/integration-tests/netty-http/src/main/resources/application.properties @@ -25,9 +25,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=false - - # # Camel # diff --git a/integration-tests/salesforce/src/main/resources/application.properties b/integration-tests/salesforce/src/main/resources/application.properties index 675d16e..1b8f25e 100644 --- a/integration-tests/salesforce/src/main/resources/application.properties +++ b/integration-tests/salesforce/src/main/resources/application.properties @@ -22,8 +22,6 @@ quarkus.ssl.native=true quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel # diff --git a/integration-tests/servlet/src/main/resources/application.properties b/integration-tests/servlet/src/main/resources/application.properties index 01b95d1..387415e 100644 --- a/integration-tests/servlet/src/main/resources/application.properties +++ b/integration-tests/servlet/src/main/resources/application.properties @@ -26,8 +26,6 @@ quarkus.ssl.native=true quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=false - # # Quarkus :: Camel :: Servlet # diff --git a/integration-tests/twitter/src/main/resources/application.properties b/integration-tests/twitter/src/main/resources/application.properties index ca98170..c0f95bf 100644 --- a/integration-tests/twitter/src/main/resources/application.properties +++ b/integration-tests/twitter/src/main/resources/application.properties @@ -26,8 +26,6 @@ quarkus.log.file.enable = false quarkus.camel.disable-xml=true quarkus.camel.disable-jaxb=true quarkus.camel.dump-routes=true -quarkus.camel.defer-init-phase=true - # # Camel #