camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [1/3] camel git commit: [CAMEL-11552] Provide FailureEvent interface as a general means of retrieving the cause
Date Tue, 18 Jul 2017 14:06:06 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x acee0a5ce -> 4c2840eaf


[CAMEL-11552] Provide FailureEvent interface as a general means of retrieving the cause


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

Branch: refs/heads/camel-2.18.x
Commit: 4c2840eafba73da7a8676ab47dc9929860c9a159
Parents: 9f2660e
Author: Christian Schneider <chris@die-schneider.net>
Authored: Tue Jul 18 14:28:48 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Tue Jul 18 16:05:36 2017 +0200

----------------------------------------------------------------------
 .../event/CamelContextResumeFailureEvent.java   |  3 ++-
 .../event/CamelContextStartupFailureEvent.java  |  3 ++-
 .../event/CamelContextStopFailureEvent.java     |  3 ++-
 .../management/event/ExchangeFailedEvent.java   |  8 +++++++-
 .../camel/management/event/FailureEvent.java    | 21 ++++++++++++++++++++
 .../event/ServiceStartupFailureEvent.java       |  3 ++-
 .../event/ServiceStopFailureEvent.java          |  3 ++-
 7 files changed, 38 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/CamelContextResumeFailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextResumeFailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextResumeFailureEvent.java
index 9f2d974..c2f4df2 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextResumeFailureEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextResumeFailureEvent.java
@@ -21,7 +21,7 @@ import org.apache.camel.CamelContext;
 /**
  * @version 
  */
-public class CamelContextResumeFailureEvent extends AbstractContextEvent {
+public class CamelContextResumeFailureEvent extends AbstractContextEvent implements FailureEvent
{
     private static final long serialVersionUID = -4271899927507894566L;
 
     private Throwable cause;
@@ -31,6 +31,7 @@ public class CamelContextResumeFailureEvent extends AbstractContextEvent
{
         this.cause = cause;
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStartupFailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStartupFailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStartupFailureEvent.java
index c890a59..11f31a2 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStartupFailureEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStartupFailureEvent.java
@@ -21,7 +21,7 @@ import org.apache.camel.CamelContext;
 /**
  * @version 
  */
-public class CamelContextStartupFailureEvent extends AbstractContextEvent {
+public class CamelContextStartupFailureEvent extends AbstractContextEvent implements FailureEvent
{
     private static final long serialVersionUID = -4271899927507894567L;
 
     private Throwable cause;
@@ -31,6 +31,7 @@ public class CamelContextStartupFailureEvent extends AbstractContextEvent
{
         this.cause = cause;
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStopFailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStopFailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStopFailureEvent.java
index 5ad915b..9dc4365 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStopFailureEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/CamelContextStopFailureEvent.java
@@ -21,7 +21,7 @@ import org.apache.camel.CamelContext;
 /**
  * @version 
  */
-public class CamelContextStopFailureEvent extends AbstractContextEvent {
+public class CamelContextStopFailureEvent extends AbstractContextEvent implements FailureEvent
{
     private static final long serialVersionUID = -802046840118188292L;
 
     private Throwable cause;
@@ -31,6 +31,7 @@ public class CamelContextStopFailureEvent extends AbstractContextEvent {
         this.cause = cause;
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
index 026fa6d..f6cf273 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
@@ -21,12 +21,17 @@ import org.apache.camel.Exchange;
 /**
  * @version 
  */
-public class ExchangeFailedEvent extends AbstractExchangeEvent {
+public class ExchangeFailedEvent extends AbstractExchangeEvent implements FailureEvent {
     private static final long serialVersionUID = -8484326904627268101L;
 
     public ExchangeFailedEvent(Exchange source) {
         super(source);
     }
+    
+    @Override
+    public Throwable getCause() {
+        return getExchange().getException();
+    }
 
     @Override
     public String toString() {
@@ -37,4 +42,5 @@ public class ExchangeFailedEvent extends AbstractExchangeEvent {
             return getExchange().getExchangeId() + " exchange failure: " + getExchange();
         }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/FailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/FailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/FailureEvent.java
new file mode 100644
index 0000000..28c9e5e
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/event/FailureEvent.java
@@ -0,0 +1,21 @@
+/**
+ * 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.management.event;
+
+public interface FailureEvent {
+    Throwable getCause();
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/ServiceStartupFailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/ServiceStartupFailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/ServiceStartupFailureEvent.java
index e9e1a91..3a47fc5 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/ServiceStartupFailureEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/ServiceStartupFailureEvent.java
@@ -23,7 +23,7 @@ import org.apache.camel.CamelContext;
 /**
  * @version 
  */
-public class ServiceStartupFailureEvent extends EventObject {
+public class ServiceStartupFailureEvent extends EventObject implements FailureEvent {
     private static final long serialVersionUID = -9171964933795931862L;
 
     private CamelContext context;
@@ -45,6 +45,7 @@ public class ServiceStartupFailureEvent extends EventObject {
         return service;
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/4c2840ea/camel-core/src/main/java/org/apache/camel/management/event/ServiceStopFailureEvent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/event/ServiceStopFailureEvent.java
b/camel-core/src/main/java/org/apache/camel/management/event/ServiceStopFailureEvent.java
index 27d32a8..b37d4ea 100644
--- a/camel-core/src/main/java/org/apache/camel/management/event/ServiceStopFailureEvent.java
+++ b/camel-core/src/main/java/org/apache/camel/management/event/ServiceStopFailureEvent.java
@@ -23,7 +23,7 @@ import org.apache.camel.CamelContext;
 /**
  * @version 
  */
-public class ServiceStopFailureEvent extends EventObject {
+public class ServiceStopFailureEvent extends EventObject implements FailureEvent {
     private static final long serialVersionUID = 4139591666998762617L;
 
     private CamelContext context;
@@ -45,6 +45,7 @@ public class ServiceStopFailureEvent extends EventObject {
         return service;
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }


Mime
View raw message