This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 16c1802d473c8b27ecba9f52d48c52e6c4ab892d
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Nov 6 13:40:55 2020 +0100

    CAMEL-15826: camel-main - Remove autowire by type
---
 .../impl/engine/DefaultCamelBeanPostProcessor.java |   9 ++
 .../FaultToleranceConfigurationDefinition.java     |   2 +-
 .../model/HystrixConfigurationDefinition.java      |   2 +-
 .../model/Resilience4jConfigurationDefinition.java |   2 +-
 ...opertyBindingSupportAutowireNestedDeepTest.java | 118 --------------
 .../PropertyBindingSupportAutowireNestedTest.java  |  21 ---
 .../PropertyBindingSupportAutowireTest.java        | 109 -------------
 .../PropertyBindingSupportConfigurerTest.java      |  10 --
 ...ToleranceConfigurationPropertiesConfigurer.java |   2 +
 ...althCheckConfigurationPropertiesConfigurer.java |   2 +
 .../HealthConfigurationPropertiesConfigurer.java   |   2 +
 .../HystrixConfigurationPropertiesConfigurer.java  |   2 +
 .../main/LraConfigurationPropertiesConfigurer.java |   2 +
 .../MainConfigurationPropertiesConfigurer.java     |  30 +---
 ...ilience4jConfigurationPropertiesConfigurer.java |   2 +
 .../RestConfigurationPropertiesConfigurer.java     |   2 +
 ...hreadPoolConfigurationPropertiesConfigurer.java |   2 +
 .../camel-main-configuration-metadata.json         |   4 -
 core/camel-main/src/main/docs/main.adoc            |   4 -
 .../org/apache/camel/main/BaseMainSupport.java     |  27 ----
 .../FaultToleranceConfigurationProperties.java     |   2 +-
 .../main/HealthCheckConfigurationProperties.java   |   2 +-
 .../camel/main/HealthConfigurationProperties.java  |   2 +-
 .../camel/main/HystrixConfigurationProperties.java |   2 +-
 .../camel/main/LraConfigurationProperties.java     |   2 +-
 .../camel/main/MainConfigurationProperties.java    | 113 +-------------
 .../main/Resilience4jConfigurationProperties.java  |   2 +-
 .../camel/main/RestConfigurationProperties.java    |   2 +-
 .../main/ThreadPoolConfigurationProperties.java    |   2 +-
 .../org/apache/camel/main/MainIoCAutowireTest.java | 173 ---------------------
 .../java/org/apache/camel/main/MainIoCTest.java    |  18 ++-
 .../java/org/apache/camel/main/MainSedaTest.java   |  24 ---
 .../camel/support/PropertyBindingSupport.java      | 167 --------------------
 33 files changed, 51 insertions(+), 814 deletions(-)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelBeanPostProcessor.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelBeanPostProcessor.java
index dfd105e..20fac01 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelBeanPostProcessor.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelBeanPostProcessor.java
@@ -468,6 +468,9 @@ public class DefaultCamelBeanPostProcessor implements 
CamelBeanPostProcessor {
                 throw RuntimeCamelException.wrapRuntimeException(e);
             }
         }
+        if (bean instanceof CamelContextAware) {
+            ((CamelContextAware) 
bean).setCamelContext(getOrLookupCamelContext());
+        }
         getOrLookupCamelContext().getRegistry().bind(name, bean);
     }
 
@@ -487,6 +490,9 @@ public class DefaultCamelBeanPostProcessor implements 
CamelBeanPostProcessor {
                     throw RuntimeCamelException.wrapRuntimeException(e);
                 }
             }
+            if (value instanceof CamelContextAware) {
+                ((CamelContextAware) 
value).setCamelContext(getOrLookupCamelContext());
+            }
             getOrLookupCamelContext().getRegistry().bind(name, value);
         }
     }
@@ -520,6 +526,9 @@ public class DefaultCamelBeanPostProcessor implements 
CamelBeanPostProcessor {
                     throw RuntimeCamelException.wrapRuntimeException(e);
                 }
             }
+            if (value instanceof CamelContextAware) {
+                ((CamelContextAware) 
value).setCamelContext(getOrLookupCamelContext());
+            }
             getOrLookupCamelContext().getRegistry().bind(name, value);
         }
     }
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/FaultToleranceConfigurationDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/FaultToleranceConfigurationDefinition.java
index 56c12a8..e89e292 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/FaultToleranceConfigurationDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/FaultToleranceConfigurationDefinition.java
@@ -30,7 +30,7 @@ import org.apache.camel.spi.Metadata;
 @Metadata(label = "eip,routing,circuitbreaker")
 @XmlRootElement(name = "faultToleranceConfiguration")
 @XmlAccessorType(XmlAccessType.FIELD)
-@Configurer(api = true)
+@Configurer
 public class FaultToleranceConfigurationDefinition extends 
FaultToleranceConfigurationCommon {
 
     @XmlTransient
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/HystrixConfigurationDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/HystrixConfigurationDefinition.java
index c8e5c8f..25b7fab 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/HystrixConfigurationDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/HystrixConfigurationDefinition.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.Metadata;
 @Metadata(label = "eip,routing,circuitbreaker")
 @XmlRootElement(name = "hystrixConfiguration")
 @XmlAccessorType(XmlAccessType.FIELD)
-@Configurer(api = true)
+@Configurer
 @Deprecated
 public class HystrixConfigurationDefinition extends HystrixConfigurationCommon 
{
 
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
index 2ab6f0b..0ea39fb 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
@@ -32,7 +32,7 @@ import org.apache.camel.spi.Metadata;
 @Metadata(label = "eip,routing,circuitbreaker")
 @XmlRootElement(name = "resilience4jConfiguration")
 @XmlAccessorType(XmlAccessType.FIELD)
-@Configurer(api = true)
+@Configurer
 public class Resilience4jConfigurationDefinition extends 
Resilience4jConfigurationCommon {
 
     @XmlTransient
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedDeepTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedDeepTest.java
deleted file mode 100644
index a40402a..0000000
--- 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedDeepTest.java
+++ /dev/null
@@ -1,118 +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.support;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-/**
- * Unit test for PropertyBindingSupport
- */
-public class PropertyBindingSupportAutowireNestedDeepTest extends 
ContextTestSupport {
-
-    @Override
-    protected CamelContext createCamelContext() throws Exception {
-        CamelContext context = super.createCamelContext();
-
-        Company work = new Company();
-        work.setId(456);
-        work.setName("Acme");
-        context.getRegistry().bind("myWork", work);
-
-        return context;
-    }
-
-    @Test
-    public void testAutowirePropertiesDeep() throws Exception {
-        Foo foo = new Foo();
-
-        PropertyBindingSupport.build().bind(context, foo, "name", "James");
-        // use deep nesting
-        
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(context, foo, 
false, true, null);
-
-        assertEquals("James", foo.getName());
-        // should be auto wired (deep)
-        assertNotNull(foo.getBar().getWork());
-        assertEquals(456, foo.getBar().getWork().getId());
-        assertEquals("Acme", foo.getBar().getWork().getName());
-    }
-
-    public static class Foo {
-        private String name;
-        private Bar bar;
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public Bar getBar() {
-            return bar;
-        }
-
-        public void setBar(Bar bar) {
-            this.bar = bar;
-        }
-    }
-
-    public static class Bar {
-        private int age;
-        private boolean rider;
-        private Company work;
-        private boolean goldCustomer;
-
-        public int getAge() {
-            return age;
-        }
-
-        public void setAge(int age) {
-            this.age = age;
-        }
-
-        public boolean isRider() {
-            return rider;
-        }
-
-        public void setRider(boolean rider) {
-            this.rider = rider;
-        }
-
-        public Company getWork() {
-            return work;
-        }
-
-        public void setWork(Company work) {
-            this.work = work;
-        }
-
-        public boolean isGoldCustomer() {
-            return goldCustomer;
-        }
-
-        public void setGoldCustomer(boolean goldCustomer) {
-            this.goldCustomer = goldCustomer;
-        }
-    }
-
-}
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedTest.java
index ba716ce..c67816d 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireNestedTest.java
@@ -47,7 +47,6 @@ public class PropertyBindingSupportAutowireNestedTest extends 
ContextTestSupport
         PropertyBindingSupport.build().bind(context, foo, "bar.age", "33");
         PropertyBindingSupport.build().bind(context, foo, "bar.rider", "true");
         PropertyBindingSupport.build().bind(context, foo, "bar.gold-customer", 
"true");
-        
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(context, foo, 
false, false, null);
 
         assertEquals("James", foo.getName());
         assertEquals(33, foo.getBar().getAge());
@@ -57,26 +56,6 @@ public class PropertyBindingSupportAutowireNestedTest 
extends ContextTestSupport
         assertNull(foo.getBar().getWork());
     }
 
-    @Test
-    public void testAutowirePropertiesNested() throws Exception {
-        Foo foo = new Foo();
-
-        PropertyBindingSupport.build().bind(context, foo, "name", "James");
-        PropertyBindingSupport.build().bind(context, foo, "bar.age", "33");
-        PropertyBindingSupport.build().bind(context, foo, "bar.rider", "true");
-        PropertyBindingSupport.build().bind(context, foo, "bar.gold-customer", 
"true");
-        
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(context, foo, 
false, true, null);
-
-        assertEquals("James", foo.getName());
-        assertEquals(33, foo.getBar().getAge());
-        assertTrue(foo.getBar().isRider());
-        assertTrue(foo.getBar().isGoldCustomer());
-        // should be auto wired
-        assertNotNull(foo.getBar().getWork());
-        assertEquals(456, foo.getBar().getWork().getId());
-        assertEquals("Acme", foo.getBar().getWork().getName());
-    }
-
     public static class Foo {
         private String name;
         private Bar bar = new Bar(this);
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireTest.java
deleted file mode 100644
index bfe94f8..0000000
--- 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportAutowireTest.java
+++ /dev/null
@@ -1,109 +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.support;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- * Unit test for PropertyBindingSupport
- */
-public class PropertyBindingSupportAutowireTest extends ContextTestSupport {
-
-    @Override
-    protected CamelContext createCamelContext() throws Exception {
-        CamelContext context = super.createCamelContext();
-
-        Bar bar = new Bar();
-        bar.setAge(33);
-        bar.setGoldCustomer(true);
-        bar.setRider(true);
-        context.getRegistry().bind("myBar", bar);
-
-        return context;
-    }
-
-    @Test
-    public void testAutowireProperties() throws Exception {
-        Foo foo = new Foo();
-
-        PropertyBindingSupport.build().bind(context, foo, "name", "James");
-        
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(context, foo);
-
-        assertEquals("James", foo.getName());
-        // should be auto wired
-        assertEquals(33, foo.getBar().getAge());
-        assertTrue(foo.getBar().isRider());
-        assertTrue(foo.getBar().isGoldCustomer());
-    }
-
-    public static class Foo {
-        private String name;
-        private Bar bar;
-
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public Bar getBar() {
-            return bar;
-        }
-
-        public void setBar(Bar bar) {
-            this.bar = bar;
-        }
-    }
-
-    public static class Bar {
-        private int age;
-        private boolean rider;
-        private boolean goldCustomer;
-
-        public int getAge() {
-            return age;
-        }
-
-        public void setAge(int age) {
-            this.age = age;
-        }
-
-        public boolean isRider() {
-            return rider;
-        }
-
-        public void setRider(boolean rider) {
-            this.rider = rider;
-        }
-
-        public boolean isGoldCustomer() {
-            return goldCustomer;
-        }
-
-        public void setGoldCustomer(boolean goldCustomer) {
-            this.goldCustomer = goldCustomer;
-        }
-    }
-
-}
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportConfigurerTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportConfigurerTest.java
index 3fc0389..d0899e4 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportConfigurerTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportConfigurerTest.java
@@ -277,16 +277,6 @@ public class PropertyBindingSupportConfigurerTest extends 
ContextTestSupport {
         assertTrue(prop.isEmpty(), "Should bind all properties");
     }
 
-    @Test
-    public void testConfigurerShouldNotFailForAnonymousClasses() throws 
Exception {
-        
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(context, new 
Bar() {
-            @Override
-            public int getAge() {
-                return super.getAge();
-            }
-        });
-    }
-
     public static class Bar {
         private int age;
         private boolean rider;
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/FaultToleranceConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/FaultToleranceConfigurationPropertiesConfigurer.java
index c097d62..f987531 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/FaultToleranceConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/FaultToleranceConfigurationPropertiesConfigurer.java
@@ -33,6 +33,7 @@ public class FaultToleranceConfigurationPropertiesConfigurer 
extends org.apache.
         map.put("TimeoutPoolSize", java.lang.Integer.class);
         map.put("TimeoutScheduledExecutorServiceRef", java.lang.String.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(FaultToleranceConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -75,6 +76,7 @@ public class FaultToleranceConfigurationPropertiesConfigurer 
extends org.apache.
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
index 3158de0..4a15fda 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
@@ -24,6 +24,7 @@ public class HealthCheckConfigurationPropertiesConfigurer 
extends org.apache.cam
         map.put("Interval", long.class);
         map.put("Parent", java.lang.String.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(HealthCheckConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -48,6 +49,7 @@ public class HealthCheckConfigurationPropertiesConfigurer 
extends org.apache.cam
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
index 8577902..3aa7141 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
@@ -25,6 +25,7 @@ public class HealthConfigurationPropertiesConfigurer extends 
org.apache.camel.su
         map.put("RegistryEnabled", java.lang.Boolean.class);
         map.put("RoutesEnabled", java.lang.Boolean.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(HealthConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -51,6 +52,7 @@ public class HealthConfigurationPropertiesConfigurer extends 
org.apache.camel.su
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/HystrixConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/HystrixConfigurationPropertiesConfigurer.java
index 4530109..3a89ffa 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/HystrixConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/HystrixConfigurationPropertiesConfigurer.java
@@ -51,6 +51,7 @@ public class HystrixConfigurationPropertiesConfigurer extends 
org.apache.camel.s
         map.put("ThreadPoolRollingNumberStatisticalWindowBuckets", 
java.lang.Integer.class);
         map.put("ThreadPoolRollingNumberStatisticalWindowInMilliseconds", 
java.lang.Integer.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(HystrixConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -129,6 +130,7 @@ public class HystrixConfigurationPropertiesConfigurer 
extends org.apache.camel.s
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/LraConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/LraConfigurationPropertiesConfigurer.java
index aa4f314..0040c2f 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/LraConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/LraConfigurationPropertiesConfigurer.java
@@ -24,6 +24,7 @@ public class LraConfigurationPropertiesConfigurer extends 
org.apache.camel.suppo
         map.put("LocalParticipantContextPath", java.lang.String.class);
         map.put("LocalParticipantUrl", java.lang.String.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(LraConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -48,6 +49,7 @@ public class LraConfigurationPropertiesConfigurer extends 
org.apache.camel.suppo
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
index 987b035..7d59c4d 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
@@ -25,10 +25,6 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         map.put("AutoConfigurationFailFast", boolean.class);
         map.put("AutoConfigurationLogSummary", boolean.class);
         map.put("AutoStartup", boolean.class);
-        map.put("AutowireComponentProperties", boolean.class);
-        map.put("AutowireComponentPropertiesAllowPrivateSetter", 
boolean.class);
-        map.put("AutowireComponentPropertiesDeep", boolean.class);
-        map.put("AutowireComponentPropertiesNonNullOnly", boolean.class);
         map.put("BacklogTracing", boolean.class);
         map.put("BeanIntrospectionExtendedStatistics", boolean.class);
         map.put("BeanIntrospectionLoggingLevel", 
org.apache.camel.LoggingLevel.class);
@@ -104,6 +100,7 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         map.put("XmlRouteTemplates", java.lang.String.class);
         map.put("XmlRoutes", java.lang.String.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(MainConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -122,14 +119,6 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "AutoConfigurationLogSummary": 
target.setAutoConfigurationLogSummary(property(camelContext, boolean.class, 
value)); return true;
         case "autostartup":
         case "AutoStartup": target.setAutoStartup(property(camelContext, 
boolean.class, value)); return true;
-        case "autowirecomponentproperties":
-        case "AutowireComponentProperties": 
target.setAutowireComponentProperties(property(camelContext, boolean.class, 
value)); return true;
-        case "autowirecomponentpropertiesallowprivatesetter":
-        case "AutowireComponentPropertiesAllowPrivateSetter": 
target.setAutowireComponentPropertiesAllowPrivateSetter(property(camelContext, 
boolean.class, value)); return true;
-        case "autowirecomponentpropertiesdeep":
-        case "AutowireComponentPropertiesDeep": 
target.setAutowireComponentPropertiesDeep(property(camelContext, boolean.class, 
value)); return true;
-        case "autowirecomponentpropertiesnonnullonly":
-        case "AutowireComponentPropertiesNonNullOnly": 
target.setAutowireComponentPropertiesNonNullOnly(property(camelContext, 
boolean.class, value)); return true;
         case "backlogtracing":
         case "BacklogTracing": target.setBacklogTracing(property(camelContext, 
boolean.class, value)); return true;
         case "beanintrospectionextendedstatistics":
@@ -288,6 +277,7 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
@@ -305,14 +295,6 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "AutoConfigurationLogSummary": return boolean.class;
         case "autostartup":
         case "AutoStartup": return boolean.class;
-        case "autowirecomponentproperties":
-        case "AutowireComponentProperties": return boolean.class;
-        case "autowirecomponentpropertiesallowprivatesetter":
-        case "AutowireComponentPropertiesAllowPrivateSetter": return 
boolean.class;
-        case "autowirecomponentpropertiesdeep":
-        case "AutowireComponentPropertiesDeep": return boolean.class;
-        case "autowirecomponentpropertiesnonnullonly":
-        case "AutowireComponentPropertiesNonNullOnly": return boolean.class;
         case "backlogtracing":
         case "BacklogTracing": return boolean.class;
         case "beanintrospectionextendedstatistics":
@@ -481,14 +463,6 @@ public class MainConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         case "AutoConfigurationLogSummary": return 
target.isAutoConfigurationLogSummary();
         case "autostartup":
         case "AutoStartup": return target.isAutoStartup();
-        case "autowirecomponentproperties":
-        case "AutowireComponentProperties": return 
target.isAutowireComponentProperties();
-        case "autowirecomponentpropertiesallowprivatesetter":
-        case "AutowireComponentPropertiesAllowPrivateSetter": return 
target.isAutowireComponentPropertiesAllowPrivateSetter();
-        case "autowirecomponentpropertiesdeep":
-        case "AutowireComponentPropertiesDeep": return 
target.isAutowireComponentPropertiesDeep();
-        case "autowirecomponentpropertiesnonnullonly":
-        case "AutowireComponentPropertiesNonNullOnly": return 
target.isAutowireComponentPropertiesNonNullOnly();
         case "backlogtracing":
         case "BacklogTracing": return target.isBacklogTracing();
         case "beanintrospectionextendedstatistics":
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/Resilience4jConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/Resilience4jConfigurationPropertiesConfigurer.java
index 5859dcb..cd532c4 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/Resilience4jConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/Resilience4jConfigurationPropertiesConfigurer.java
@@ -39,6 +39,7 @@ public class Resilience4jConfigurationPropertiesConfigurer 
extends org.apache.ca
         map.put("WaitDurationInOpenState", java.lang.Integer.class);
         map.put("WritableStackTraceEnabled", java.lang.Boolean.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(Resilience4jConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -93,6 +94,7 @@ public class Resilience4jConfigurationPropertiesConfigurer 
extends org.apache.ca
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/RestConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/RestConfigurationPropertiesConfigurer.java
index b0bfedc..28b9e70 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/RestConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/RestConfigurationPropertiesConfigurer.java
@@ -48,6 +48,7 @@ public class RestConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
         map.put("UseXForwardHeaders", boolean.class);
         map.put("XmlDataFormat", java.lang.String.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(RestConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -120,6 +121,7 @@ public class RestConfigurationPropertiesConfigurer extends 
org.apache.camel.supp
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/ThreadPoolConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/ThreadPoolConfigurationPropertiesConfigurer.java
index 529266a..4f3cec3 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/ThreadPoolConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/ThreadPoolConfigurationPropertiesConfigurer.java
@@ -28,6 +28,7 @@ public class ThreadPoolConfigurationPropertiesConfigurer 
extends org.apache.came
         map.put("RejectedPolicy", 
org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy.class);
         map.put("TimeUnit", java.util.concurrent.TimeUnit.class);
         ALL_OPTIONS = map;
+        
ConfigurerStrategy.addBootstrapConfigurerClearer(ThreadPoolConfigurationPropertiesConfigurer::clearBootstrapConfigurers);
     }
 
     @Override
@@ -60,6 +61,7 @@ public class ThreadPoolConfigurationPropertiesConfigurer 
extends org.apache.came
     }
 
     public static void clearBootstrapConfigurers() {
+        ALL_OPTIONS.clear();
     }
 
     @Override
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index b64d68b..6d2cc18 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -16,10 +16,6 @@
     { "name": "camel.main.autoConfigurationFailFast", "description": "Whether 
auto configuration should fail fast when configuring one ore more properties 
fails for whatever reason such as a invalid property name, etc. This option is 
default enabled.", "sourceType": 
"org.apache.camel.main.MainConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": true },
     { "name": "camel.main.autoConfigurationLogSummary", "description": 
"Whether auto configuration should log a summary with the configured 
properties. This option is default enabled.", "sourceType": 
"org.apache.camel.main.MainConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": true },
     { "name": "camel.main.autoStartup", "description": "Sets whether the 
object should automatically start when Camel starts. Important: Currently only 
routes can be disabled, as CamelContext's are always started. Note: When 
setting auto startup false on CamelContext then that takes precedence and no 
routes are started. You would need to start CamelContext explicit using the 
org.apache.camel.CamelContext.start() method, to start the context, and then 
you would need to start the routes ma [...]
-    { "name": "camel.main.autowireComponentProperties", "description": 
"Whether autowiring components with properties that are of same type, which has 
been added to the Camel registry, as a singleton instance. This is used for 
convention over configuration to inject DataSource, AmazonLogin instances to 
the components. This option is default enabled.", "sourceType": 
"org.apache.camel.main.MainConfigurationProperties", "type": "boolean", 
"javaType": "boolean", "defaultValue": true },
-    { "name": "camel.main.autowireComponentPropertiesAllowPrivateSetter", 
"description": "Whether autowiring components allows to use private setter 
method when setting the value. This may be needed in some rare situations when 
some configuration classes may configure via constructors over setters. But 
constructor configuration is more cumbersome to use via .properties files 
etc.", "sourceType": "org.apache.camel.main.MainConfigurationProperties", 
"type": "boolean", "javaType": "boolean" [...]
-    { "name": "camel.main.autowireComponentPropertiesDeep", "description": 
"Whether autowiring components (with deep nesting by attempting to walk as deep 
down the object graph by creating new empty objects on the way if needed) with 
properties that are of same type, which has been added to the Camel registry, 
as a singleton instance. This is used for convention over configuration to 
inject DataSource, AmazonLogin instances to the components. This option is 
default disabled.", "sourceTyp [...]
-    { "name": "camel.main.autowireComponentPropertiesNonNullOnly", 
"description": "Whether to only autowire if the property has no default value 
or has not been configured explicit. This option is default disabled.", 
"sourceType": "org.apache.camel.main.MainConfigurationProperties", "type": 
"boolean", "javaType": "boolean" },
     { "name": "camel.main.backlogTracing", "description": "Sets whether 
backlog tracing is enabled or not. Default is false.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", 
"javaType": "boolean" },
     { "name": "camel.main.beanIntrospectionExtendedStatistics", "description": 
"Sets whether bean introspection uses extended statistics. The default is 
false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", 
"type": "boolean", "javaType": "boolean" },
     { "name": "camel.main.beanIntrospectionLoggingLevel", "description": "Sets 
the logging level used by bean introspection, logging activity of its usage. 
The default is TRACE.", "sourceType": 
"org.apache.camel.main.DefaultConfigurationProperties", "type": "object", 
"javaType": "org.apache.camel.LoggingLevel", "enum": [ "ERROR", "WARN", "INFO", 
"DEBUG", "TRACE", "OFF" ] },
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index 832d6d9..2d3fdea 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -28,10 +28,6 @@ The following table lists all the options:
 | *camel.main.autoConfiguration{zwsp}FailFast* | Whether auto configuration 
should fail fast when configuring one ore more properties fails for whatever 
reason such as a invalid property name, etc. This option is default enabled. | 
true | boolean
 | *camel.main.autoConfiguration{zwsp}LogSummary* | Whether auto configuration 
should log a summary with the configured properties. This option is default 
enabled. | true | boolean
 | *camel.main.autoStartup* | Sets whether the object should automatically 
start when Camel starts. Important: Currently only routes can be disabled, as 
CamelContext's are always started. Note: When setting auto startup false on 
CamelContext then that takes precedence and no routes are started. You would 
need to start CamelContext explicit using the 
org.apache.camel.CamelContext.start() method, to start the context, and then 
you would need to start the routes manually using CamelContext.g [...]
-| *camel.main.autowireComponent{zwsp}Properties* | Whether autowiring 
components with properties that are of same type, which has been added to the 
Camel registry, as a singleton instance. This is used for convention over 
configuration to inject DataSource, AmazonLogin instances to the components. 
This option is default enabled. | true | boolean
-| *camel.main.autowireComponent{zwsp}PropertiesAllowPrivateSetter* | Whether 
autowiring components allows to use private setter method when setting the 
value. This may be needed in some rare situations when some configuration 
classes may configure via constructors over setters. But constructor 
configuration is more cumbersome to use via .properties files etc. | true | 
boolean
-| *camel.main.autowireComponent{zwsp}PropertiesDeep* | Whether autowiring 
components (with deep nesting by attempting to walk as deep down the object 
graph by creating new empty objects on the way if needed) with properties that 
are of same type, which has been added to the Camel registry, as a singleton 
instance. This is used for convention over configuration to inject DataSource, 
AmazonLogin instances to the components. This option is default disabled. |  | 
boolean
-| *camel.main.autowireComponent{zwsp}PropertiesNonNullOnly* | Whether to only 
autowire if the property has no default value or has not been configured 
explicit. This option is default disabled. |  | boolean
 | *camel.main.backlogTracing* | Sets whether backlog tracing is enabled or 
not. Default is false. |  | boolean
 | *camel.main.beanIntrospection{zwsp}ExtendedStatistics* | Sets whether bean 
introspection uses extended statistics. The default is false. |  | boolean
 | *camel.main.beanIntrospection{zwsp}LoggingLevel* | Sets the logging level 
used by bean introspection, logging activity of its usage. The default is 
TRACE. |  | LoggingLevel
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java 
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 6111c68..e03c52e 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -420,20 +420,8 @@ public abstract class BaseMainSupport extends BaseService {
         // try to load configuration classes
         loadConfigurations(camelContext);
 
-        // conventional configuration via properties to allow configuring 
options on
-        // component, dataformat, and languages (like spring-boot 
auto-configuration)
-        if (mainConfigurationProperties.isAutowireComponentProperties()
-                || 
mainConfigurationProperties.isAutowireComponentPropertiesDeep()) {
-            autowireConfigurationFromRegistry(
-                    camelContext,
-                    
mainConfigurationProperties.isAutowireComponentPropertiesNonNullOnly(),
-                    
mainConfigurationProperties.isAutowireComponentPropertiesDeep());
-        }
         if (mainConfigurationProperties.isAutoConfigurationEnabled()) {
             autoConfigurationFromProperties(camelContext, 
autoConfiguredProperties);
-        }
-        if (mainConfigurationProperties.isAutowireComponentProperties()
-                || 
mainConfigurationProperties.isAutowireComponentPropertiesDeep()) {
             autowireWildcardProperties(camelContext);
         }
 
@@ -1186,21 +1174,6 @@ public abstract class BaseMainSupport extends 
BaseService {
         }
     }
 
-    protected void autowireConfigurationFromRegistry(CamelContext 
camelContext, boolean bindNullOnly, boolean deepNesting)
-            throws Exception {
-        camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
-            @Override
-            public void onComponentAdd(String name, Component component) {
-                
PropertyBindingSupport.autowireSingletonPropertiesFromRegistry(camelContext, 
component, bindNullOnly,
-                        deepNesting, (obj, propertyName, type, value) -> {
-                            LOG.info(
-                                    "Autowired property: {} on component: {} 
as exactly one instance of type: {} found in the registry",
-                                    propertyName, 
component.getClass().getSimpleName(), type.getName());
-                        });
-            }
-        });
-    }
-
     protected void autowireWildcardProperties(CamelContext camelContext) {
         if (wildcardProperties.isEmpty()) {
             return;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/FaultToleranceConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/FaultToleranceConfigurationProperties.java
index d0e61bf..585281b 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/FaultToleranceConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/FaultToleranceConfigurationProperties.java
@@ -23,7 +23,7 @@ import org.apache.camel.spi.Metadata;
 /**
  * Global configuration for MicroProfile Fault Tolerance EIP circuit breaker.
  */
-@Configurer(api = true)
+@Configurer
 public class FaultToleranceConfigurationProperties implements 
BootstrapCloseable {
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
index 93f1366..4911357 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
@@ -19,7 +19,7 @@ package org.apache.camel.main;
 import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.spi.Configurer;
 
-@Configurer(api = true)
+@Configurer
 public class HealthCheckConfigurationProperties extends 
HealthCheckConfiguration {
 
 }
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
index 0813ef1..e897ef0 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
@@ -26,7 +26,7 @@ import org.apache.camel.spi.Metadata;
 /**
  * Global configuration for Health Check
  */
-@Configurer(api = true)
+@Configurer
 public class HealthConfigurationProperties implements BootstrapCloseable {
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/HystrixConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/HystrixConfigurationProperties.java
index d450c66..7fce15b 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/HystrixConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/HystrixConfigurationProperties.java
@@ -27,7 +27,7 @@ import org.apache.camel.spi.Configurer;
 /**
  * Global configuration for Hystrix EIP circuit breaker.
  */
-@Configurer(api = true)
+@Configurer
 @Deprecated
 public class HystrixConfigurationProperties implements BootstrapCloseable {
 
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/LraConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/LraConfigurationProperties.java
index 12e0a5d..4832267 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/LraConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/LraConfigurationProperties.java
@@ -23,7 +23,7 @@ import org.apache.camel.spi.Metadata;
 /**
  * Global configuration for Saga LRA
  */
-@Configurer(api = true)
+@Configurer
 public class LraConfigurationProperties implements BootstrapCloseable {
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java
index 9a2b5ac..2166391 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java
@@ -28,7 +28,7 @@ import org.apache.camel.spi.Configurer;
 /**
  * Global configuration for Camel Main to setup context name, stream caching 
and other global configurations.
  */
-@Configurer(api = true)
+@Configurer
 public class MainConfigurationProperties extends 
DefaultConfigurationProperties<MainConfigurationProperties>
         implements BootstrapCloseable {
 
@@ -36,10 +36,6 @@ public class MainConfigurationProperties extends 
DefaultConfigurationProperties<
     private boolean autoConfigurationEnvironmentVariablesEnabled = true;
     private boolean autoConfigurationFailFast = true;
     private boolean autoConfigurationLogSummary = true;
-    private boolean autowireComponentProperties = true;
-    private boolean autowireComponentPropertiesDeep;
-    private boolean autowireComponentPropertiesNonNullOnly;
-    private boolean autowireComponentPropertiesAllowPrivateSetter = true;
     private int durationHitExitCode;
     private String packageScanRouteBuilders;
 
@@ -237,63 +233,6 @@ public class MainConfigurationProperties extends 
DefaultConfigurationProperties<
         this.autoConfigurationLogSummary = autoConfigurationLogSummary;
     }
 
-    public boolean isAutowireComponentProperties() {
-        return autowireComponentProperties;
-    }
-
-    /**
-     * Whether autowiring components with properties that are of same type, 
which has been added to the Camel registry,
-     * as a singleton instance. This is used for convention over configuration 
to inject DataSource, AmazonLogin
-     * instances to the components.
-     * <p/>
-     * This option is default enabled.
-     */
-    public void setAutowireComponentProperties(boolean 
autowireComponentProperties) {
-        this.autowireComponentProperties = autowireComponentProperties;
-    }
-
-    public boolean isAutowireComponentPropertiesDeep() {
-        return autowireComponentPropertiesDeep;
-    }
-
-    /**
-     * Whether autowiring components (with deep nesting by attempting to walk 
as deep down the object graph by creating
-     * new empty objects on the way if needed) with properties that are of 
same type, which has been added to the Camel
-     * registry, as a singleton instance. This is used for convention over 
configuration to inject DataSource,
-     * AmazonLogin instances to the components.
-     * <p/>
-     * This option is default disabled.
-     */
-    public void setAutowireComponentPropertiesDeep(boolean 
autowireComponentPropertiesDeep) {
-        this.autowireComponentPropertiesDeep = autowireComponentPropertiesDeep;
-    }
-
-    public boolean isAutowireComponentPropertiesNonNullOnly() {
-        return autowireComponentPropertiesNonNullOnly;
-    }
-
-    /**
-     * Whether to only autowire if the property has no default value or has 
not been configured explicit.
-     * <p/>
-     * This option is default disabled.
-     */
-    public void setAutowireComponentPropertiesNonNullOnly(boolean 
autowireComponentPropertiesNonNullOnly) {
-        this.autowireComponentPropertiesNonNullOnly = 
autowireComponentPropertiesNonNullOnly;
-    }
-
-    public boolean isAutowireComponentPropertiesAllowPrivateSetter() {
-        return autowireComponentPropertiesAllowPrivateSetter;
-    }
-
-    /**
-     * Whether autowiring components allows to use private setter method when 
setting the value. This may be needed in
-     * some rare situations when some configuration classes may configure via 
constructors over setters. But constructor
-     * configuration is more cumbersome to use via .properties files etc.
-     */
-    public void setAutowireComponentPropertiesAllowPrivateSetter(boolean 
autowireComponentPropertiesAllowPrivateSetter) {
-        this.autowireComponentPropertiesAllowPrivateSetter = 
autowireComponentPropertiesAllowPrivateSetter;
-    }
-
     public String getPackageScanRouteBuilders() {
         return packageScanRouteBuilders;
     }
@@ -492,56 +431,6 @@ public class MainConfigurationProperties extends 
DefaultConfigurationProperties<
     }
 
     /**
-     * Whether autowiring components with properties that are of same type, 
which has been added to the Camel registry,
-     * as a singleton instance. This is used for convention over configuration 
to inject DataSource, AmazonLogin
-     * instances to the components.
-     * <p/>
-     * This option is default enabled.
-     */
-    public MainConfigurationProperties withAutowireComponentProperties(boolean 
autowireComponentProperties) {
-        this.autowireComponentProperties = autowireComponentProperties;
-        return this;
-    }
-
-    /**
-     * Whether autowiring components (with deep nesting by attempting to walk 
as deep down the object graph by creating
-     * new empty objects on the way if needed) with properties that are of 
same type, which has been added to the Camel
-     * registry, as a singleton instance. This is used for convention over 
configuration to inject DataSource,
-     * AmazonLogin instances to the components.
-     * <p/>
-     * This option is default disabled.
-     */
-    public MainConfigurationProperties 
withAutowireComponentPropertiesDeep(boolean autowireComponentPropertiesDeep) {
-        this.autowireComponentPropertiesDeep = autowireComponentPropertiesDeep;
-        return this;
-    }
-
-    /**
-     * Whether to only autowire if the property has no default value or has 
not been configured explicit.
-     * <p/>
-     * This option is default disabled.
-     */
-    public MainConfigurationProperties 
withAutowireComponentPropertiesNonNullOnly(
-            boolean autowireComponentPropertiesNonNullOnly) {
-        this.autowireComponentPropertiesNonNullOnly = 
autowireComponentPropertiesNonNullOnly;
-        return this;
-    }
-
-    /**
-     * Whether autowiring components (with deep nesting by attempting to walk 
as deep down the object graph by creating
-     * new empty objects on the way if needed) with properties that are of 
same type, which has been added to the Camel
-     * registry, as a singleton instance. This is used for convention over 
configuration to inject DataSource,
-     * AmazonLogin instances to the components.
-     * <p/>
-     * This option is default enabled.
-     */
-    public MainConfigurationProperties 
withAutowireComponentPropertiesAllowPrivateSetter(
-            boolean autowireComponentPropertiesAllowPrivateSetter) {
-        this.autowireComponentPropertiesAllowPrivateSetter = 
autowireComponentPropertiesAllowPrivateSetter;
-        return this;
-    }
-
-    /**
      * Sets the exit code for the application if duration was hit
      */
     public MainConfigurationProperties withDurationHitExitCode(int 
durationHitExitCode) {
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/Resilience4jConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/Resilience4jConfigurationProperties.java
index 6921fc0..7c32641 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/Resilience4jConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/Resilience4jConfigurationProperties.java
@@ -25,7 +25,7 @@ import org.apache.camel.spi.Metadata;
 /**
  * Global configuration for Resilience EIP circuit breaker.
  */
-@Configurer(api = true)
+@Configurer
 public class Resilience4jConfigurationProperties implements BootstrapCloseable 
{
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
index 475cfb6..9e61835 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/RestConfigurationProperties.java
@@ -26,7 +26,7 @@ import org.apache.camel.support.PatternHelper;
 /**
  * Global configuration for Rest DSL.
  */
-@Configurer(api = true)
+@Configurer
 public class RestConfigurationProperties extends RestConfiguration implements 
BootstrapCloseable {
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/ThreadPoolConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/ThreadPoolConfigurationProperties.java
index b4f4eb7..77cbec5 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/ThreadPoolConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/ThreadPoolConfigurationProperties.java
@@ -27,7 +27,7 @@ import 
org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy;
 /**
  * Global configuration for thread pools
  */
-@Configurer(api = true)
+@Configurer
 public class ThreadPoolConfigurationProperties implements BootstrapCloseable {
 
     private MainConfigurationProperties parent;
diff --git 
a/core/camel-main/src/test/java/org/apache/camel/main/MainIoCAutowireTest.java 
b/core/camel-main/src/test/java/org/apache/camel/main/MainIoCAutowireTest.java
deleted file mode 100644
index fc2b1ca..0000000
--- 
a/core/camel-main/src/test/java/org/apache/camel/main/MainIoCAutowireTest.java
+++ /dev/null
@@ -1,173 +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.main;
-
-import java.util.Map;
-
-import org.apache.camel.AsyncCallback;
-import org.apache.camel.BindToRegistry;
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Consumer;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.component.seda.BlockingQueueFactory;
-import org.apache.camel.component.seda.PriorityBlockingQueueFactory;
-import org.apache.camel.component.seda.SedaComponent;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.support.DefaultAsyncProducer;
-import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.support.DefaultConsumer;
-import org.apache.camel.support.DefaultEndpoint;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class MainIoCAutowireTest {
-    @Test
-    public void autowireNonNullOnlyDisabledTest() {
-        Main main = new Main();
-
-        try {
-            main.bind("seda", createSedaComponent());
-            main.configure().addConfigurationClass(MyConfiguration.class);
-            main.configure().setAutowireComponentPropertiesNonNullOnly(false);
-            main.setPropertyPlaceholderLocations("empty.properties");
-            main.start();
-
-            BlockingQueueFactory qf = 
main.getCamelContext().getComponent("seda", 
SedaComponent.class).getDefaultQueueFactory();
-            assertTrue(qf instanceof PriorityBlockingQueueFactory);
-        } finally {
-            main.stop();
-        }
-    }
-
-    @Test
-    public void autowireNonNullOnlyEnabledTest() {
-        Main main = new Main();
-
-        try {
-            main.bind("seda", createSedaComponent());
-            main.configure().addConfigurationClass(MyConfiguration.class);
-            main.configure().setAutowireComponentPropertiesNonNullOnly(true);
-            main.setPropertyPlaceholderLocations("empty.properties");
-            main.start();
-
-            BlockingQueueFactory qf = 
main.getCamelContext().getComponent("seda", 
SedaComponent.class).getDefaultQueueFactory();
-            assertTrue(qf instanceof MySedaBlockingQueueFactory);
-        } finally {
-            main.stop();
-        }
-    }
-
-    @Test
-    public void doNotAutowireContextTest() {
-        Main main = new Main();
-
-        try {
-            DefaultCamelContext otherContext = new DefaultCamelContext();
-            otherContext.setName("other-ctx");
-
-            main.bind("dummy", new MyDummyComponent());
-            main.bind("context", otherContext);
-            main.configure().addConfigurationClass(MyConfiguration.class);
-            main.configure().setName("main");
-            main.configure().setAutowireComponentPropertiesNonNullOnly(true);
-            main.setPropertyPlaceholderLocations("empty.properties");
-            main.start();
-
-            MyDummyComponent component = 
main.getCamelContext().getComponent("dummy", MyDummyComponent.class);
-            // the camel context is bound to the component upon initialization
-            assertEquals(main.getCamelContext(), component.getCamelContext());
-            // the camel context should not be set by auto wiring
-            assertEquals(null, component.getConfig().getCamelContext());
-        } finally {
-            main.stop();
-        }
-    }
-
-    public static class MyConfiguration {
-        @BindToRegistry
-        public BlockingQueueFactory queueFactory(CamelContext myCamel) {
-            // we can optionally include camel context as parameter
-            assertNotNull(myCamel);
-            return new PriorityBlockingQueueFactory();
-        }
-    }
-
-    public static SedaComponent createSedaComponent() {
-        SedaComponent seda = new SedaComponent();
-        seda.setDefaultQueueFactory(new MySedaBlockingQueueFactory());
-
-        return seda;
-    }
-
-    public static class MyDummyComponent extends DefaultComponent {
-        private MyDummyConfig config = new MyDummyConfig();
-
-        public MyDummyConfig getConfig() {
-            return config;
-        }
-
-        public void setConfig(MyDummyConfig config) {
-            this.config = config;
-        }
-
-        @Override
-        protected Endpoint createEndpoint(String uri, String remaining, 
Map<String, Object> parameters) throws Exception {
-            return new DefaultEndpoint() {
-                @Override
-                public Producer createProducer() throws Exception {
-                    return new DefaultAsyncProducer(this) {
-                        @Override
-                        public boolean process(Exchange exchange, 
AsyncCallback callback) {
-                            return false;
-                        }
-                    };
-                }
-
-                @Override
-                public Consumer createConsumer(Processor processor) throws 
Exception {
-                    return new DefaultConsumer(this, processor);
-                }
-
-                @Override
-                protected String createEndpointUri() {
-                    return "dummy://foo";
-                }
-            };
-        }
-    }
-
-    public static class MyDummyConfig implements CamelContextAware {
-        private CamelContext camelContext;
-
-        @Override
-        public CamelContext getCamelContext() {
-            return camelContext;
-        }
-
-        @Override
-        public void setCamelContext(CamelContext camelContext) {
-            this.camelContext = camelContext;
-        }
-    }
-}
diff --git 
a/core/camel-main/src/test/java/org/apache/camel/main/MainIoCTest.java 
b/core/camel-main/src/test/java/org/apache/camel/main/MainIoCTest.java
index 5ca7d06..cb013a0 100644
--- a/core/camel-main/src/test/java/org/apache/camel/main/MainIoCTest.java
+++ b/core/camel-main/src/test/java/org/apache/camel/main/MainIoCTest.java
@@ -29,10 +29,8 @@ import org.apache.camel.component.seda.SedaComponent;
 import org.apache.camel.model.ModelCamelContext;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 public class MainIoCTest {
 
@@ -83,10 +81,11 @@ public class MainIoCTest {
         // should have called the configure class
         assertEquals("123", camelContext.getGlobalOptions().get("foo"));
 
-        // and seda should have been auto-configured by type
+        // and seda should be created and use the custom queue factory
         Object qf = seda.getDefaultQueueFactory();
         assertNotNull(qf);
         assertTrue(qf instanceof PriorityBlockingQueueFactory);
+        assertSame(camelContext, seda.getCamelContext());
 
         MyConfiguration.MyCoolBean mcb = (MyConfiguration.MyCoolBean) 
camelContext.getRegistry().lookupByName("MyCoolBean");
         assertNotNull(mcb);
@@ -122,13 +121,20 @@ public class MainIoCTest {
             }
         }
 
-        @BindToRegistry
+        @BindToRegistry("myQF")
         public BlockingQueueFactory queueFactory(CamelContext myCamel) {
             // we can optionally include camel context as parameter
             assertNotNull(myCamel);
             return new PriorityBlockingQueueFactory();
         }
 
+        @BindToRegistry
+        public SedaComponent seda(@BeanInject BlockingQueueFactory qf) {
+            SedaComponent seda = new SedaComponent();
+            seda.setDefaultQueueFactory(qf);
+            return seda;
+        }
+
         @BindToRegistry("coolStuff")
         public String cool(
                 @BeanInject MyCoolBean cool,
diff --git 
a/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java 
b/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
index c0a5d4c..5b80fe5 100644
--- a/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
+++ b/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
@@ -47,30 +47,6 @@ public class MainSedaTest {
         main.stop();
     }
 
-    @Test
-    public void testSedaAutowireFromRegistryMain() throws Exception {
-        Main main = new Main();
-        main.configure().addRoutesBuilder(new MyRouteBuilder());
-        main.addProperty("camel.beans.myqf", 
"#class:org.apache.camel.main.MySedaBlockingQueueFactory");
-        main.addProperty("camel.beans.myqf.counter", "123");
-        main.start();
-
-        CamelContext camelContext = main.getCamelContext();
-        assertNotNull(camelContext);
-
-        // the keys will be lower-cased
-        assertNotNull(camelContext.getRegistry().lookupByName("myqf"));
-
-        // seda will autowire from registry and discover the custom qf and use 
it
-        SedaComponent seda = camelContext.getComponent("seda", 
SedaComponent.class);
-        assertNotNull(seda);
-        assertTrue(seda.getDefaultQueueFactory() instanceof 
MySedaBlockingQueueFactory);
-        MySedaBlockingQueueFactory myBQF = (MySedaBlockingQueueFactory) 
seda.getDefaultQueueFactory();
-        assertEquals(123, myBQF.getCounter());
-
-        main.stop();
-    }
-
     public static class MyRouteBuilder extends RouteBuilder {
         @Override
         public void configure() throws Exception {
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index 3b21583..342bf29 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -94,173 +94,6 @@ public final class PropertyBindingSupport {
     }
 
     /**
-     * This will discover all the properties on the target, and automatic bind 
the properties that are null by looking
-     * up in the registry to see if there is a single instance of the same 
type as the property. This is used for
-     * convention over configuration to automatic configure resources such as 
DataSource, Amazon Logins and so on.
-     *
-     * @param  camelContext the camel context
-     * @param  target       the target object
-     * @return              true if one ore more properties was auto wired
-     */
-    public static boolean autowireSingletonPropertiesFromRegistry(CamelContext 
camelContext, Object target) {
-        return autowireSingletonPropertiesFromRegistry(camelContext, target, 
false, false, null);
-    }
-
-    /**
-     * This will discover all the properties on the target, and automatic bind 
the properties by looking up in the
-     * registry to see if there is a single instance of the same type as the 
property. This is used for convention over
-     * configuration to automatic configure resources such as DataSource, 
Amazon Logins and so on.
-     *
-     * @param  camelContext the camel context
-     * @param  target       the target object
-     * @param  bindNullOnly whether to only autowire if the property has no 
default value or has not been configured
-     *                      explicit
-     * @param  deepNesting  whether to attempt to walk as deep down the object 
graph by creating new empty objects on
-     *                      the way if needed (Camel can only create new empty 
objects if they have a default no-arg
-     *                      constructor, also mind that this may lead to 
creating many empty objects, even if they will
-     *                      not have any objects autowired from the registry, 
so use this with caution)
-     * @param  callback     optional callback when a property was auto wired
-     * @return              true if one ore more properties was auto wired
-     */
-    public static boolean autowireSingletonPropertiesFromRegistry(
-            CamelContext camelContext, Object target,
-            boolean bindNullOnly, boolean deepNesting, OnAutowiring callback) {
-        try {
-            if (target != null) {
-                Set<Object> parents = new HashSet<>();
-                return doAutowireSingletonPropertiesFromRegistry(camelContext, 
target, parents, bindNullOnly, deepNesting,
-                        callback);
-            }
-        } catch (Exception e) {
-            throw new PropertyBindingException(target, e);
-        }
-
-        return false;
-    }
-
-    private static boolean doAutowireSingletonPropertiesFromRegistry(
-            final CamelContext camelContext, Object target, Set<Object> 
parents,
-            boolean bindNullOnly, boolean deepNesting, OnAutowiring callback)
-            throws Exception {
-
-        // properties of all the current values from the target
-        Map<String, Object> properties = new LinkedHashMap<>();
-
-        // if there a configurer
-        PropertyConfigurer configurer = 
PropertyConfigurerHelper.resolvePropertyConfigurer(camelContext, target);
-
-        // use configurer to get all the current options and its values
-        Map<String, Object> getterAllOption = null;
-        if (configurer instanceof PropertyConfigurerGetter) {
-            final PropertyConfigurerGetter getter = (PropertyConfigurerGetter) 
configurer;
-            final Object lambdaTarget = target;
-            getterAllOption = getter.getAllOptions(target);
-            getterAllOption.forEach((key, type) -> {
-                // we only need the complex types
-                if (isComplexUserType((Class) type)) {
-                    Object value = getter.getOptionValue(lambdaTarget, key, 
true);
-                    properties.put(key, value);
-                }
-            });
-        } else {
-            // okay use reflection based
-            
camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().getProperties(target,
 properties, null);
-        }
-
-        boolean hit = false;
-
-        for (Map.Entry<String, Object> entry : properties.entrySet()) {
-            String key = entry.getKey();
-            Object value = entry.getValue();
-
-            // skip based on some known names
-            if ("basicPropertyBinding".equals(key) || 
"bridgeErrorHandler".equals(key) || "lazyStartProducer".equals(key)) {
-                continue;
-            }
-
-            boolean skip = parents.contains(value) || value instanceof 
CamelContext;
-            if (skip) {
-                // we have already covered this as parent of parents so dont 
walk down this as we want to avoid
-                // circular dependencies when walking the OGNL graph, also we 
dont want to walk down CamelContext
-                continue;
-            }
-
-            Class<?> type;
-            if (getterAllOption != null) {
-                // use getter configurer to know the property class type
-                type = (Class<?>) getterAllOption.get(key);
-            } else {
-                // okay fallback to use reflection based
-                type = getGetterType(camelContext, target, key, false);
-            }
-            if (type != null && CamelContext.class.isAssignableFrom(type)) {
-                // the camel context is usually bound by other means so don't 
bind it to the target object
-                // and most important do not walk it down and re-configure it.
-                //
-                // In some cases, such as Camel Quarkus, the Registry and the 
Context itself are added to
-                // the IoC Container and an attempt to auto re-wire the 
Context may ends up in a circular
-                // reference and a subsequent stack overflow.
-                continue;
-            }
-
-            if (isComplexUserType(type)) {
-                // if the property has not been set and its a complex type 
(not simple or string etc)
-                if (!bindNullOnly || value == null) {
-                    Set lookup = camelContext.getRegistry().findByType(type);
-                    if (lookup.size() == 1) {
-                        value = lookup.iterator().next();
-                        if (value != null) {
-                            if (configurer != null) {
-                                // favour using source code generated 
configurer
-                                hit = configurer.configure(camelContext, 
target, undashKey(key), value, true);
-                            }
-                            if (!hit) {
-                                // fallback to use reflection based
-                                hit = 
camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection()
-                                        .setProperty(camelContext, target, 
key, value);
-                            }
-                            if (hit && callback != null) {
-                                callback.onAutowire(target, key, type, value);
-                            }
-                        }
-                    }
-                }
-
-                // attempt to create new instances to walk down the tree if 
its null (deepNesting option)
-                if (value == null && deepNesting) {
-                    // okay is there a setter so we can create a new instance 
and set it automatic
-                    Method method = findBestSetterMethod(camelContext, 
target.getClass(), key, true, true, false);
-                    if (method != null) {
-                        Class<?> parameterType = method.getParameterTypes()[0];
-                        if (parameterType != null
-                                && 
org.apache.camel.util.ObjectHelper.hasDefaultPublicNoArgConstructor(parameterType))
 {
-                            Object instance = 
camelContext.getInjector().newInstance(parameterType);
-                            if (instance != null) {
-                                
org.apache.camel.support.ObjectHelper.invokeMethod(method, target, instance);
-                                target = instance;
-                                // remember this as parent and also autowire 
nested properties
-                                // do not walk down if it point to our-selves 
(circular reference)
-                                parents.add(target);
-                                value = instance;
-                                hit |= 
doAutowireSingletonPropertiesFromRegistry(camelContext, value, parents, 
bindNullOnly,
-                                        deepNesting, callback);
-                            }
-                        }
-                    }
-                } else if (value != null && deepNesting) {
-                    // remember this as parent and also autowire nested 
properties
-                    // do not walk down if it point to our-selves (circular 
reference)
-                    parents.add(target);
-                    hit |= 
doAutowireSingletonPropertiesFromRegistry(camelContext, value, parents, 
bindNullOnly, deepNesting,
-                            callback);
-                }
-            }
-        }
-
-        return hit;
-    }
-
-    /**
      * Binds the properties to the target object, and removes the property 
that was bound from properties.
      * <p/>
      * This method uses the default settings, and if you need to configure any 
setting then use the fluent builder

Reply via email to