camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] camel git commit: Add some error handler options to its mbean that we forgot to add
Date Wed, 11 Mar 2015 09:00:36 GMT
Repository: camel
Updated Branches:
  refs/heads/master 1faeeb2d4 -> 188769f8a


Add some error handler options to its mbean that we forgot to add


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

Branch: refs/heads/master
Commit: 1162e0591c5412cbf41a6ce36cc4907cba2f1cb2
Parents: 8c47e24
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Mar 11 09:31:25 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Mar 11 10:02:06 2015 +0100

----------------------------------------------------------------------
 .../mbean/ManagedErrorHandlerMBean.java         | 12 +++++++
 .../management/mbean/ManagedErrorHandler.java   | 36 +++++++++++++++++++-
 2 files changed, 47 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1162e059/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedErrorHandlerMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedErrorHandlerMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedErrorHandlerMBean.java
index 9ba5c74..0cb5a3b 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedErrorHandlerMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedErrorHandlerMBean.java
@@ -122,6 +122,12 @@ public interface ManagedErrorHandlerMBean {
     @ManagedAttribute(description = "RedeliveryPolicy for logging new exceptions")
     void setLogNewException(Boolean log);
 
+    @ManagedAttribute(description = "RedeliveryPolicy for logging exhausted with message
history")
+    Boolean getLogExhaustedMessageHistory();
+
+    @ManagedAttribute(description = "RedeliveryPolicy for logging exhausted with message
history")
+    void setLogExhaustedMessageHistory(Boolean log);
+
     @ManagedAttribute(description = "RedeliveryPolicy for logging handled and continued exceptions")
     Boolean getLogContinued();
 
@@ -146,4 +152,10 @@ public interface ManagedErrorHandlerMBean {
     @ManagedAttribute(description = "RedeliveryPolicy for using exponential backoff")
     void setUseExponentialBackOff(Boolean backoff);
 
+    @ManagedAttribute(description = "RedeliveryPolicy for allow redelivery while stopping")
+    Boolean getAllowRedeliveryWhileStopping();
+
+    @ManagedAttribute(description = "RedeliveryPolicy for allow redelivery while stopping")
+    void setAllowRedeliveryWhileStopping(Boolean allow);
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1162e059/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
index 3bf076b..e298ae8 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
@@ -21,7 +21,6 @@ import org.apache.camel.LoggingLevel;
 import org.apache.camel.Processor;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedErrorHandlerMBean;
-import org.apache.camel.builder.DefaultErrorHandlerBuilder;
 import org.apache.camel.processor.ErrorHandlerSupport;
 import org.apache.camel.processor.RedeliveryErrorHandler;
 import org.apache.camel.spi.ManagementStrategy;
@@ -350,6 +349,24 @@ public class ManagedErrorHandler implements ManagedErrorHandlerMBean
{
         redelivery.getRedeliveryPolicy().setLogNewException(log);
     }
 
+    public Boolean getLogExhaustedMessageHistory() {
+        if (!isSupportRedelivery()) {
+            throw new IllegalArgumentException("This error handler does not support redelivery");
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        return redelivery.getRedeliveryPolicy().isLogExhaustedMessageHistory();
+    }
+
+    public void setLogExhaustedMessageHistory(Boolean log) {
+        if (!isSupportRedelivery()) {
+            throw new IllegalArgumentException("This error handler does not support redelivery");
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        redelivery.getRedeliveryPolicy().setLogExhaustedMessageHistory(log);
+    }
+
     public Boolean getLogContinued() {
         if (!isSupportRedelivery()) {
             return null;
@@ -422,4 +439,21 @@ public class ManagedErrorHandler implements ManagedErrorHandlerMBean
{
         redelivery.getRedeliveryPolicy().setUseExponentialBackOff(backoff);
     }
 
+    public Boolean getAllowRedeliveryWhileStopping() {
+        if (!isSupportRedelivery()) {
+            return null;
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        return redelivery.getRedeliveryPolicy().isAllowRedeliveryWhileStopping();
+    }
+
+    public void setAllowRedeliveryWhileStopping(Boolean allow) {
+        if (!isSupportRedelivery()) {
+            throw new IllegalArgumentException("This error handler does not support redelivery");
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        redelivery.getRedeliveryPolicy().setAllowRedeliveryWhileStopping(allow);
+    }
 }


Mime
View raw message