You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/08/22 08:39:56 UTC

[camel] branch CAMEL-13870 updated (abc454c -> 4249ce8)

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

davsclaus pushed a change to branch CAMEL-13870
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from abc454c  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new bd9a305  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 96d6f7f  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
     new 4249ce8  CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/component/log/LogComponent.java   |  10 +-
 .../org/apache/camel/ExtendedCamelContext.java     |   6 +
 .../org/apache/camel/spi/BeanIntrospection.java    | 190 ++++++++++++++++++
 .../camel/impl/engine/AbstractCamelContext.java    |   8 +
 .../impl/engine/CamelPostProcessorHelper.java      |   5 +-
 .../impl/engine/DefaultBeanIntrospection.java      | 212 +++++++++++++++++++++
 .../apache/camel/model/LoadBalancerDefinition.java |   1 -
 .../cloud/ServiceCallExpressionConfiguration.java  |   3 +-
 .../ServiceCallServiceChooserConfiguration.java    |   3 +-
 .../ServiceCallServiceDiscoveryConfiguration.java  |   3 +-
 .../ServiceCallServiceFilterConfiguration.java     |   3 +-
 ...erviceCallServiceLoadBalancerConfiguration.java |   3 +-
 .../camel/model/language/ExpressionDefinition.java |   4 +-
 .../reifier/dataformat/DataFormatReifier.java      |   6 +-
 .../camel/reifier/rest/RestBindingReifier.java     |  16 +-
 .../component/ApiMethodPropertiesHelperTest.java   |   4 +-
 .../DefaultComponentVerifierExtension.java         |   7 +-
 .../org/apache/camel/support/DefaultComponent.java |   7 +-
 .../org/apache/camel/support/DefaultEndpoint.java  |   3 +-
 .../org/apache/camel/support/EndpointHelper.java   |   3 +-
 .../apache/camel/support/IntrospectionSupport.java |   3 +
 .../camel/support/PropertyBindingSupport.java      |  40 ++--
 .../camel/support/ScheduledPollConsumer.java       |   3 +-
 .../camel/support/ScheduledPollEndpoint.java       |   6 +-
 .../camel/support/builder/ExpressionBuilder.java   |   4 +-
 .../support/component/AbstractApiComponent.java    |   4 +-
 .../support/component/AbstractApiEndpoint.java     |   5 +-
 .../component/ApiMethodPropertiesHelper.java       |  14 +-
 .../org/apache/camel/support/jndi/JndiContext.java |   1 +
 .../support/management/MBeanInfoAssembler.java     |   1 +
 30 files changed, 496 insertions(+), 82 deletions(-)
 create mode 100644 core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
 create mode 100644 core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java


[camel] 01/03: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bd9a30515f791bbb30aba7ee45732e23defa9adb
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 22 09:34:48 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../org/apache/camel/spi/BeanIntrospection.java    | 181 +++++++++++++++++++++
 1 file changed, 181 insertions(+)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
new file mode 100644
index 0000000..64de871
--- /dev/null
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
@@ -0,0 +1,181 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.spi;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.TypeConverter;
+
+public interface BeanIntrospection {
+
+    boolean isGetter(Method method);
+
+    String getGetterShorthandName(Method method);
+
+    String getSetterShorthandName(Method method);
+
+    boolean isSetter(Method method, boolean allowBuilderPattern);
+
+    boolean isSetter(Method method);
+
+    /**
+     * Will inspect the target for properties.
+     * <p/>
+     * Notice a property must have both a getter/setter method to be included.
+     * Notice all <tt>null</tt> values won't be included.
+     *
+     * @param target         the target bean
+     * @return the map with found properties
+     */
+    Map<String, Object> getNonNullProperties(Object target);
+
+    /**
+     * Will inspect the target for properties.
+     * <p/>
+     * Notice a property must have both a getter/setter method to be included.
+     * Notice all <tt>null</tt> values will be included.
+     *
+     * @param target         the target bean
+     * @param properties     the map to fill in found properties
+     * @param optionPrefix   an optional prefix to append the property key
+     * @return <tt>true</tt> if any properties was found, <tt>false</tt> otherwise.
+     */
+    boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix);
+
+    /**
+     * Will inspect the target for properties.
+     * <p/>
+     * Notice a property must have both a getter/setter method to be included.
+     *
+     * @param target         the target bean
+     * @param properties     the map to fill in found properties
+     * @param optionPrefix   an optional prefix to append the property key
+     * @param includeNull    whether to include <tt>null</tt> values
+     * @return <tt>true</tt> if any properties was found, <tt>false</tt> otherwise.
+     */
+    boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean includeNull);
+
+    /**
+     * Introspects the given class.
+     *
+     * @param clazz the class
+     * @return the introspection result as a {@link ClassInfo} structure.
+     */
+    // TODO:
+    //ClassInfo cacheClass(Class<?> clazz);
+
+    boolean hasProperties(Map<String, Object> properties, String optionPrefix);
+
+    Object getProperty(Object target, String propertyName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
+
+    Object getOrElseProperty(Object target, String propertyName, Object defaultValue);
+
+    Object getOrElseProperty(Object target, String propertyName, Object defaultValue, boolean ignoreCase);
+
+    Method getPropertyGetter(Class<?> type, String propertyName) throws NoSuchMethodException;
+
+    Method getPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase) throws NoSuchMethodException;
+
+    Method getPropertySetter(Class<?> type, String propertyName) throws NoSuchMethodException;
+
+    boolean isPropertyIsGetter(Class<?> type, String propertyName);
+
+    /**
+     * @deprecated use {@link PropertyBindingSupport}
+     */
+    @Deprecated
+    boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean allowBuilderPattern) throws Exception;
+
+    /**
+     * @deprecated use {@link PropertyBindingSupport}
+     */
+    @Deprecated
+    boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix) throws Exception;
+
+    Map<String, Object> extractProperties(Map<String, Object> properties, String optionPrefix);
+
+    Map<String, Object> extractProperties(Map<String, Object> properties, String optionPrefix, boolean remove);
+
+    @Deprecated
+    Map<String, String> extractStringProperties(Map<String, Object> properties);
+
+    /**
+     * @deprecated use {@link PropertyBindingSupport}
+     */
+    @Deprecated
+    boolean setProperties(CamelContext context, TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception;
+
+    /**
+     * @deprecated use {@link PropertyBindingSupport}
+     */
+    @Deprecated
+    boolean setProperties(TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception;
+
+    /**
+     * @deprecated use {@link PropertyBindingSupport}
+     */
+    @Deprecated
+    boolean setProperties(Object target, Map<String, Object> properties) throws Exception;
+
+    /**
+     * This method supports three modes to set a property:
+     *
+     * 1. Setting a Map property where the property name refers to a map via name[aKey] where aKey is the map key to use.
+     *
+     * 2. Setting a property that has already been resolved, this is the case when {@code context} and {@code refName} are
+     * NULL and {@code value} is non-NULL.
+     *
+     * 3. Setting a property that has not yet been resolved, the property will be resolved based on the suitable methods
+     * found matching the property name on the {@code target} bean. For this mode to be triggered the parameters
+     * {@code context} and {@code refName} must NOT be NULL, and {@code value} MUST be NULL.
+     */
+    boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName,
+                                      boolean allowBuilderPattern) throws Exception;
+
+    /**
+     * This method supports three modes to set a property:
+     *
+     * 1. Setting a Map property where the property name refers to a map via name[aKey] where aKey is the map key to use.
+     *
+     * 2. Setting a property that has already been resolved, this is the case when {@code context} and {@code refName} are
+     * NULL and {@code value} is non-NULL.
+     *
+     * 3. Setting a property that has not yet been resolved, the property will be resolved based on the suitable methods
+     * found matching the property name on the {@code target} bean. For this mode to be triggered the parameters
+     * {@code context} and {@code refName} must NOT be NULL, and {@code value} MUST be NULL.
+     */
+    boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName,
+                                      boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) throws Exception;
+
+    boolean isPropertyPlaceholder(CamelContext context, Object value);
+
+    boolean setProperty(CamelContext context, Object target, String name, Object value) throws Exception;
+
+    boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value) throws Exception;
+
+    boolean setProperty(TypeConverter typeConverter, Object target, String name, Object value) throws Exception;
+
+    @Deprecated
+    boolean setProperty(Object target, String name, Object value, boolean allowBuilderPattern) throws Exception;
+
+    @Deprecated
+    boolean setProperty(Object target, String name, Object value) throws Exception;
+
+}


[camel] 02/03: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 96d6f7fb42701c3888012dadee42f057e5546258
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 22 10:10:02 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../org/apache/camel/ExtendedCamelContext.java     |   6 +
 .../org/apache/camel/spi/BeanIntrospection.java    |   5 +-
 .../camel/impl/engine/AbstractCamelContext.java    |   8 +
 .../impl/engine/CamelPostProcessorHelper.java      |   5 +-
 .../impl/engine/DefaultBeanIntrospection.java      | 210 +++++++++++++++++++++
 .../apache/camel/model/LoadBalancerDefinition.java |   1 -
 .../cloud/ServiceCallExpressionConfiguration.java  |   3 +-
 .../ServiceCallServiceChooserConfiguration.java    |   3 +-
 .../ServiceCallServiceDiscoveryConfiguration.java  |   3 +-
 .../ServiceCallServiceFilterConfiguration.java     |   3 +-
 ...erviceCallServiceLoadBalancerConfiguration.java |   3 +-
 .../camel/model/language/ExpressionDefinition.java |   4 +-
 .../reifier/dataformat/DataFormatReifier.java      |   6 +-
 .../camel/reifier/rest/RestBindingReifier.java     |  16 +-
 .../DefaultComponentVerifierExtension.java         |   7 +-
 .../org/apache/camel/support/DefaultComponent.java |   2 +-
 .../org/apache/camel/support/DefaultEndpoint.java  |   3 +-
 .../org/apache/camel/support/EndpointHelper.java   |   3 +-
 .../apache/camel/support/IntrospectionSupport.java |   3 +
 .../camel/support/PropertyBindingSupport.java      |  38 ++--
 .../camel/support/ScheduledPollConsumer.java       |   3 +-
 .../camel/support/ScheduledPollEndpoint.java       |   3 +-
 .../camel/support/builder/ExpressionBuilder.java   |   4 +-
 .../support/component/AbstractApiComponent.java    |   4 +-
 .../component/ApiMethodPropertiesHelper.java       |   2 +-
 .../org/apache/camel/support/jndi/JndiContext.java |   1 +
 .../support/management/MBeanInfoAssembler.java     |   1 +
 27 files changed, 286 insertions(+), 64 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java b/core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java
index 450b98a..6ffdcea 100644
--- a/core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java
+++ b/core/camel-api/src/main/java/org/apache/camel/ExtendedCamelContext.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ScheduledExecutorService;
 
 import org.apache.camel.spi.AnnotationBasedProcessorFactory;
 import org.apache.camel.spi.AsyncProcessorAwaitManager;
+import org.apache.camel.spi.BeanIntrospection;
 import org.apache.camel.spi.BeanProcessorFactory;
 import org.apache.camel.spi.BeanProxyFactory;
 import org.apache.camel.spi.CamelBeanPostProcessor;
@@ -333,4 +334,9 @@ public interface ExtendedCamelContext extends CamelContext {
      */
     void setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager manager);
 
+    /**
+     * Gets the {@link BeanIntrospection}
+     */
+    BeanIntrospection getBeanIntrospection();
+
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
index 64de871..98a5a81 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
@@ -19,6 +19,7 @@ package org.apache.camel.spi;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.TypeConverter;
@@ -164,8 +165,6 @@ public interface BeanIntrospection {
     boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName,
                                       boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) throws Exception;
 
-    boolean isPropertyPlaceholder(CamelContext context, Object value);
-
     boolean setProperty(CamelContext context, Object target, String name, Object value) throws Exception;
 
     boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value) throws Exception;
@@ -178,4 +177,6 @@ public interface BeanIntrospection {
     @Deprecated
     boolean setProperty(Object target, String name, Object value) throws Exception;
 
+    Set<Method> findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase);
+
 }
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index 15bd973..2211f86 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -80,6 +80,7 @@ import org.apache.camel.impl.transformer.TransformerKey;
 import org.apache.camel.impl.validator.ValidatorKey;
 import org.apache.camel.spi.AnnotationBasedProcessorFactory;
 import org.apache.camel.spi.AsyncProcessorAwaitManager;
+import org.apache.camel.spi.BeanIntrospection;
 import org.apache.camel.spi.BeanProcessorFactory;
 import org.apache.camel.spi.BeanProxyFactory;
 import org.apache.camel.spi.CamelBeanPostProcessor;
@@ -254,6 +255,7 @@ public abstract class AbstractCamelContext extends ServiceSupport implements Ext
     private volatile UnitOfWorkFactory unitOfWorkFactory;
     private volatile RouteController routeController;
     private volatile ScheduledExecutorService errorHandlerExecutorService;
+    private final BeanIntrospection beanIntrospection = new DefaultBeanIntrospection();
     private final DeferServiceFactory deferServiceFactory = new DefaultDeferServiceFactory();
     private final AnnotationBasedProcessorFactory annotationBasedProcessorFactory = new DefaultAnnotationBasedProcessorFactory();
 
@@ -2771,6 +2773,7 @@ public abstract class AbstractCamelContext extends ServiceSupport implements Ext
         forceStopLazyInitialization();
 
         // stop to clear introspection cache
+        ServiceHelper.stopService(beanIntrospection);
         IntrospectionSupport.stop();
 
         if (log.isInfoEnabled()) {
@@ -3655,6 +3658,11 @@ public abstract class AbstractCamelContext extends ServiceSupport implements Ext
     }
 
     @Override
+    public BeanIntrospection getBeanIntrospection() {
+        return beanIntrospection;
+    }
+
+    @Override
     public void setAutoStartup(Boolean autoStartup) {
         this.autoStartup = autoStartup;
     }
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/CamelPostProcessorHelper.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/CamelPostProcessorHelper.java
index 8befc59..56cfdf2 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/CamelPostProcessorHelper.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/CamelPostProcessorHelper.java
@@ -40,7 +40,6 @@ import org.apache.camel.Service;
 import org.apache.camel.spi.BeanProxyFactory;
 import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -179,10 +178,10 @@ public class CamelPostProcessorHelper implements CamelContextAware {
         // 2. then the getter with Endpoint as postfix
         // 3. then if start with on then try step 1 and 2 again, but omit the on prefix
         try {
-            Object value = IntrospectionSupport.getOrElseProperty(bean, propertyName, null);
+            Object value = getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().getOrElseProperty(bean, propertyName, null);
             if (value == null) {
                 // try endpoint as postfix
-                value = IntrospectionSupport.getOrElseProperty(bean, propertyName + "Endpoint", null);
+                value = getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().getOrElseProperty(bean, propertyName + "Endpoint", null);
             }
             if (value == null && propertyName.startsWith("on")) {
                 // retry but without the on as prefix
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
new file mode 100644
index 0000000..f9f9b79
--- /dev/null
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
@@ -0,0 +1,210 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.impl.engine;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.TypeConverter;
+import org.apache.camel.spi.BeanIntrospection;
+import org.apache.camel.support.IntrospectionSupport;
+import org.apache.camel.support.service.ServiceSupport;
+
+@SuppressWarnings("deprecation")
+public class DefaultBeanIntrospection extends ServiceSupport implements BeanIntrospection {
+
+    @Override
+    public boolean isGetter(Method method) {
+        return IntrospectionSupport.isGetter(method);
+    }
+
+    @Override
+    public String getGetterShorthandName(Method method) {
+        return IntrospectionSupport.getGetterShorthandName(method);
+    }
+
+    @Override
+    public String getSetterShorthandName(Method method) {
+        return IntrospectionSupport.getSetterShorthandName(method);
+    }
+
+    @Override
+    public boolean isSetter(Method method, boolean allowBuilderPattern) {
+        return IntrospectionSupport.isSetter(method, allowBuilderPattern);
+    }
+
+    @Override
+    public boolean isSetter(Method method) {
+        return IntrospectionSupport.isSetter(method);
+    }
+
+    @Override
+    public Map<String, Object> getNonNullProperties(Object target) {
+        return IntrospectionSupport.getNonNullProperties(target);
+    }
+
+    @Override
+    public boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix) {
+        return IntrospectionSupport.getProperties(target, properties, optionPrefix);
+    }
+
+    @Override
+    public boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean includeNull) {
+        return IntrospectionSupport.getProperties(target, properties, optionPrefix, includeNull);
+    }
+
+    @Override
+    public boolean hasProperties(Map<String, Object> properties, String optionPrefix) {
+        return IntrospectionSupport.hasProperties(properties, optionPrefix);
+    }
+
+    @Override
+    public Object getProperty(Object target, String propertyName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+        return IntrospectionSupport.getProperty(target, propertyName);
+    }
+
+    @Override
+    public Object getOrElseProperty(Object target, String propertyName, Object defaultValue) {
+        return IntrospectionSupport.getOrElseProperty(target, propertyName, defaultValue);
+    }
+
+    @Override
+    public Object getOrElseProperty(Object target, String propertyName, Object defaultValue, boolean ignoreCase) {
+        return IntrospectionSupport.getOrElseProperty(target, propertyName, defaultValue, ignoreCase);
+    }
+
+    @Override
+    public Method getPropertyGetter(Class<?> type, String propertyName) throws NoSuchMethodException {
+        return IntrospectionSupport.getPropertyGetter(type, propertyName);
+    }
+
+    @Override
+    public Method getPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase) throws NoSuchMethodException {
+        return IntrospectionSupport.getPropertyGetter(type, propertyName, ignoreCase);
+    }
+
+    @Override
+    public Method getPropertySetter(Class<?> type, String propertyName) throws NoSuchMethodException {
+        return IntrospectionSupport.getPropertySetter(type, propertyName);
+    }
+
+    @Override
+    public boolean isPropertyIsGetter(Class<?> type, String propertyName) {
+        return IntrospectionSupport.isPropertyIsGetter(type, propertyName);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean allowBuilderPattern) throws Exception {
+        return IntrospectionSupport.setProperties(target, properties, optionPrefix, allowBuilderPattern);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix) throws Exception {
+        return IntrospectionSupport.setProperties(target, properties, optionPrefix);
+    }
+
+    @Override
+    public Map<String, Object> extractProperties(Map<String, Object> properties, String optionPrefix) {
+        return IntrospectionSupport.extractProperties(properties, optionPrefix);
+    }
+
+    @Override
+    public Map<String, Object> extractProperties(Map<String, Object> properties, String optionPrefix, boolean remove) {
+        return IntrospectionSupport.extractProperties(properties, optionPrefix, remove);
+    }
+
+    @Override
+    @Deprecated
+    public Map<String, String> extractStringProperties(Map<String, Object> properties) {
+        return IntrospectionSupport.extractStringProperties(properties);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperties(CamelContext context, TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception {
+        return IntrospectionSupport.setProperties(context, typeConverter, target, properties);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperties(TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception {
+        return IntrospectionSupport.setProperties(typeConverter, target, properties);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperties(Object target, Map<String, Object> properties) throws Exception {
+        return IntrospectionSupport.setProperties(target, properties);
+    }
+
+    @Override
+    public boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName, boolean allowBuilderPattern) throws Exception {
+        return IntrospectionSupport.setProperty(context, typeConverter, target, name, value, refName, allowBuilderPattern);
+    }
+
+    @Override
+    public boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value, String refName, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) throws Exception {
+        return IntrospectionSupport.setProperty(context, typeConverter, target, name, value, refName, allowBuilderPattern, allowPrivateSetter, ignoreCase);
+    }
+
+    @Override
+    public boolean setProperty(CamelContext context, Object target, String name, Object value) throws Exception {
+        return IntrospectionSupport.setProperty(context, target, name, value);
+    }
+
+    @Override
+    public boolean setProperty(CamelContext context, TypeConverter typeConverter, Object target, String name, Object value) throws Exception {
+        return IntrospectionSupport.setProperty(context, typeConverter, target, name, value);
+    }
+
+    @Override
+    public boolean setProperty(TypeConverter typeConverter, Object target, String name, Object value) throws Exception {
+        return IntrospectionSupport.setProperty(typeConverter, target, name, value);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperty(Object target, String name, Object value, boolean allowBuilderPattern) throws Exception {
+        return IntrospectionSupport.setProperty(target, name, value, allowBuilderPattern);
+    }
+
+    @Override
+    @Deprecated
+    public boolean setProperty(Object target, String name, Object value) throws Exception {
+        return IntrospectionSupport.setProperty(target, name, value);
+    }
+
+    @Override
+    public Set<Method> findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) {
+        return IntrospectionSupport.findSetterMethods(clazz, name, allowBuilderPattern, allowPrivateSetter, ignoreCase);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        // noop
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        IntrospectionSupport.stop();
+    }
+}
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java b/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
index 7948897..fcff847 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
@@ -27,7 +27,6 @@ import javax.xml.namespace.QName;
 
 import org.apache.camel.processor.loadbalancer.LoadBalancer;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.support.IntrospectionSupport;
 
 /**
  * Balances message processing among a number of nodes
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallExpressionConfiguration.java b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallExpressionConfiguration.java
index 131766d..3335e76 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallExpressionConfiguration.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallExpressionConfiguration.java
@@ -42,7 +42,6 @@ import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 
 @Metadata(label = "routing,cloud")
@@ -244,7 +243,7 @@ public class ServiceCallExpressionConfiguration extends IdentifiedType implement
 
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(this, parameters, null, false);
+                    camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, parameters, null, false);
 
                     parameters.replaceAll(
                         (k, v) -> {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceChooserConfiguration.java b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceChooserConfiguration.java
index 4366890..033dcf0 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceChooserConfiguration.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceChooserConfiguration.java
@@ -38,7 +38,6 @@ import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 import org.apache.camel.util.ObjectHelper;
 
@@ -162,7 +161,7 @@ public class ServiceCallServiceChooserConfiguration extends IdentifiedType imple
 
             try {
                 Map<String, Object> parameters = new HashMap<>();
-                IntrospectionSupport.getProperties(this, parameters, null, false);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, parameters, null, false);
 
                 parameters.replaceAll(
                     (k, v) -> {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceDiscoveryConfiguration.java b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceDiscoveryConfiguration.java
index 81524ac..b2b334a 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceDiscoveryConfiguration.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceDiscoveryConfiguration.java
@@ -39,7 +39,6 @@ import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 import org.apache.camel.util.ObjectHelper;
 
@@ -169,7 +168,7 @@ public class ServiceCallServiceDiscoveryConfiguration extends IdentifiedType imp
 
             try {
                 Map<String, Object> parameters = new HashMap<>();
-                IntrospectionSupport.getProperties(this, parameters, null, false);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, parameters, null, false);
 
                 parameters.replaceAll(
                     (k, v) -> {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceFilterConfiguration.java b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceFilterConfiguration.java
index 5a4c3dc..6b704f7 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceFilterConfiguration.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceFilterConfiguration.java
@@ -38,7 +38,6 @@ import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 import org.apache.camel.util.ObjectHelper;
 
@@ -162,7 +161,7 @@ public class ServiceCallServiceFilterConfiguration extends IdentifiedType implem
 
             try {
                 Map<String, Object> parameters = new HashMap<>();
-                IntrospectionSupport.getProperties(this, parameters, null, false);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, parameters, null, false);
 
                 parameters.replaceAll(
                     (k, v) -> {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceLoadBalancerConfiguration.java b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceLoadBalancerConfiguration.java
index 07f7c23..417c83e 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceLoadBalancerConfiguration.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallServiceLoadBalancerConfiguration.java
@@ -38,7 +38,6 @@ import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 import org.apache.camel.util.ObjectHelper;
 
@@ -162,7 +161,7 @@ public class ServiceCallServiceLoadBalancerConfiguration extends IdentifiedType
 
             try {
                 Map<String, Object> parameters = new HashMap<>();
-                IntrospectionSupport.getProperties(this, parameters, null, false);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, parameters, null, false);
 
                 parameters.replaceAll(
                     (k, v) -> {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java b/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
index 4f59766f..b5ec0b6 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
@@ -36,6 +36,7 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.ExpressionFactory;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.NoSuchLanguageException;
 import org.apache.camel.Predicate;
 import org.apache.camel.model.DefinitionPropertyPlaceholderConfigurer;
@@ -44,7 +45,6 @@ import org.apache.camel.spi.Language;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.ScriptHelper;
 import org.apache.camel.util.CollectionStringBuffer;
 import org.apache.camel.util.ObjectHelper;
@@ -329,7 +329,7 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
      */
     protected void setProperty(CamelContext camelContext, Object bean, String name, Object value) {
         try {
-            IntrospectionSupport.setProperty(camelContext, bean, name, value);
+            camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, bean, name, value);
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property " + name + " on " + bean
                                                + ". Reason: " + e, e);
diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index 61a9337..ffb7d6f 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.function.Function;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.Model;
 import org.apache.camel.model.ProcessorDefinitionHelper;
@@ -66,7 +67,6 @@ import org.apache.camel.model.dataformat.YAMLDataFormat;
 import org.apache.camel.model.dataformat.ZipDeflaterDataFormat;
 import org.apache.camel.model.dataformat.ZipFileDataFormat;
 import org.apache.camel.spi.DataFormat;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 
 import static org.apache.camel.support.EndpointHelper.isReferenceParameter;
@@ -232,9 +232,9 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> {
         try {
             String ref = value instanceof String ? value.toString() : null;
             if (isReferenceParameter(ref) && camelContext != null) {
-                IntrospectionSupport.setProperty(camelContext, camelContext.getTypeConverter(), bean, name, null, ref, true);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, camelContext.getTypeConverter(), bean, name, null, ref, true);
             } else {
-                IntrospectionSupport.setProperty(camelContext, bean, name, value);
+                camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, bean, name, value);
             }
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property: " + name + " on: " + bean + ". Reason: " + e, e);
diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java b/core/camel-core/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
index 2110edf..4b245b9 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
@@ -21,12 +21,12 @@ import java.util.Map;
 import javax.xml.bind.JAXBContext;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.model.rest.RestBindingDefinition;
 import org.apache.camel.processor.RestBindingAdvice;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.RouteContext;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 
 public class RestBindingReifier {
@@ -96,8 +96,8 @@ public class RestBindingReifier {
                     clazz = context.getClassResolver().resolveMandatoryClass(typeName);
                 }
                 if (clazz != null) {
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), json, "unmarshalType", clazz);
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), json, "useList", type.endsWith("[]"));
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), json, "unmarshalType", clazz);
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), json, "useList", type.endsWith("[]"));
                 }
                 setAdditionalConfiguration(config, context, json, "json.in.");
 
@@ -108,8 +108,8 @@ public class RestBindingReifier {
                     outClazz = context.getClassResolver().resolveMandatoryClass(typeName);
                 }
                 if (outClazz != null) {
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), outJson, "unmarshalType", outClazz);
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), outJson, "useList", outType.endsWith("[]"));
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), outJson, "unmarshalType", outClazz);
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), outJson, "useList", outType.endsWith("[]"));
                 }
                 setAdditionalConfiguration(config, context, outJson, "json.out.");
             }
@@ -147,7 +147,7 @@ public class RestBindingReifier {
                 }
                 if (clazz != null) {
                     JAXBContext jc = JAXBContext.newInstance(clazz);
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), jaxb, "context", jc);
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), jaxb, "context", jc);
                 }
                 setAdditionalConfiguration(config, context, jaxb, "xml.in.");
 
@@ -159,11 +159,11 @@ public class RestBindingReifier {
                 }
                 if (outClazz != null) {
                     JAXBContext jc = JAXBContext.newInstance(outClazz);
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), outJaxb, "context", jc);
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), outJaxb, "context", jc);
                 } else if (clazz != null) {
                     // fallback and use the context from the input
                     JAXBContext jc = JAXBContext.newInstance(clazz);
-                    IntrospectionSupport.setProperty(context.getTypeConverter(), outJaxb, "context", jc);
+                    context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context.getTypeConverter(), outJaxb, "context", jc);
                 }
                 setAdditionalConfiguration(config, context, outJaxb, "xml.out.");
             }
diff --git a/core/camel-support/src/main/java/org/apache/camel/component/extension/verifier/DefaultComponentVerifierExtension.java b/core/camel-support/src/main/java/org/apache/camel/component/extension/verifier/DefaultComponentVerifierExtension.java
index 148111c..66e19f3 100644
--- a/core/camel-support/src/main/java/org/apache/camel/component/extension/verifier/DefaultComponentVerifierExtension.java
+++ b/core/camel-support/src/main/java/org/apache/camel/component/extension/verifier/DefaultComponentVerifierExtension.java
@@ -25,11 +25,11 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Component;
 import org.apache.camel.ComponentAware;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
 import org.apache.camel.runtimecatalog.EndpointValidationResult;
 import org.apache.camel.runtimecatalog.RuntimeCamelCatalog;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 
 import static org.apache.camel.util.StreamUtils.stream;
@@ -194,10 +194,7 @@ public class DefaultComponentVerifierExtension implements ComponentVerifierExten
     }
 
     protected <T> T setProperties(T instance, String prefix, Map<String, Object> properties) throws Exception {
-        return setProperties(
-            instance,
-            IntrospectionSupport.extractProperties(properties, prefix, false)
-        );
+        return setProperties(instance, getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().extractProperties(properties, prefix, false));
     }
 
     protected <T> Optional<T> getOption(Map<String, Object> parameters, String key, Class<T> type) {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index f802404..01e56f78 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -282,7 +282,7 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
 
         Map<String, Object> param = parameters;
         if (optionPrefix != null) {
-            param = IntrospectionSupport.extractProperties(parameters, optionPrefix);
+            param = getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().extractProperties(parameters, optionPrefix);
         }
 
         if (param.size() > 0) {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
index 6ebee7f..72174b6 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
@@ -27,6 +27,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.spi.ExceptionHandler;
@@ -395,7 +396,7 @@ public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint
 
     @Override
     public void configureProperties(Map<String, Object> options) {
-        Map<String, Object> consumerProperties = IntrospectionSupport.extractProperties(options, "consumer.");
+        Map<String, Object> consumerProperties = getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().extractProperties(options, "consumer.");
         if (consumerProperties != null && !consumerProperties.isEmpty()) {
             setConsumerProperties(consumerProperties);
         }
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/EndpointHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/EndpointHelper.java
index b72a4fb..7e5d00f 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/EndpointHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/EndpointHelper.java
@@ -29,6 +29,7 @@ import org.apache.camel.DelegateEndpoint;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.Processor;
 import org.apache.camel.ResolveEndpointFailedException;
@@ -181,7 +182,7 @@ public final class EndpointHelper {
             Object v = entry.getValue();
             String value = v != null ? v.toString() : null;
             if (isReferenceParameter(value)) {
-                boolean hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), bean, name, null, value, true);
+                boolean hit = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, context.getTypeConverter(), bean, name, null, value, true);
                 if (hit) {
                     // must remove as its a valid option and we could configure it
                     it.remove();
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
index fe0dd72..61c4069 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java
@@ -57,7 +57,10 @@ import static org.apache.camel.util.ObjectHelper.isNotEmpty;
  * <p/>
  * This implementation will use a cache when the {@link #getProperties(Object, java.util.Map, String)}
  * method is being used. Also the {@link #cacheClass(Class)} method gives access to the introspect cache.
+ *
+ * @deprecated use {@link org.apache.camel.spi.BeanIntrospection}
  */
+@Deprecated
 public final class IntrospectionSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(IntrospectionSupport.class);
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 9e328f4..ccc40ad 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
@@ -26,15 +26,13 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.function.Consumer;
-import java.util.function.Supplier;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.PropertyBindingException;
 import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.util.StringHelper;
 
-import static org.apache.camel.support.EndpointHelper.isReferenceParameter;
-import static org.apache.camel.support.IntrospectionSupport.findSetterMethods;
 import static org.apache.camel.util.ObjectHelper.isNotEmpty;
 
 /**
@@ -342,14 +340,14 @@ public final class PropertyBindingSupport {
                                                                      boolean bindNullOnly, boolean deepNesting, OnAutowiring callback) throws Exception {
 
         Map<String, Object> properties = new LinkedHashMap<>();
-        IntrospectionSupport.getProperties(target, properties, null);
+        camelContext.getExtension(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();
-            Class<?> type = getGetterType(target, key, false);
+            Class<?> type = getGetterType(camelContext, target, key, false);
 
             boolean skip = parents.contains(value) || value instanceof CamelContext;
             if (skip) {
@@ -365,7 +363,7 @@ public final class PropertyBindingSupport {
                     if (lookup.size() == 1) {
                         value = lookup.iterator().next();
                         if (value != null) {
-                            hit |= IntrospectionSupport.setProperty(camelContext, target, key, value);
+                            hit |= camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, target, key, value);
                             if (hit && callback != null) {
                                 callback.onAutowire(target, key, type, value);
                             }
@@ -376,7 +374,7 @@ public final class PropertyBindingSupport {
                 // 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(target.getClass(), key, true, true, false);
+                    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)) {
@@ -550,14 +548,14 @@ public final class PropertyBindingSupport {
                 // we should only iterate until until 2nd last so we use -1 in the for loop
                 for (int i = 0; i < parts.length - 1; i++) {
                     String part = parts[i];
-                    Object prop = getOrElseProperty(newTarget, part, null, ignoreCase);
+                    Object prop = getOrElseProperty(context, newTarget, part, null, ignoreCase);
                     if (prop == null) {
                         if (!deepNesting) {
                             // okay we cannot go further down
                             break;
                         }
                         // okay is there a setter so we can create a new instance and set it automatic
-                        Method method = findBestSetterMethod(newClass, part, fluentBuilder, allowPrivateSetter, ignoreCase);
+                        Method method = findBestSetterMethod(context, newClass, part, fluentBuilder, allowPrivateSetter, ignoreCase);
                         if (method != null) {
                             Class<?> parameterType = method.getParameterTypes()[0];
                             Object instance = null;
@@ -620,7 +618,7 @@ public final class PropertyBindingSupport {
                 }
             } else if (value.toString().equals("#autowired")) {
                 // we should get the type from the setter
-                Method method = findBestSetterMethod(target.getClass(), name, fluentBuilder, allowPrivateSetter, ignoreCase);
+                Method method = findBestSetterMethod(context, target.getClass(), name, fluentBuilder, allowPrivateSetter, ignoreCase);
                 if (method != null) {
                     Class<?> parameterType = method.getParameterTypes()[0];
                     Set<?> types = context.getRegistry().findByType(parameterType);
@@ -641,7 +639,7 @@ public final class PropertyBindingSupport {
             }
         }
 
-        boolean hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), target, name, value, refName, fluentBuilder, allowPrivateSetter, ignoreCase);
+        boolean hit = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, context.getTypeConverter(), target, name, value, refName, fluentBuilder, allowPrivateSetter, ignoreCase);
         if (!hit && mandatory) {
             // there is no setter with this given name, so lets report this as a problem
             throw new IllegalArgumentException("Cannot find setter method: " + name + " on bean: " + target + " of type: " + target.getClass().getName() + " when binding property: " + ognlPath);
@@ -649,7 +647,7 @@ public final class PropertyBindingSupport {
         return hit;
     }
 
-    private static Object getOrElseProperty(Object target, String property, Object defaultValue, boolean ignoreCase) {
+    private static Object getOrElseProperty(CamelContext context, Object target, String property, Object defaultValue, boolean ignoreCase) {
         String key = property;
         String lookupKey = null;
 
@@ -660,7 +658,7 @@ public final class PropertyBindingSupport {
             key = property.substring(0, pos);
         }
 
-        Object answer = IntrospectionSupport.getOrElseProperty(target, key, defaultValue, ignoreCase);
+        Object answer = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getOrElseProperty(target, key, defaultValue, ignoreCase);
         if (answer instanceof Map && lookupKey != null) {
             Map map = (Map) answer;
             answer = map.getOrDefault(lookupKey, defaultValue);
@@ -681,17 +679,17 @@ public final class PropertyBindingSupport {
         return answer != null ? answer : defaultValue;
     }
 
-    private static Method findBestSetterMethod(Class clazz, String name,
+    private static Method findBestSetterMethod(CamelContext context, Class clazz, String name,
                                                boolean fluentBuilder, boolean allowPrivateSetter, boolean ignoreCase) {
         // is there a direct setter?
-        Set<Method> candidates = findSetterMethods(clazz, name, false, allowPrivateSetter, ignoreCase);
+        Set<Method> candidates = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().findSetterMethods(clazz, name, false, allowPrivateSetter, ignoreCase);
         if (candidates.size() == 1) {
             return candidates.iterator().next();
         }
 
         // okay now try with builder pattern
         if (fluentBuilder) {
-            candidates = findSetterMethods(clazz, name, fluentBuilder, allowPrivateSetter, ignoreCase);
+            candidates = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().findSetterMethods(clazz, name, fluentBuilder, allowPrivateSetter, ignoreCase);
             if (candidates.size() == 1) {
                 return candidates.iterator().next();
             }
@@ -700,15 +698,15 @@ public final class PropertyBindingSupport {
         return null;
     }
 
-    private static Class getGetterType(Object target, String name, boolean ignoreCase) {
+    private static Class getGetterType(CamelContext context, Object target, String name, boolean ignoreCase) {
         try {
             if (ignoreCase) {
-                Method getter = IntrospectionSupport.getPropertyGetter(target.getClass(), name, true);
+                Method getter = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getPropertyGetter(target.getClass(), name, true);
                 if (getter != null) {
                     return getter.getReturnType();
                 }
             } else {
-                Method getter = IntrospectionSupport.getPropertyGetter(target.getClass(), name);
+                Method getter = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getPropertyGetter(target.getClass(), name);
                 if (getter != null) {
                     return getter.getReturnType();
                 }
@@ -739,7 +737,7 @@ public final class PropertyBindingSupport {
             String value = v != null ? v.toString() : null;
             if (isReferenceParameter(value)) {
                 try {
-                    boolean hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), target, name, null, value, true);
+                    boolean hit = context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, context.getTypeConverter(), target, name, null, value, true);
                     if (hit) {
                         // must remove as its a valid option and we could configure it
                         it.remove();
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
index c620048..098ff92 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
@@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.FailedToCreateConsumerException;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.PollingConsumerPollingStrategy;
@@ -419,7 +420,7 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer implements R
 
         // configure scheduler with options from this consumer
         Map<String, Object> properties = new LinkedHashMap<>();
-        IntrospectionSupport.getProperties(this, properties, null);
+        getEndpoint().getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(this, properties, null);
         PropertyBindingSupport.build().bind(getEndpoint().getCamelContext(), scheduler, properties);
         if (schedulerProperties != null && !schedulerProperties.isEmpty()) {
             // need to use a copy in case the consumer is restarted so we keep the properties
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
index f9a846c..4d06813 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Component;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.ResolveEndpointFailedException;
@@ -107,7 +108,7 @@ public abstract class ScheduledPollEndpoint extends DefaultEndpoint {
     protected void configureScheduledPollConsumerProperties(Map<String, Object> options, Map<String, Object> consumerProperties) {
         // special for scheduled poll consumers as we want to allow end users to configure its options
         // from the URI parameters without the consumer. prefix
-        Map<String, Object> schedulerProperties = IntrospectionSupport.extractProperties(options, "scheduler.");
+        Map<String, Object> schedulerProperties = getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().extractProperties(options, "scheduler.");
         if (schedulerProperties != null && !schedulerProperties.isEmpty()) {
             setSchedulerProperties(schedulerProperties);
         }
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
index ef8abc9..00cc314 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
@@ -31,6 +31,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.CamelExecutionException;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.Message;
 import org.apache.camel.NoSuchLanguageException;
@@ -44,7 +45,6 @@ import org.apache.camel.support.ExchangeHelper;
 import org.apache.camel.support.ExpressionAdapter;
 import org.apache.camel.support.GroupIterator;
 import org.apache.camel.support.GroupTokenIterator;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.LanguageSupport;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
@@ -1417,7 +1417,7 @@ public class ExpressionBuilder {
 
     protected static void setProperty(CamelContext camelContext, Object bean, String name, Object value) {
         try {
-            IntrospectionSupport.setProperty(camelContext, bean, name, value);
+            camelContext.getExtension(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, bean, name, value);
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property " + name + " on " + bean + ". Reason: " + e, e);
         }
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiComponent.java
index ad68368..84a9077 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiComponent.java
@@ -23,9 +23,9 @@ import java.util.Map;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelException;
 import org.apache.camel.Endpoint;
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.support.IntrospectionSupport;
 import org.apache.camel.support.PropertyBindingSupport;
 
 /**
@@ -108,7 +108,7 @@ public abstract class AbstractApiComponent<E extends Enum<E> & ApiName, T, S ext
         final Map<String, Object> componentProperties = new HashMap<>();
         // copy component configuration, if set
         if (configuration != null) {
-            IntrospectionSupport.getProperties(configuration, componentProperties, null, false);
+            getCamelContext().getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(configuration, componentProperties, null, false);
         }
 
         // create endpoint configuration with component properties
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
index d6674aa..0aca298 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
@@ -89,8 +89,8 @@ public abstract class ApiMethodPropertiesHelper<C> {
     }
 
     public void getEndpointProperties(Object endpointConfiguration, Map<String, Object> properties) {
-
         Set<String> names = null;
+        // TODO: camel context
         if (IntrospectionSupport.getProperties(endpointConfiguration, properties, null, false)) {
             names = properties.keySet();
             // remove component config properties so we only have endpoint properties
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java b/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java
index d926508..b185713 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/jndi/JndiContext.java
@@ -441,6 +441,7 @@ public class JndiContext implements Context, Serializable {
         }
     }
 
+    @Deprecated
     protected static Object createBean(Class<?> type, Map<String, Object> properties, String prefix) throws Exception {
         Object value = ObjectHelper.newInstance(type);
         IntrospectionSupport.setProperties(value, properties, prefix);
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/management/MBeanInfoAssembler.java b/core/camel-support/src/main/java/org/apache/camel/support/management/MBeanInfoAssembler.java
index 1a790be..924e326 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/management/MBeanInfoAssembler.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/management/MBeanInfoAssembler.java
@@ -190,6 +190,7 @@ public class MBeanInfoAssembler implements Service {
         LOG.trace("Extracting attributes and operations from class: {}", managedClass);
 
         // introspect the class, and leverage the cache to have better performance
+        // TODO: get this via camel context
         IntrospectionSupport.ClassInfo cache = IntrospectionSupport.cacheClass(managedClass);
 
         for (IntrospectionSupport.MethodInfo cacheInfo : cache.methods) {


[camel] 03/03: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4249ce806ff2d7c3004772ac93e8e397e94e5962
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 22 10:24:49 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 .../apache/camel/component/log/LogComponent.java   | 10 +++----
 .../org/apache/camel/spi/BeanIntrospection.java    | 32 ++++++++++++++--------
 .../impl/engine/DefaultBeanIntrospection.java      |  2 ++
 .../component/ApiMethodPropertiesHelperTest.java   |  4 +--
 .../org/apache/camel/support/DefaultComponent.java |  5 +++-
 .../camel/support/PropertyBindingSupport.java      |  2 --
 .../camel/support/ScheduledPollEndpoint.java       |  3 +-
 .../support/component/AbstractApiEndpoint.java     |  5 ++--
 .../component/ApiMethodPropertiesHelper.java       | 14 +++++-----
 9 files changed, 44 insertions(+), 33 deletions(-)

diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
index 1164041..403fc89 100644
--- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
+++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
@@ -58,18 +58,18 @@ public class LogComponent extends DefaultComponent {
         }
 
         // first, try to pick up the ExchangeFormatter from the registry
-        ExchangeFormatter localFormatter = getCamelContext().getRegistry().lookupByNameAndType("logFormatter", ExchangeFormatter.class);
-        if (localFormatter != null) {
-            setProperties(localFormatter, parameters);
+        ExchangeFormatter logFormatter = getCamelContext().getRegistry().lookupByNameAndType("logFormatter", ExchangeFormatter.class);
+        if (logFormatter != null) {
+            setProperties(logFormatter, parameters);
         } else if (exchangeFormatter != null) {
             // do not set properties, the exchangeFormatter is explicitly set, therefore the
             // user would have set its properties explicitly too
-            localFormatter = exchangeFormatter;
+            logFormatter = exchangeFormatter;
         }
 
         LogEndpoint endpoint = new LogEndpoint(uri, this);
         endpoint.setLevel(level.name());
-        endpoint.setLocalFormatter(localFormatter);
+        endpoint.setExchangeFormatter(logFormatter);
         if (providedLogger == null) {
             endpoint.setLoggerName(remaining);
         } else {
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
index 98a5a81..805b98d 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/BeanIntrospection.java
@@ -24,6 +24,14 @@ import java.util.Set;
 import org.apache.camel.CamelContext;
 import org.apache.camel.TypeConverter;
 
+// TODO: Keep only public used methods so we can remove the tech debt
+
+/**
+ * Used for introspecting beans properties via Java reflection; such as extracting current property values,
+ * or updating one or more properties etc.
+ *
+ * End users should favour using org.apache.camel.support.PropertyBindingSupport instead.
+ */
 public interface BeanIntrospection {
 
     boolean isGetter(Method method);
@@ -73,13 +81,13 @@ public interface BeanIntrospection {
      */
     boolean getProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean includeNull);
 
-    /**
-     * Introspects the given class.
-     *
-     * @param clazz the class
-     * @return the introspection result as a {@link ClassInfo} structure.
-     */
-    // TODO:
+//    /**
+//     * Introspects the given class.
+//     *
+//     * @param clazz the class
+//     * @return the introspection result as a {@link ClassInfo} structure.
+//     */
+    // TODO: JMX uses this so we should find a way
     //ClassInfo cacheClass(Class<?> clazz);
 
     boolean hasProperties(Map<String, Object> properties, String optionPrefix);
@@ -99,13 +107,13 @@ public interface BeanIntrospection {
     boolean isPropertyIsGetter(Class<?> type, String propertyName);
 
     /**
-     * @deprecated use {@link PropertyBindingSupport}
+     * @deprecated use org.apache.camel.support.PropertyBindingSupport
      */
     @Deprecated
     boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean allowBuilderPattern) throws Exception;
 
     /**
-     * @deprecated use {@link PropertyBindingSupport}
+     * @deprecated use org.apache.camel.support.PropertyBindingSupport
      */
     @Deprecated
     boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix) throws Exception;
@@ -118,19 +126,19 @@ public interface BeanIntrospection {
     Map<String, String> extractStringProperties(Map<String, Object> properties);
 
     /**
-     * @deprecated use {@link PropertyBindingSupport}
+     * @deprecated use org.apache.camel.support.PropertyBindingSupport
      */
     @Deprecated
     boolean setProperties(CamelContext context, TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception;
 
     /**
-     * @deprecated use {@link PropertyBindingSupport}
+     * @deprecated use org.apache.camel.support.PropertyBindingSupport
      */
     @Deprecated
     boolean setProperties(TypeConverter typeConverter, Object target, Map<String, Object> properties) throws Exception;
 
     /**
-     * @deprecated use {@link PropertyBindingSupport}
+     * @deprecated use org.apache.camel.support.PropertyBindingSupport
      */
     @Deprecated
     boolean setProperties(Object target, Map<String, Object> properties) throws Exception;
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
index f9f9b79..768ff50 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultBeanIntrospection.java
@@ -30,6 +30,8 @@ import org.apache.camel.support.service.ServiceSupport;
 @SuppressWarnings("deprecation")
 public class DefaultBeanIntrospection extends ServiceSupport implements BeanIntrospection {
 
+    // TODO: Add runtime statistics so we can report how much Java reflection has been in use
+
     @Override
     public boolean isGetter(Method method) {
         return IntrospectionSupport.isGetter(method);
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/component/ApiMethodPropertiesHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/support/component/ApiMethodPropertiesHelperTest.java
index 8f8d8b4..27ea7c9 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/component/ApiMethodPropertiesHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/component/ApiMethodPropertiesHelperTest.java
@@ -71,7 +71,7 @@ public class ApiMethodPropertiesHelperTest {
         endpointConfiguration.setProperty2(VALUE_2);
         endpointConfiguration.setProperty3(VALUE_3);
         endpointConfiguration.setProperty4(Boolean.valueOf(VALUE_4));
-        propertiesHelper.getEndpointProperties(endpointConfiguration, properties);
+        propertiesHelper.getEndpointProperties(new DefaultCamelContext(), endpointConfiguration, properties);
         assertEquals(2, properties.size());
     }
 
@@ -80,7 +80,7 @@ public class ApiMethodPropertiesHelperTest {
         final TestEndpointConfiguration endpointConfiguration = new TestEndpointConfiguration();
         endpointConfiguration.setProperty1(VALUE_1);
         endpointConfiguration.setProperty4(Boolean.valueOf(VALUE_4));
-        assertEquals(1, propertiesHelper.getEndpointPropertyNames(endpointConfiguration).size());
+        assertEquals(1, propertiesHelper.getEndpointPropertyNames(new DefaultCamelContext(), endpointConfiguration).size());
     }
 
     @Test
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index 01e56f78..e461970 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -210,7 +210,10 @@ public abstract class DefaultComponent extends ServiceSupport implements Compone
             return null;
         }
 
-        // setup whether to use basic property binding or not which must be done before we set properties 
+        // inject camel context
+        endpoint.setCamelContext(getCamelContext());
+
+        // setup whether to use basic property binding or not which must be done before we set properties
         boolean basic = getAndRemoveParameter(parameters, "basicPropertyBinding", boolean.class, basicPropertyBinding);
         if (endpoint instanceof DefaultEndpoint) {
             ((DefaultEndpoint) endpoint).setBasicPropertyBinding(basic);
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 ccc40ad..1d3e7a9 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
@@ -52,8 +52,6 @@ import static org.apache.camel.util.ObjectHelper.isNotEmpty;
  *                               then you specify the method as shown: #class:com.foo.MyClassType#myFactoryMethod</li>.
  *     <li>ignore case - Whether to ignore case for property keys<li>
  * </ul>
- * <p/>
- * This implementations reuses parts of {@link IntrospectionSupport}.
  */
 public final class PropertyBindingSupport {
 
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
index 4d06813..a5d6c98 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollEndpoint.java
@@ -113,7 +113,8 @@ public abstract class ScheduledPollEndpoint extends DefaultEndpoint {
             setSchedulerProperties(schedulerProperties);
         }
 
-        String schedulerName = (String) options.get("scheduler");
+        // options take precedence
+        String schedulerName = (String) options.getOrDefault("scheduler", scheduler);
         if (schedulerName != null) {
             if ("spring".equals(schedulerName)) {
                 // special for scheduler if its "spring" or "quartz"
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
index 87e95b8..da4b2c9 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
@@ -32,7 +32,6 @@ import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.ThreadPoolProfile;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.DefaultEndpoint;
-import org.apache.camel.support.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -126,9 +125,9 @@ public abstract class AbstractApiEndpoint<E extends ApiName, T>
 
         // compute endpoint property names and values
         this.endpointPropertyNames = Collections.unmodifiableSet(
-            getPropertiesHelper().getEndpointPropertyNames(configuration));
+            getPropertiesHelper().getEndpointPropertyNames(getCamelContext(), configuration));
         final HashMap<String, Object> properties = new HashMap<>();
-        getPropertiesHelper().getEndpointProperties(configuration, properties);
+        getPropertiesHelper().getEndpointProperties(getCamelContext(), configuration, properties);
         this.endpointProperties = Collections.unmodifiableMap(properties);
 
         // get endpoint property names
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
index 0aca298..3016a78 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
@@ -23,8 +23,9 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
-import org.apache.camel.support.IntrospectionSupport;
+import org.apache.camel.ExtendedCamelContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -78,7 +79,7 @@ public abstract class ApiMethodPropertiesHelper<C> {
                 nProperties++;
             } else if (camelCasePrefix != null && key.startsWith(camelCasePrefix)) {
                 // assuming all property names start with a lowercase character
-                final String propertyName = String.valueOf(Character.toLowerCase(key.charAt(prefixLength - 1)))
+                final String propertyName = Character.toLowerCase(key.charAt(prefixLength - 1))
                     + key.substring(prefixLength);
                 properties.put(propertyName, entry.getValue());
                 nProperties++;
@@ -88,10 +89,9 @@ public abstract class ApiMethodPropertiesHelper<C> {
         return properties;
     }
 
-    public void getEndpointProperties(Object endpointConfiguration, Map<String, Object> properties) {
+    public void getEndpointProperties(CamelContext context, Object endpointConfiguration, Map<String, Object> properties) {
         Set<String> names = null;
-        // TODO: camel context
-        if (IntrospectionSupport.getProperties(endpointConfiguration, properties, null, false)) {
+        if (context.getExtension(ExtendedCamelContext.class).getBeanIntrospection().getProperties(endpointConfiguration, properties, null, false)) {
             names = properties.keySet();
             // remove component config properties so we only have endpoint properties
             names.removeAll(componentConfigFields);
@@ -99,9 +99,9 @@ public abstract class ApiMethodPropertiesHelper<C> {
         LOG.debug("Found endpoint properties {}", names);
     }
 
-    public Set<String> getEndpointPropertyNames(Object endpointConfiguration) {
+    public Set<String> getEndpointPropertyNames(CamelContext context, Object endpointConfiguration) {
         Map<String, Object> properties = new HashMap<>();
-        getEndpointProperties(endpointConfiguration, properties);
+        getEndpointProperties(context, endpointConfiguration, properties);
         return Collections.unmodifiableSet(properties.keySet());
     }