camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [2/2] camel git commit: CAMEL-10584: spring boot auto configuration mojo: use Class.isAssignableFrom instead of instanceof as the later may fail at compile time in case of final classes
Date Fri, 09 Dec 2016 17:53:15 GMT
CAMEL-10584: spring boot auto configuration mojo: use Class.isAssignableFrom instead of instanceof as the later may fail at compile time in case of final classes


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/49f35d12
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/49f35d12
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/49f35d12

Branch: refs/heads/master
Commit: 49f35d1276d6789e6bcf4a701193538a7c1d3315
Parents: 6b979d0
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Fri Dec 9 18:52:19 2016 +0100
Committer: lburgazzoli <lburgazzoli@gmail.com>
Committed: Fri Dec 9 18:52:19 2016 +0100

----------------------------------------------------------------------
 .../AvroDataFormatAutoConfiguration.java        |  8 ++++++--
 .../BarcodeDataFormatAutoConfiguration.java     |  8 ++++++--
 .../Base64DataFormatAutoConfiguration.java      |  8 ++++++--
 .../BeanIODataFormatAutoConfiguration.java      |  8 ++++++--
 .../BindyCsvDataFormatAutoConfiguration.java    |  8 ++++++--
 ...yFixedLengthDataFormatAutoConfiguration.java |  9 +++++++--
 ...KeyValuePairDataFormatAutoConfiguration.java |  9 +++++++--
 .../BoonDataFormatAutoConfiguration.java        |  8 ++++++--
 .../CastorDataFormatAutoConfiguration.java      |  8 ++++++--
 .../GzipDataFormatAutoConfiguration.java        |  8 ++++++--
 ...erializationDataFormatAutoConfiguration.java |  9 +++++++--
 .../StringDataFormatAutoConfiguration.java      |  8 ++++++--
 .../ZipDataFormatAutoConfiguration.java         |  8 ++++++--
 .../BeanLanguageAutoConfiguration.java          |  8 ++++++--
 .../ConstantLanguageAutoConfiguration.java      |  8 ++++++--
 .../HeaderLanguageAutoConfiguration.java        |  8 ++++++--
 ...changePropertyLanguageAutoConfiguration.java |  9 +++++++--
 .../RefLanguageAutoConfiguration.java           |  8 ++++++--
 .../FileLanguageAutoConfiguration.java          |  8 ++++++--
 .../SimpleLanguageAutoConfiguration.java        |  8 ++++++--
 .../TokenizeLanguageAutoConfiguration.java      |  8 ++++++--
 .../XMLTokenizeLanguageAutoConfiguration.java   |  8 ++++++--
 .../XPathLanguageAutoConfiguration.java         |  8 ++++++--
 .../CryptoDataFormatAutoConfiguration.java      |  8 ++++++--
 .../PGPDataFormatAutoConfiguration.java         |  8 ++++++--
 .../CsvDataFormatAutoConfiguration.java         |  8 ++++++--
 .../FlatpackDataFormatAutoConfiguration.java    |  8 ++++++--
 .../GroovyLanguageAutoConfiguration.java        |  8 ++++++--
 .../GsonDataFormatAutoConfiguration.java        |  8 ++++++--
 .../HessianDataFormatAutoConfiguration.java     |  8 ++++++--
 .../HL7DataFormatAutoConfiguration.java         |  8 ++++++--
 .../TerserLanguageAutoConfiguration.java        |  8 ++++++--
 .../ICalDataFormatAutoConfiguration.java        |  8 ++++++--
 .../JacksonDataFormatAutoConfiguration.java     |  8 ++++++--
 .../JacksonXMLDataFormatAutoConfiguration.java  |  9 +++++++--
 .../JaxbDataFormatAutoConfiguration.java        |  8 ++++++--
 .../JibxDataFormatAutoConfiguration.java        |  8 ++++++--
 .../JohnzonDataFormatAutoConfiguration.java     |  8 ++++++--
 .../SqlLanguageAutoConfiguration.java           |  8 ++++++--
 .../JsonPathLanguageAutoConfiguration.java      |  8 ++++++--
 .../JuelLanguageAutoConfiguration.java          |  8 ++++++--
 .../JXPathLanguageAutoConfiguration.java        |  8 ++++++--
 .../LZFDataFormatAutoConfiguration.java         |  8 ++++++--
 ...imeMultipartDataFormatAutoConfiguration.java |  9 +++++++--
 .../MvelLanguageAutoConfiguration.java          |  8 ++++++--
 .../OgnlLanguageAutoConfiguration.java          |  8 ++++++--
 .../ProtobufDataFormatAutoConfiguration.java    |  8 ++++++--
 .../RssDataFormatAutoConfiguration.java         |  8 ++++++--
 .../XQueryLanguageAutoConfiguration.java        |  8 ++++++--
 .../JavaScriptLanguageAutoConfiguration.java    |  8 ++++++--
 .../PhpLanguageAutoConfiguration.java           |  8 ++++++--
 .../PythonLanguageAutoConfiguration.java        |  8 ++++++--
 .../RubyLanguageAutoConfiguration.java          |  8 ++++++--
 .../SnakeYAMLDataFormatAutoConfiguration.java   |  8 ++++++--
 .../SoapJaxbDataFormatAutoConfiguration.java    |  8 ++++++--
 .../SpelLanguageAutoConfiguration.java          |  8 ++++++--
 .../SyslogDataFormatAutoConfiguration.java      |  8 ++++++--
 .../TidyMarkupDataFormatAutoConfiguration.java  |  9 +++++++--
 .../TarFileDataFormatAutoConfiguration.java     |  8 ++++++--
 ...UniVocityCsvDataFormatAutoConfiguration.java |  9 +++++++--
 ...tyFixedWidthDataFormatAutoConfiguration.java |  9 +++++++--
 ...UniVocityTsvDataFormatAutoConfiguration.java |  9 +++++++--
 .../XmlBeansDataFormatAutoConfiguration.java    |  8 ++++++--
 .../XmlJsonDataFormatAutoConfiguration.java     |  8 ++++++--
 .../XmlRpcDataFormatAutoConfiguration.java      |  8 ++++++--
 .../XMLSecurityDataFormatAutoConfiguration.java |  9 +++++++--
 .../JsonDataFormatAutoConfiguration.java        |  8 ++++++--
 .../XStreamDataFormatAutoConfiguration.java     |  8 ++++++--
 .../ZipFileDataFormatAutoConfiguration.java     |  8 ++++++--
 .../SpringBootAutoConfigurationMojo.java        | 21 +++++++++++++-------
 70 files changed, 439 insertions(+), 145 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
index 7df77f3..dee5a8f 100644
--- a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
+++ b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class AvroDataFormatAutoConfiguration {
     public AvroDataFormat configureAvroDataFormat(CamelContext camelContext,
             AvroDataFormatConfiguration configuration) throws Exception {
         AvroDataFormat dataformat = new AvroDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(AvroDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
index 9b2db89..cf84be8 100644
--- a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
+++ b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class BarcodeDataFormatAutoConfiguration {
             CamelContext camelContext,
             BarcodeDataFormatConfiguration configuration) throws Exception {
         BarcodeDataFormat dataformat = new BarcodeDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(BarcodeDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
index bdfdddb..a84ad11 100644
--- a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
+++ b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class Base64DataFormatAutoConfiguration {
             CamelContext camelContext,
             Base64DataFormatConfiguration configuration) throws Exception {
         Base64DataFormat dataformat = new Base64DataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(Base64DataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
index 073f81b..f207b6f 100644
--- a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
+++ b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class BeanIODataFormatAutoConfiguration {
             CamelContext camelContext,
             BeanIODataFormatConfiguration configuration) throws Exception {
         BeanIODataFormat dataformat = new BeanIODataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(BeanIODataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
index 1123c02..9309645 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class BindyCsvDataFormatAutoConfiguration {
             CamelContext camelContext,
             BindyCsvDataFormatConfiguration configuration) throws Exception {
         BindyCsvDataFormat dataformat = new BindyCsvDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(BindyCsvDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
index 648cc9e..b19ac42 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
@@ -57,8 +57,13 @@ public class BindyFixedLengthDataFormatAutoConfiguration {
             BindyFixedLengthDataFormatConfiguration configuration)
             throws Exception {
         BindyFixedLengthDataFormat dataformat = new BindyFixedLengthDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(BindyFixedLengthDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
index b886d55..27b0cbd 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
@@ -57,8 +57,13 @@ public class BindyKeyValuePairDataFormatAutoConfiguration {
             BindyKeyValuePairDataFormatConfiguration configuration)
             throws Exception {
         BindyKeyValuePairDataFormat dataformat = new BindyKeyValuePairDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(BindyKeyValuePairDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatAutoConfiguration.java b/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatAutoConfiguration.java
index 8bc309f..ff20711 100644
--- a/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-boon-starter/src/main/java/org/apache/camel/component/boon/springboot/BoonDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class BoonDataFormatAutoConfiguration {
     public BoonDataFormat configureBoonDataFormat(CamelContext camelContext,
             BoonDataFormatConfiguration configuration) throws Exception {
         BoonDataFormat dataformat = new BoonDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(BoonDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatAutoConfiguration.java b/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatAutoConfiguration.java
index 571f926..07ec505 100644
--- a/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatAutoConfiguration.java
+++ b/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class CastorDataFormatAutoConfiguration {
             CamelContext camelContext,
             CastorDataFormatConfiguration configuration) throws Exception {
         CastorDataFormat dataformat = new CastorDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(CastorDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java
index 77078c5..91b952c 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/GzipDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class GzipDataFormatAutoConfiguration {
     public GzipDataFormat configureGzipDataFormat(CamelContext camelContext,
             GzipDataFormatConfiguration configuration) throws Exception {
         GzipDataFormat dataformat = new GzipDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(GzipDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java
index c70e82c..b19cd1d 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/SerializationDataFormatAutoConfiguration.java
@@ -57,8 +57,13 @@ public class SerializationDataFormatAutoConfiguration {
             SerializationDataFormatConfiguration configuration)
             throws Exception {
         SerializationDataFormat dataformat = new SerializationDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(SerializationDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java
index 013dfe3..e3ebb70 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/StringDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class StringDataFormatAutoConfiguration {
             CamelContext camelContext,
             StringDataFormatConfiguration configuration) throws Exception {
         StringDataFormat dataformat = new StringDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(StringDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java
index 67e33c7..992c168 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class ZipDataFormatAutoConfiguration {
     public ZipDataFormat configureZipDataFormat(CamelContext camelContext,
             ZipDataFormatConfiguration configuration) throws Exception {
         ZipDataFormat dataformat = new ZipDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(ZipDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
index ad45257..6f93fd8 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class BeanLanguageAutoConfiguration {
     public BeanLanguage configureBeanLanguage(CamelContext camelContext,
             BeanLanguageConfiguration configuration) throws Exception {
         BeanLanguage language = new BeanLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(BeanLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
index b062568..50a4b7a 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
@@ -56,8 +56,12 @@ public class ConstantLanguageAutoConfiguration {
             CamelContext camelContext,
             ConstantLanguageConfiguration configuration) throws Exception {
         ConstantLanguage language = new ConstantLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(ConstantLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
index 01aa8fe..d49c098 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class HeaderLanguageAutoConfiguration {
     public HeaderLanguage configureHeaderLanguage(CamelContext camelContext,
             HeaderLanguageConfiguration configuration) throws Exception {
         HeaderLanguage language = new HeaderLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(HeaderLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
index b098307..e4456cb 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
@@ -57,8 +57,13 @@ public class ExchangePropertyLanguageAutoConfiguration {
             ExchangePropertyLanguageConfiguration configuration)
             throws Exception {
         ExchangePropertyLanguage language = new ExchangePropertyLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(ExchangePropertyLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
index 7e90daa..4c64f98 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class RefLanguageAutoConfiguration {
     public RefLanguage configureRefLanguage(CamelContext camelContext,
             RefLanguageConfiguration configuration) throws Exception {
         RefLanguage language = new RefLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(RefLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
index 6f9eaaf..4891f8a 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class FileLanguageAutoConfiguration {
     public FileLanguage configureFileLanguage(CamelContext camelContext,
             FileLanguageConfiguration configuration) throws Exception {
         FileLanguage language = new FileLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(FileLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
index a0beebd..e793c92 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class SimpleLanguageAutoConfiguration {
     public SimpleLanguage configureSimpleLanguage(CamelContext camelContext,
             SimpleLanguageConfiguration configuration) throws Exception {
         SimpleLanguage language = new SimpleLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(SimpleLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
index 6806fc6..1dbb098 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
@@ -56,8 +56,12 @@ public class TokenizeLanguageAutoConfiguration {
             CamelContext camelContext,
             TokenizeLanguageConfiguration configuration) throws Exception {
         TokenizeLanguage language = new TokenizeLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(TokenizeLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java
index fa03927..d346612 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java
@@ -56,8 +56,12 @@ public class XMLTokenizeLanguageAutoConfiguration {
             CamelContext camelContext,
             XMLTokenizeLanguageConfiguration configuration) throws Exception {
         XMLTokenizeLanguage language = new XMLTokenizeLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(XMLTokenizeLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java
index bf52c66..dc8526d 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class XPathLanguageAutoConfiguration {
     public XPathLanguage configureXPathLanguage(CamelContext camelContext,
             XPathLanguageConfiguration configuration) throws Exception {
         XPathLanguage language = new XPathLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(XPathLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
index 2bad909..3837a72 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class CryptoDataFormatAutoConfiguration {
             CamelContext camelContext,
             CryptoDataFormatConfiguration configuration) throws Exception {
         CryptoDataFormat dataformat = new CryptoDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(CryptoDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
index bf33fe5..5df0116 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class PGPDataFormatAutoConfiguration {
     public PGPDataFormat configurePGPDataFormat(CamelContext camelContext,
             PGPDataFormatConfiguration configuration) throws Exception {
         PGPDataFormat dataformat = new PGPDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(PGPDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
index bb08fbd..15298a3 100644
--- a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
+++ b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class CsvDataFormatAutoConfiguration {
     public CsvDataFormat configureCsvDataFormat(CamelContext camelContext,
             CsvDataFormatConfiguration configuration) throws Exception {
         CsvDataFormat dataformat = new CsvDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(CsvDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
index d22870e..04c4ed4 100644
--- a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
+++ b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class FlatpackDataFormatAutoConfiguration {
             CamelContext camelContext,
             FlatpackDataFormatConfiguration configuration) throws Exception {
         FlatpackDataFormat dataformat = new FlatpackDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(FlatpackDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
index 4f85f16..31ae769 100644
--- a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
+++ b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class GroovyLanguageAutoConfiguration {
     public GroovyLanguage configureGroovyLanguage(CamelContext camelContext,
             GroovyLanguageConfiguration configuration) throws Exception {
         GroovyLanguage language = new GroovyLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(GroovyLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
index 4da9dad..1e70c02 100644
--- a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class GsonDataFormatAutoConfiguration {
     public GsonDataFormat configureGsonDataFormat(CamelContext camelContext,
             GsonDataFormatConfiguration configuration) throws Exception {
         GsonDataFormat dataformat = new GsonDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(GsonDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatAutoConfiguration.java b/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatAutoConfiguration.java
index 70a3df1..17546ea 100644
--- a/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatAutoConfiguration.java
+++ b/components-starter/camel-hessian-starter/src/main/java/org/apache/camel/dataformat/hessian/springboot/HessianDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class HessianDataFormatAutoConfiguration {
             CamelContext camelContext,
             HessianDataFormatConfiguration configuration) throws Exception {
         HessianDataFormat dataformat = new HessianDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(HessianDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
index 6669dd2..fdf2b1d 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class HL7DataFormatAutoConfiguration {
     public HL7DataFormat configureHL7DataFormat(CamelContext camelContext,
             HL7DataFormatConfiguration configuration) throws Exception {
         HL7DataFormat dataformat = new HL7DataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(HL7DataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java
index d876341..f64fe5e 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/TerserLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class TerserLanguageAutoConfiguration {
     public TerserLanguage configureTerserLanguage(CamelContext camelContext,
             TerserLanguageConfiguration configuration) throws Exception {
         TerserLanguage language = new TerserLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(TerserLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
index 9bb9f04..3943c8f 100644
--- a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
+++ b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class ICalDataFormatAutoConfiguration {
     public ICalDataFormat configureICalDataFormat(CamelContext camelContext,
             ICalDataFormatConfiguration configuration) throws Exception {
         ICalDataFormat dataformat = new ICalDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(ICalDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
index 1a902d2..f75f042 100644
--- a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class JacksonDataFormatAutoConfiguration {
             CamelContext camelContext,
             JacksonDataFormatConfiguration configuration) throws Exception {
         JacksonDataFormat dataformat = new JacksonDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JacksonDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
index f7ee92e..0061a0c 100644
--- a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
@@ -56,8 +56,13 @@ public class JacksonXMLDataFormatAutoConfiguration {
             CamelContext camelContext,
             JacksonXMLDataFormatConfiguration configuration) throws Exception {
         JacksonXMLDataFormat dataformat = new JacksonXMLDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(JacksonXMLDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
index cc79bae..23aa3c1 100644
--- a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class JaxbDataFormatAutoConfiguration {
     public JaxbDataFormat configureJaxbDataFormat(CamelContext camelContext,
             JaxbDataFormatConfiguration configuration) throws Exception {
         JaxbDataFormat dataformat = new JaxbDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JaxbDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatAutoConfiguration.java b/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatAutoConfiguration.java
index 7c287d9..7842ce0 100644
--- a/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jibx-starter/src/main/java/org/apache/camel/dataformat/jibx/springboot/JibxDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class JibxDataFormatAutoConfiguration {
     public JibxDataFormat configureJibxDataFormat(CamelContext camelContext,
             JibxDataFormatConfiguration configuration) throws Exception {
         JibxDataFormat dataformat = new JibxDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JibxDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatAutoConfiguration.java b/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatAutoConfiguration.java
index 9371bd3..43e9e9a 100644
--- a/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-johnzon-starter/src/main/java/org/apache/camel/component/johnzon/springboot/JohnzonDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class JohnzonDataFormatAutoConfiguration {
             CamelContext camelContext,
             JohnzonDataFormatConfiguration configuration) throws Exception {
         JohnzonDataFormat dataformat = new JohnzonDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JohnzonDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-josql-starter/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-josql-starter/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java b/components-starter/camel-josql-starter/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java
index 7e0d74c..0bc0a5d 100644
--- a/components-starter/camel-josql-starter/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java
+++ b/components-starter/camel-josql-starter/src/main/java/org/apache/camel/language/sql/springboot/SqlLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class SqlLanguageAutoConfiguration {
     public SqlLanguage configureSqlLanguage(CamelContext camelContext,
             SqlLanguageConfiguration configuration) throws Exception {
         SqlLanguage language = new SqlLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(SqlLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java b/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
index 56cbacb..86e337e 100644
--- a/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
+++ b/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
@@ -56,8 +56,12 @@ public class JsonPathLanguageAutoConfiguration {
             CamelContext camelContext,
             JsonPathLanguageConfiguration configuration) throws Exception {
         JsonPathLanguage language = new JsonPathLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JsonPathLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-juel-starter/src/main/java/org/apache/camel/language/juel/springboot/JuelLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-juel-starter/src/main/java/org/apache/camel/language/juel/springboot/JuelLanguageAutoConfiguration.java b/components-starter/camel-juel-starter/src/main/java/org/apache/camel/language/juel/springboot/JuelLanguageAutoConfiguration.java
index e9a55c4..b419281 100644
--- a/components-starter/camel-juel-starter/src/main/java/org/apache/camel/language/juel/springboot/JuelLanguageAutoConfiguration.java
+++ b/components-starter/camel-juel-starter/src/main/java/org/apache/camel/language/juel/springboot/JuelLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class JuelLanguageAutoConfiguration {
     public JuelLanguage configureJuelLanguage(CamelContext camelContext,
             JuelLanguageConfiguration configuration) throws Exception {
         JuelLanguage language = new JuelLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JuelLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-jxpath-starter/src/main/java/org/apache/camel/language/jxpath/springboot/JXPathLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-jxpath-starter/src/main/java/org/apache/camel/language/jxpath/springboot/JXPathLanguageAutoConfiguration.java b/components-starter/camel-jxpath-starter/src/main/java/org/apache/camel/language/jxpath/springboot/JXPathLanguageAutoConfiguration.java
index 2b805e7..928aba9 100644
--- a/components-starter/camel-jxpath-starter/src/main/java/org/apache/camel/language/jxpath/springboot/JXPathLanguageAutoConfiguration.java
+++ b/components-starter/camel-jxpath-starter/src/main/java/org/apache/camel/language/jxpath/springboot/JXPathLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class JXPathLanguageAutoConfiguration {
     public JXPathLanguage configureJXPathLanguage(CamelContext camelContext,
             JXPathLanguageConfiguration configuration) throws Exception {
         JXPathLanguage language = new JXPathLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(JXPathLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java b/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java
index 32cc691..213ebd1 100644
--- a/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java
+++ b/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class LZFDataFormatAutoConfiguration {
     public LZFDataFormat configureLZFDataFormat(CamelContext camelContext,
             LZFDataFormatConfiguration configuration) throws Exception {
         LZFDataFormat dataformat = new LZFDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(LZFDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java b/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java
index 6c9ef2e..a1e1197 100644
--- a/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java
+++ b/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java
@@ -57,8 +57,13 @@ public class MimeMultipartDataFormatAutoConfiguration {
             MimeMultipartDataFormatConfiguration configuration)
             throws Exception {
         MimeMultipartDataFormat dataformat = new MimeMultipartDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class
+                .isAssignableFrom(MimeMultipartDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/language/mvel/springboot/MvelLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/language/mvel/springboot/MvelLanguageAutoConfiguration.java b/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/language/mvel/springboot/MvelLanguageAutoConfiguration.java
index 039756f..e864e35 100644
--- a/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/language/mvel/springboot/MvelLanguageAutoConfiguration.java
+++ b/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/language/mvel/springboot/MvelLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class MvelLanguageAutoConfiguration {
     public MvelLanguage configureMvelLanguage(CamelContext camelContext,
             MvelLanguageConfiguration configuration) throws Exception {
         MvelLanguage language = new MvelLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(MvelLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-ognl-starter/src/main/java/org/apache/camel/language/ognl/springboot/OgnlLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-ognl-starter/src/main/java/org/apache/camel/language/ognl/springboot/OgnlLanguageAutoConfiguration.java b/components-starter/camel-ognl-starter/src/main/java/org/apache/camel/language/ognl/springboot/OgnlLanguageAutoConfiguration.java
index a43ea67..eb87fa8 100644
--- a/components-starter/camel-ognl-starter/src/main/java/org/apache/camel/language/ognl/springboot/OgnlLanguageAutoConfiguration.java
+++ b/components-starter/camel-ognl-starter/src/main/java/org/apache/camel/language/ognl/springboot/OgnlLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class OgnlLanguageAutoConfiguration {
     public OgnlLanguage configureOgnlLanguage(CamelContext camelContext,
             OgnlLanguageConfiguration configuration) throws Exception {
         OgnlLanguage language = new OgnlLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(OgnlLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java b/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java
index 3fd6a02..72f025e 100644
--- a/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java
+++ b/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java
@@ -56,8 +56,12 @@ public class ProtobufDataFormatAutoConfiguration {
             CamelContext camelContext,
             ProtobufDataFormatConfiguration configuration) throws Exception {
         ProtobufDataFormat dataformat = new ProtobufDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(ProtobufDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java b/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java
index 5744639..68b7ed8 100644
--- a/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java
+++ b/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java
@@ -55,8 +55,12 @@ public class RssDataFormatAutoConfiguration {
     public RssDataFormat configureRssDataFormat(CamelContext camelContext,
             RssDataFormatConfiguration configuration) throws Exception {
         RssDataFormat dataformat = new RssDataFormat();
-        if (dataformat instanceof CamelContextAware) {
-            ((CamelContextAware) dataformat).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(RssDataFormat.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(dataformat);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,

http://git-wip-us.apache.org/repos/asf/camel/blob/49f35d12/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java b/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java
index e4bd390..b53f4c8 100644
--- a/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java
+++ b/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java
@@ -55,8 +55,12 @@ public class XQueryLanguageAutoConfiguration {
     public XQueryLanguage configureXQueryLanguage(CamelContext camelContext,
             XQueryLanguageConfiguration configuration) throws Exception {
         XQueryLanguage language = new XQueryLanguage();
-        if (language instanceof CamelContextAware) {
-            ((CamelContextAware) language).setCamelContext(camelContext);
+        if (CamelContextAware.class.isAssignableFrom(XQueryLanguage.class)) {
+            CamelContextAware contextAware = CamelContextAware.class
+                    .cast(language);
+            if (contextAware != null) {
+                contextAware.setCamelContext(camelContext);
+            }
         }
         Map<String, Object> parameters = new HashMap<>();
         IntrospectionSupport.getProperties(configuration, parameters, null,


Mime
View raw message