camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r764694 - in /camel/trunk/components: camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java
Date Tue, 14 Apr 2009 07:32:21 GMT
Author: davsclaus
Date: Tue Apr 14 07:32:20 2009
New Revision: 764694

URL: http://svn.apache.org/viewvc?rev=764694&view=rev
Log:
CAMEL-1475: snippet tags for wiki documentation.

Modified:
    camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java

Modified: camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml?rev=764694&r1=764693&r2=764694&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
(original)
+++ camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
Tue Apr 14 07:32:20 2009
@@ -22,21 +22,7 @@
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
 
-    <camelContext xmlns="http://camel.apache.org/schema/spring">
-        <route>
-            <!-- 1: from the jms queue -->
-            <from uri="activemq:queue:okay"/>
-            <!-- 2: mark this route as transacted -->
-            <transacted/>
-            <!-- 3: call our business logic that is myProcessor -->
-            <process ref="myProcessor"/>
-            <!-- 4: if success then send it to the mock -->
-            <to uri="mock:result"/>
-        </route>
-    </camelContext>
-
-    <bean id="myProcessor" class="org.apache.camel.component.jms.tx.JMSTransactionalClientTest$MyProcessor"/>
-
+    <!-- START SNIPPET: e1 -->
     <!-- setup JMS connection factory -->
     <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
         <property name="brokerURL" value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
@@ -52,6 +38,29 @@
         <property name="connectionFactory" ref="jmsConnectionFactory"/>
         <!-- define the jms consumer/producer as transacted -->
         <property name="transacted" value="true"/>
+        <!-- setup the transaction manager to use -->
+        <!-- if not provided then Camel will automatic use a JmsTransactionManager, however
if you
+             for instance use a JTA transaction manager then you must configure it -->
+        <property name="transactionManager" ref="jmsTransactionManager"/>
     </bean>
+    <!-- END SNIPPET: e1 -->
+
+    <!-- START SNIPPET: e2 -->
+    <camelContext xmlns="http://camel.apache.org/schema/spring">
+        <route>
+            <!-- 1: from the jms queue -->
+            <from uri="activemq:queue:okay"/>
+            <!-- 2: mark this route as transacted -->
+            <transacted/>
+            <!-- 3: call our business logic that is myProcessor -->
+            <process ref="myProcessor"/>
+            <!-- 4: if success then send it to the mock -->
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+
+    <bean id="myProcessor" class="org.apache.camel.component.jms.tx.JMSTransactionalClientTest$MyProcessor"/>
+    <!-- END SNIPPET: e2 -->
+
 
 </beans>

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java?rev=764694&r1=764693&r2=764694&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactionalClientDataSourceTest.java
Tue Apr 14 07:32:20 2009
@@ -96,9 +96,8 @@
         return new SpringRouteBuilder() {
             public void configure() throws Exception {
                 // START SNIPPET: e1
-                // setup the transaction policy
-                SpringTransactionPolicy required = context.getRegistry()
-                    .lookup("PROPAGATION_REQUIRED", SpringTransactionPolicy.class);
+                // lookup the transaction policy
+                SpringTransactionPolicy required = bean(SpringTransactionPolicy.class, "PROPAGATION_REQUIRED");
 
                 // use this error handler instead of DeadLetterChannel that is the default
                 // Notice: transactionErrorHandler is in SpringRouteBuilder



Mime
View raw message