camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r905292 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
Date Mon, 01 Feb 2010 14:47:17 GMT
Author: davsclaus
Date: Mon Feb  1 14:47:17 2010
New Revision: 905292

URL: http://svn.apache.org/viewvc?rev=905292&view=rev
Log:
CAMEL-2435: maanged error handler as well.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java?rev=905292&r1=905291&r2=905292&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedErrorHandler.java
Mon Feb  1 14:47:17 2010
@@ -308,6 +308,26 @@
         redelivery.getRedeliveryPolicy().setLogStackTrace(log);
     }
 
+    @ManagedAttribute(description = "RedeliveryPolicy for logging redelivery stack traces")
+    public Boolean getLogRetryStackTrace() {
+        if (!isSupportRedelivery()) {
+            return null;
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        return redelivery.getRedeliveryPolicy().isLogRetryStackTrace();
+    }
+
+    @ManagedAttribute(description = "RedeliveryPolicy for logging redelivery stack traces")
+    public void setLogRetryStackTrace(Boolean log) {
+        if (!isSupportRedelivery()) {
+            throw new IllegalArgumentException("This error handler does not support redelivery");
+        }
+
+        RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
+        redelivery.getRedeliveryPolicy().setLogRetryStackTrace(log);
+    }
+
     @ManagedAttribute(description = "RedeliveryPolicy for using collision avoidance")
     public Boolean getUseCollisionAvoidance() {
         if (!isSupportRedelivery()) {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java?rev=905292&r1=905291&r2=905292&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
Mon Feb  1 14:47:17 2010
@@ -98,7 +98,10 @@
         assertEquals(LoggingLevel.DEBUG.name(), rll);
 
         Boolean lst = (Boolean) mbeanServer.getAttribute(on, "LogStackTrace");
-        assertEquals(false, lst.booleanValue());
+        assertEquals(true, lst.booleanValue());
+
+        Boolean lrst = (Boolean) mbeanServer.getAttribute(on, "LogRetryStackTrace");
+        assertEquals(false, lrst.booleanValue());
 
         Boolean uca = (Boolean) mbeanServer.getAttribute(on, "UseCollisionAvoidance");
         assertEquals(false, uca.booleanValue());



Mime
View raw message