camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1239511 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/api/management/mbean/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/cam...
Date Thu, 02 Feb 2012 09:54:50 GMT
Author: davsclaus
Date: Thu Feb  2 09:54:49 2012
New Revision: 1239511

URL: http://svn.apache.org/viewvc?rev=1239511&view=rev
Log:
CAMEL-4968: Renamed transacted redeliveries to external redeliveries

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Exchange.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java
    camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionIsTransactedRedeliveredTest.java
    camel/branches/camel-2.9.x/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
    camel/branches/camel-2.9.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java
    camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb  2 09:54:49 2012
@@ -1 +1 @@
-/camel/trunk:1235643,1236639,1236667,1237666,1237807,1238225,1238229,1238387,1238463,1238477,1238503,1238937,1238988,1239006,1239045,1239080-1239081,1239470,1239479
+/camel/trunk:1235643,1236639,1236667,1237666,1237807,1238225,1238229,1238387,1238463,1238477,1238503,1238937,1238988,1239006,1239045,1239080-1239081,1239470,1239479,1239497

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Exchange.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Exchange.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Exchange.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Exchange.java Thu
Feb  2 09:54:49 2012
@@ -107,6 +107,7 @@ public interface Exchange {
     String EXCEPTION_CAUGHT           = "CamelExceptionCaught";
     String EVALUATE_EXPRESSION_RESULT = "CamelEvaluateExpressionResult";
     String ERRORHANDLER_HANDLED       = "CamelErrorHandlerHandled";
+    String EXTERNAL_REDELIVERED       = "CamelExternalRedelivered";
 
     String FAILURE_HANDLED      = "CamelFailureHandled";
     String FAILURE_ENDPOINT     = "CamelFailureEndpoint";
@@ -171,18 +172,17 @@ public interface Exchange {
     String SPLIT_COMPLETE     = "CamelSplitComplete";
     String SPLIT_SIZE         = "CamelSplitSize";
 
-    String TIMER_COUNTER          = "CamelTimerCounter";
-    String TIMER_FIRED_TIME       = "CamelTimerFiredTime";
-    String TIMER_NAME             = "CamelTimerName";
-    String TIMER_PERIOD           = "CamelTimerPeriod";
-    String TIMER_TIME             = "CamelTimerTime";
-    String TO_ENDPOINT            = "CamelToEndpoint";
-    String TRACE_EVENT            = "CamelTraceEvent";
-    String TRACE_EVENT_NODE_ID    = "CamelTraceEventNodeId";
-    String TRACE_EVENT_TIMESTAMP  = "CamelTraceEventTimestamp";
-    String TRACE_EVENT_EXCHANGE   = "CamelTraceEventExchange";
-    String TRANSACTED_REDELIVERED = "CamelTransactedRedelivered";
-    String TRANSFER_ENCODING      = "Transfer-Encoding";
+    String TIMER_COUNTER         = "CamelTimerCounter";
+    String TIMER_FIRED_TIME      = "CamelTimerFiredTime";
+    String TIMER_NAME            = "CamelTimerName";
+    String TIMER_PERIOD          = "CamelTimerPeriod";
+    String TIMER_TIME            = "CamelTimerTime";
+    String TO_ENDPOINT           = "CamelToEndpoint";
+    String TRACE_EVENT           = "CamelTraceEvent";
+    String TRACE_EVENT_NODE_ID   = "CamelTraceEventNodeId";
+    String TRACE_EVENT_TIMESTAMP = "CamelTraceEventTimestamp";
+    String TRACE_EVENT_EXCHANGE  = "CamelTraceEventExchange";
+    String TRANSFER_ENCODING     = "Transfer-Encoding";
 
     String UNIT_OF_WORK_EXHAUSTED    = "CamelUnitOfWorkExhausted";
     String UNIT_OF_WORK_PROCESS_SYNC = "CamelUnitOfWorkProcessSync";
@@ -398,15 +398,15 @@ public interface Exchange {
     boolean isTransacted();
 
     /**
-     * Returns true if this exchange is redelivered from a transacted source (such as a JMS
broker)
+     * Returns true if this exchange is an external initiated redelivered message (such as
a JMS broker).
      * <p/>
-     * <b>Important: </b> It is not always possible to determine if the transacted
is a redelivery
+     * <b>Important: </b> It is not always possible to determine if the message
is a redelivery
      * or not, and therefore <tt>null</tt> is returned. Such an example would
be a JDBC message.
-     * However JMS brokers provides details if a transacted message is redelivered.
+     * However JMS brokers provides details if a message is redelivered.
      *
      * @return <tt>true</tt> if redelivered, <tt>false</tt> if not,
<tt>null</tt> if not able to determine
      */
-    Boolean isTransactedRedelivered();
+    Boolean isExternalRedelivered();
 
     /**
      * Returns true if this exchange is marked for rollback

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.java
Thu Feb  2 09:54:49 2012
@@ -35,11 +35,11 @@ public interface ManagedPerformanceCount
     @ManagedAttribute(description = "Number of failures handled")
     long getFailuresHandled() throws Exception;
 
-    @ManagedAttribute(description = "Number of redeliveries (Camel error handler)")
+    @ManagedAttribute(description = "Number of redeliveries (internal only)")
     long getRedeliveries() throws Exception;
 
-    @ManagedAttribute(description = "Number of transacted redeliveries (from external transacted
source)")
-    long getTransactedRedeliveries() throws Exception;
+    @ManagedAttribute(description = "Number of external initiated redeliveries (such as from
JMS broker)")
+    long getExternalRedeliveries() throws Exception;
 
     @ManagedAttribute(description = "Min Processing Time [milliseconds]")
     long getMinProcessingTime() throws Exception;

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
Thu Feb  2 09:54:49 2012
@@ -331,27 +331,27 @@ public final class DefaultExchange imple
         }
     }
 
-    public Boolean isTransactedRedelivered() {
+    public Boolean isExternalRedelivered() {
         Boolean answer = null;
 
         // check property first, as the implementation details to know if the message
-        // was transacted redelivered is message specific, and thus the message implementation
+        // was externally redelivered is message specific, and thus the message implementation
         // could potentially change during routing, and therefore later we may not know if
the
-        // original message was transacted redelivered or not, therefore we store this detail
+        // original message was externally redelivered or not, therefore we store this detail
         // as a exchange property to keep it around for the lifecycle of the exchange
         if (hasProperties()) {
-            answer = getProperty(Exchange.TRANSACTED_REDELIVERED, null, Boolean.class); 
+            answer = getProperty(Exchange.EXTERNAL_REDELIVERED, null, Boolean.class);
         }
         
         if (answer == null) {
             // lets avoid adding methods to the Message API, so we use the
             // DefaultMessage to allow component specific messages to extend
-            // and implement the isTransactedRedelivered method.
+            // and implement the isExternalRedelivered method.
             DefaultMessage msg = getIn(DefaultMessage.class);
             if (msg != null) {
                 answer = msg.isTransactedRedelivered();
                 // store as property to keep around
-                setProperty(Exchange.TRANSACTED_REDELIVERED, answer);
+                setProperty(Exchange.EXTERNAL_REDELIVERED, answer);
             }
         }
 

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
Thu Feb  2 09:54:49 2012
@@ -109,10 +109,10 @@ public class DefaultUnitOfWork implement
             }
         }
         
-        // setup whether the exchange is transacted redelivered or not (if not initialized
before)
-        // store as property so we know that the origin exchange was transacted redelivered
-        if (exchange.getProperty(Exchange.TRANSACTED_REDELIVERED) == null) {
-            exchange.setProperty(Exchange.TRANSACTED_REDELIVERED, exchange.isTransactedRedelivered());
+        // setup whether the exchange is externally redelivered or not (if not initialized
before)
+        // store as property so we know that the origin exchange was redelivered
+        if (exchange.getProperty(Exchange.EXTERNAL_REDELIVERED) == null) {
+            exchange.setProperty(Exchange.EXTERNAL_REDELIVERED, exchange.isExternalRedelivered());
         }
 
         // fire event

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java
Thu Feb  2 09:54:49 2012
@@ -31,7 +31,7 @@ public abstract class ManagedPerformance
     private Statistic exchangesFailed;
     private Statistic failuresHandled;
     private Statistic redeliveries;
-    private Statistic transactedRedeliveries;
+    private Statistic externalRedeliveries;
     private Statistic minProcessingTime;
     private Statistic maxProcessingTime;
     private Statistic totalProcessingTime;
@@ -54,7 +54,7 @@ public abstract class ManagedPerformance
 
         this.failuresHandled = new Statistic("org.apache.camel.failuresHandled", this, Statistic.UpdateMode.COUNTER);
         this.redeliveries = new Statistic("org.apache.camel.redeliveries", this, Statistic.UpdateMode.COUNTER);
-        this.transactedRedeliveries = new Statistic("org.apache.camel.transactedRedeliveries",
this, Statistic.UpdateMode.COUNTER);
+        this.externalRedeliveries = new Statistic("org.apache.camel.externalRedeliveries",
this, Statistic.UpdateMode.COUNTER);
 
         this.minProcessingTime = new Statistic("org.apache.camel.minimumProcessingTime",
this, Statistic.UpdateMode.MINIMUM);
         this.maxProcessingTime = new Statistic("org.apache.camel.maximumProcessingTime",
this, Statistic.UpdateMode.MAXIMUM);
@@ -75,7 +75,7 @@ public abstract class ManagedPerformance
         exchangesFailed.reset();
         failuresHandled.reset();
         redeliveries.reset();
-        transactedRedeliveries.reset();
+        externalRedeliveries.reset();
         minProcessingTime.reset();
         maxProcessingTime.reset();
         totalProcessingTime.reset();
@@ -107,8 +107,8 @@ public abstract class ManagedPerformance
         return redeliveries.getValue();
     }
 
-    public long getTransactedRedeliveries() throws Exception {
-        return transactedRedeliveries.getValue();
+    public long getExternalRedeliveries() throws Exception {
+        return externalRedeliveries.getValue();
     }
 
     public long getMinProcessingTime() throws Exception {
@@ -182,9 +182,9 @@ public abstract class ManagedPerformance
         if (ExchangeHelper.isFailureHandled(exchange)) {
             failuresHandled.increment();
         }
-        Boolean transactedRedelivered = exchange.isTransactedRedelivered();
-        if (transactedRedelivered != null && transactedRedelivered) {
-            transactedRedeliveries.increment();
+        Boolean externalRedelivered = exchange.isExternalRedelivered();
+        if (externalRedelivered != null && externalRedelivered) {
+            externalRedeliveries.increment();
         }
 
         minProcessingTime.updateValue(time);
@@ -216,9 +216,9 @@ public abstract class ManagedPerformance
         if (ExchangeHelper.isRedelivered(exchange)) {
             redeliveries.increment();
         }
-        Boolean transactedRedelivered = exchange.isTransactedRedelivered();
-        if (transactedRedelivered != null && transactedRedelivered) {
-            transactedRedeliveries.increment();
+        Boolean externalRedelivered = exchange.isExternalRedelivered();
+        if (externalRedelivered != null && externalRedelivered) {
+            externalRedeliveries.increment();
         }
 
         long now = new Date().getTime();

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionIsTransactedRedeliveredTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionIsTransactedRedeliveredTest.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionIsTransactedRedeliveredTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMSTransactionIsTransactedRedeliveredTest.java
Thu Feb  2 09:54:49 2012
@@ -95,9 +95,9 @@ public class JMSTransactionIsTransactedR
         assertEquals(0, redeliveries.intValue());
         // Camel error handler redeliveries (we do not use that in this example)
 
-        // there should be 2 transacted redeliveries
-        Long transactedRedeliveries = (Long) getMBeanServer().getAttribute(name, "TransactedRedeliveries");
-        assertEquals(2, transactedRedeliveries.intValue());
+        // there should be 2 external redeliveries
+        Long externalRedeliveries = (Long) getMBeanServer().getAttribute(name, "ExternalRedeliveries");
+        assertEquals(2, externalRedeliveries.intValue());
     }
 
     public static class MyProcessor implements Processor {
@@ -108,9 +108,9 @@ public class JMSTransactionIsTransactedR
 
             // the first is not redelivered
             if (count == 1) {
-                assertFalse("Should not be transacted redelivered", exchange.isTransactedRedelivered());
+                assertFalse("Should not be external redelivered", exchange.isExternalRedelivered());
             } else {
-                assertTrue("Should be transacted redelivered", exchange.isTransactedRedelivered());
+                assertTrue("Should be external redelivered", exchange.isExternalRedelivered());
             }
 
             if (count < 3) {

Modified: camel/branches/camel-2.9.x/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
(original)
+++ camel/branches/camel-2.9.x/components/camel-scala/src/main/scala/org/apache/camel/scala/RichExchange.scala
Thu Feb  2 09:54:49 2012
@@ -66,7 +66,7 @@ class RichExchange(val exchange : Exchan
 
   def isTransacted = exchange.isTransacted
 
-  def isTransactedRedelivered = exchange.isTransactedRedelivered;
+  def isExternalRedelivered = exchange.isExternalRedelivered;
 
   def isRollbackOnly = exchange.isRollbackOnly
 

Modified: camel/branches/camel-2.9.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java
Thu Feb  2 09:54:49 2012
@@ -118,8 +118,8 @@ public class TransactionErrorHandler ext
 
     protected void processInTransaction(final Exchange exchange) throws Exception {
         // is the exchange redelivered, for example JMS brokers support such details
-        Boolean txRedelivered = exchange.isTransactedRedelivered();
-        final String redelivered = txRedelivered != null ? txRedelivered.toString() : "unknown";
+        Boolean externalRedelivered = exchange.isExternalRedelivered();
+        final String redelivered = externalRedelivered != null ? externalRedelivered.toString()
: "unknown";
         final String ids = ExchangeHelper.logIds(exchange);
 
         try {

Modified: camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.java?rev=1239511&r1=1239510&r2=1239511&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.java
(original)
+++ camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JMSTransactionIsTransactedRedeliveredTest.java
Thu Feb  2 09:54:49 2012
@@ -26,7 +26,7 @@ import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
- * Test that exchange.isTransactedRedelivered() is kept around even when
+ * Test that exchange.isExternalRedelivered() is kept around even when
  * Message implementation changes from JmsMessage to DefaultMessage, when routing
  * from JMS over Jetty.
  */
@@ -93,9 +93,9 @@ public class JMSTransactionIsTransactedR
 
             // the first is not redelivered
             if (count == 1) {
-                assertFalse("Should not be transacted redelivered", exchange.isTransactedRedelivered());
+                assertFalse("Should not be external redelivered", exchange.isExternalRedelivered());
             } else {
-                assertTrue("Should be transacted redelivered", exchange.isTransactedRedelivered());
+                assertTrue("Should be external redelivered", exchange.isExternalRedelivered());
             }
 
             if (count < 3) {
@@ -107,8 +107,8 @@ public class JMSTransactionIsTransactedR
 
     public static class MyAfterProcessor implements Processor {
         public void process(Exchange exchange) throws Exception {
-            // origin message should be a transacted redeliveries
-            assertTrue("Should be transacted redelivered", exchange.isTransactedRedelivered());
+            // origin message should be a external redelivered
+            assertTrue("Should be external redelivered", exchange.isExternalRedelivered());
         }
     }
 



Mime
View raw message