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

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

commit 793a04b477bbffc9eda7a09e3cd216df818626d2
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sat Jul 20 14:18:16 2019 +0200

    CAMEL-13755: camel3 - Remove fault from camel-core/message and let it be 
component specific for camel-cxf and camel-spring-ws as its only used by SOAP-WS
---
 .../camel/blueprint/CamelContextFactoryBean.java   | 10 ---
 .../camel/cdi/xml/CamelContextFactoryBean.java     | 11 ---
 .../spring/boot/CamelConfigurationProperties.java  |  7 --
 .../camel/spring/CamelContextFactoryBean.java      | 13 ----
 .../camel/spring/CamelContextFactoryBeanTest.java  |  2 -
 .../camel/impl/engine/DefaultRouteContext.java     |  1 -
 .../interceptor/HandleFaultInterceptor.java        | 81 ----------------------
 .../camel/main/DefaultConfigurationProperties.java | 24 -------
 .../camel-main-configuration-metadata.json         |  6 --
 .../apt/CoreEipAnnotationProcessorHelper.java      |  5 --
 .../apache/camel/main/parser/MyConfiguration.java  | 14 ----
 11 files changed, 174 deletions(-)

diff --git 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
index c4afd2f..5c80272 100644
--- 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
+++ 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
@@ -102,8 +102,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Blu
     @XmlAttribute
     private String delayer;
     @XmlAttribute
-    private String handleFault;
-    @XmlAttribute
     private String errorHandlerRef;
     @XmlAttribute
     private String autoStartup = "true";
@@ -589,14 +587,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Blu
         this.delayer = delayer;
     }
 
-    public String getHandleFault() {
-        return handleFault;
-    }
-
-    public void setHandleFault(String handleFault) {
-        this.handleFault = handleFault;
-    }
-
     public String getErrorHandlerRef() {
         return errorHandlerRef;
     }
diff --git 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
index af306a9..1267ce8 100644
--- 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
+++ 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/xml/CamelContextFactoryBean.java
@@ -92,9 +92,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Def
     private String delayer;
 
     @XmlAttribute
-    private String handleFault;
-
-    @XmlAttribute
     private String errorHandlerRef;
 
     @XmlAttribute
@@ -569,14 +566,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Def
         this.delayer = delayer;
     }
 
-    public String getHandleFault() {
-        return handleFault;
-    }
-
-    public void setHandleFault(String handleFault) {
-        this.handleFault = handleFault;
-    }
-
     public String getAutoStartup() {
         return autoStartup;
     }
diff --git 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index 5bb814c..54d3296 100644
--- 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -332,13 +332,6 @@ public class CamelConfigurationProperties extends 
DefaultConfigurationProperties
     private boolean logExhaustedMessageBody;
 
     /**
-     * Sets whether fault handling is enabled or not.
-     *
-     * Default is false.
-     */
-    private boolean handleFault;
-
-    /**
      * Sets whether the object should automatically start when Camel starts.
      * Important: Currently only routes can be disabled, as CamelContext's are 
always started.
      * Note: When setting auto startup false on CamelContext then that takes 
precedence
diff --git 
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
 
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
index 856f240..57e852c 100644
--- 
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
+++ 
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
@@ -115,8 +115,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Spr
     @XmlAttribute
     private String delayer;
     @XmlAttribute
-    private String handleFault;
-    @XmlAttribute
     private String errorHandlerRef;
     @XmlAttribute @Metadata(defaultValue = "true")
     private String autoStartup;
@@ -717,17 +715,6 @@ public class CamelContextFactoryBean extends 
AbstractCamelContextFactoryBean<Spr
         this.delayer = delayer;
     }
 
-    public String getHandleFault() {
-        return handleFault;
-    }
-
-    /**
-     * Sets whether fault handling is enabled or not (default is disabled).
-     */
-    public void setHandleFault(String handleFault) {
-        this.handleFault = handleFault;
-    }
-
     public String getAutoStartup() {
         return autoStartup;
     }
diff --git 
a/components/camel-spring/src/test/java/org/apache/camel/spring/CamelContextFactoryBeanTest.java
 
b/components/camel-spring/src/test/java/org/apache/camel/spring/CamelContextFactoryBeanTest.java
index a6b638d..4a9b0ac 100644
--- 
a/components/camel-spring/src/test/java/org/apache/camel/spring/CamelContextFactoryBeanTest.java
+++ 
b/components/camel-spring/src/test/java/org/apache/camel/spring/CamelContextFactoryBeanTest.java
@@ -38,8 +38,6 @@ public class CamelContextFactoryBeanTest extends Assert {
 
     @Before
     public void setUp() throws Exception {
-
-        
         factory = new CamelContextFactoryBean();
         factory.setId("camelContext");
     }
diff --git 
a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultRouteContext.java
 
b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultRouteContext.java
index b055e28..b776954 100644
--- 
a/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultRouteContext.java
+++ 
b/core/camel-base/src/main/java/org/apache/camel/impl/engine/DefaultRouteContext.java
@@ -64,7 +64,6 @@ public class DefaultRouteContext implements RouteContext {
     private Boolean logMask;
     private Boolean logExhaustedMessageBody;
     private Boolean streamCache;
-    private Boolean handleFault;
     private Long delay;
     private Boolean autoStartup = Boolean.TRUE;
     private List<RoutePolicy> routePolicyList = new ArrayList<>();
diff --git 
a/core/camel-base/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
 
b/core/camel-base/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
deleted file mode 100644
index 11bef3e..0000000
--- 
a/core/camel-base/src/main/java/org/apache/camel/processor/interceptor/HandleFaultInterceptor.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.processor.interceptor;
-
-import org.apache.camel.AsyncCallback;
-import org.apache.camel.CamelException;
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.Processor;
-import org.apache.camel.support.processor.DelegateAsyncProcessor;
-
-public class HandleFaultInterceptor extends DelegateAsyncProcessor {
-
-    public HandleFaultInterceptor() {
-    }
-
-    public HandleFaultInterceptor(Processor processor) {
-        super(processor);
-    }
-
-    @Override
-    public String toString() {
-        return "HandleFaultInterceptor[" + processor + "]";
-    }
-
-    @Override
-    public boolean process(final Exchange exchange, final AsyncCallback 
callback) {
-        return processor.process(exchange, new AsyncCallback() {
-            public void done(boolean doneSync) {
-                try {
-                    // handle fault after we are done
-                    handleFault(exchange);
-                } finally {
-                    // and let the original callback know we are done as well
-                    callback.done(doneSync);
-                }
-            }
-        });
-    }
-
-    /**
-     * Handles the fault message by converting it to an Exception
-     */
-    protected void handleFault(Exchange exchange) {
-        // Take the fault message out before we keep on going
-        Message msg = exchange.hasOut() ? exchange.getOut() : exchange.getIn();
-        if (msg.isFault()) {
-            final Object faultBody = msg.getBody();
-            if (faultBody != null && exchange.getException() == null) {
-                // remove fault as we are converting it to an exception
-                if (exchange.hasOut()) {
-                    exchange.setOut(null);
-                } else {
-                    exchange.setIn(null);
-                }
-                if (faultBody instanceof Throwable) {
-                    exchange.setException((Throwable) faultBody);
-                } else {
-                    // wrap it in an exception
-                    String data = 
exchange.getContext().getTypeConverter().convertTo(String.class, exchange, 
faultBody);
-                    exchange.setException(new CamelException(data));
-                }
-            }
-        }
-    }
-
-}
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index 0c8b011..855a239 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -53,7 +53,6 @@ public abstract class DefaultConfigurationProperties<T> {
     private boolean messageHistory = true;
     private boolean logMask;
     private boolean logExhaustedMessageBody;
-    private boolean handleFault;
     private boolean autoStartup = true;
     private boolean allowUseOriginalMessage;
     private boolean endpointRuntimeStatisticsEnabled;
@@ -438,19 +437,6 @@ public abstract class DefaultConfigurationProperties<T> {
         this.logExhaustedMessageBody = logExhaustedMessageBody;
     }
 
-    public boolean isHandleFault() {
-        return handleFault;
-    }
-
-    /**
-     * Sets whether fault handling is enabled or not.
-     *
-     * Default is false.
-     */
-    public void setHandleFault(boolean handleFault) {
-        this.handleFault = handleFault;
-    }
-
     public boolean isAutoStartup() {
         return autoStartup;
     }
@@ -924,16 +910,6 @@ public abstract class DefaultConfigurationProperties<T> {
     }
 
     /**
-     * Sets whether fault handling is enabled or not.
-     *
-     * Default is false.
-     */
-    public T withHandleFault(boolean handleFault) {
-        this.handleFault = handleFault;
-        return (T) this;
-    }
-
-    /**
      * Sets whether the object should automatically start when Camel starts.
      * Important: Currently only routes can be disabled, as CamelContext's are 
always started.
      * Note: When setting auto startup false on CamelContext then that takes 
precedence
diff --git 
a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
index 2c18c42..4052ee6 100644
--- 
a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
@@ -122,12 +122,6 @@
                        "description":"Directory to load additional 
configuration files that contains configuration values that takes precedence 
over any other configuration. This can be used to refer to files that may have 
secret configuration that has been mounted on the file system for containers. 
You can specify a pattern to load from sub directories and a name pattern such 
as \/var\/app\/secret\/.properties, multiple directories can be separated by 
comma."
                },
                {
-                       "name":"camel.main.handle-fault",
-                       "type":"boolean",
-                       
"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
-                       "description":"Sets whether fault handling is enabled 
or not. Default is false."
-               },
-               {
                        "name":"camel.main.hangup-interceptor-enabled",
                        "type":"boolean",
                        
"sourceType":"org.apache.camel.main.MainConfigurationProperties",
diff --git 
a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
 
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
index 396dda5..df08f15 100644
--- 
a/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
+++ 
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessorHelper.java
@@ -618,11 +618,6 @@ public class CoreEipAnnotationProcessorHelper {
         ep = new EipOption("logMask", "Log Mask", "attribute", 
"java.lang.String", false, "false", docComment, false, null, false, null, 
false, null, false);
         eipOptions.add(ep);
 
-        // trace
-        docComment = findJavaDoc(elementUtils, null, "handleFault", null, 
classElement, true);
-        ep = new EipOption("handleFault", "Handle Fault", "attribute", 
"java.lang.String", false, "", docComment, false, null, false, null, false, 
null, false);
-        eipOptions.add(ep);
-
         // delayer
         docComment = findJavaDoc(elementUtils, null, "delayer", null, 
classElement, true);
         ep = new EipOption("delayer", "Delayer", "attribute", 
"java.lang.String", false, "", docComment, false, null, false, null, false, 
null, false);
diff --git 
a/tooling/maven/camel-main-parser/src/test/java/org/apache/camel/main/parser/MyConfiguration.java
 
b/tooling/maven/camel-main-parser/src/test/java/org/apache/camel/main/parser/MyConfiguration.java
index 4a6c260..489e06d 100644
--- 
a/tooling/maven/camel-main-parser/src/test/java/org/apache/camel/main/parser/MyConfiguration.java
+++ 
b/tooling/maven/camel-main-parser/src/test/java/org/apache/camel/main/parser/MyConfiguration.java
@@ -50,7 +50,6 @@ public class MyConfiguration {
     private boolean messageHistory = true;
     private boolean logMask;
     private boolean logExhaustedMessageBody;
-    private boolean handleFault;
     private boolean autoStartup = true;
     private boolean allowUseOriginalMessage;
     private boolean endpointRuntimeStatisticsEnabled;
@@ -435,19 +434,6 @@ public class MyConfiguration {
         this.logExhaustedMessageBody = logExhaustedMessageBody;
     }
 
-    public boolean isHandleFault() {
-        return handleFault;
-    }
-
-    /**
-     * Sets whether fault handling is enabled or not.
-     *
-     * Default is false.
-     */
-    public void setHandleFault(boolean handleFault) {
-        this.handleFault = handleFault;
-    }
-
     public boolean isAutoStartup() {
         return autoStartup;
     }

Reply via email to