From commitsbeth09@example.net Thu Jul 01 04:28:04 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 2200 invoked from network); 1 Jul 2010 04:28:04 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 04:28:04 -0000 Received: (qmail 18767 invoked by uid 500); 1 Jul 2010 04:28:04 -0000 Delivered-To: beth09@example.net Received: (qmail 18720 invoked by uid 500); 1 Jul 2010 04:28:02 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 18711 invoked by uid 99); 1 Jul 2010 04:28:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 04:28:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 04:27:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8677823889D2; Thu, 1 Jul 2010 04:26:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959498 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/direct/DirectConsumer.java test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java Date: Thu, 01 Jul 2010 04:26:35 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 04:26:35 2010 New Revision: 959498 URL: http://svn.apache.org/viewvc?rev=959498&view=rev Log: Fixed tests with direct endpoint detecting its the same consumer being started. Added: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java (with props) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java?rev=959498&r1=959497&r2=959498&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/direct/DirectConsumer.java Thu Jul 1 04:26:35 2010 @@ -38,10 +38,13 @@ public class DirectConsumer extends Defa public void start() throws Exception { // add consumer to endpoint - if (endpoint.hasConsumer(this)) { + boolean existing = this == endpoint.getConsumer(); + if (!existing && endpoint.hasConsumer(this)) { throw new IllegalArgumentException("Cannot add a 2nd consumer to the same endpoint. Endpoint " + endpoint + " only allows one consumer."); } - endpoint.addConsumer(this); + if (!existing) { + endpoint.addConsumer(this); + } super.start(); } Added: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java?rev=959498&view=auto ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java (added) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java Thu Jul 1 04:26:35 2010 @@ -0,0 +1,59 @@ +/** + * 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.component.direct; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; + +/** + * @version $Revision$ + */ +public class DirectEndpointRouteInlinedTest extends ContextTestSupport { + + public void testDirect() throws Exception { + context.addRoutes(new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:start").to("mock:result"); + } + }); + context.start(); + + getMockEndpoint("mock:result").expectedMessageCount(1); + + template.sendBody("direct:start", "Hello World"); + + assertMockEndpointsSatisfied(); + } + + public void testDirectExistingExists() throws Exception { + try { + context.addRoutes(new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:start").to("mock:result"); + + from("direct:start").to("mock:bar"); + } + }); + fail("Should have thrown exception"); + } catch (IllegalArgumentException e) { + assertEquals("Cannot add a 2nd consumer to the same endpoint. Endpoint Endpoint[direct://start] only allows one consumer.", e.getMessage()); + } + } + +} Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/component/direct/DirectEndpointRouteInlinedTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date From commitsbeth09@example.net Thu Jul 01 05:57:27 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 26089 invoked from network); 1 Jul 2010 05:57:26 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 05:57:26 -0000 Received: (qmail 77738 invoked by uid 500); 1 Jul 2010 05:57:26 -0000 Delivered-To: beth09@example.net Received: (qmail 77683 invoked by uid 500); 1 Jul 2010 05:57:25 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 77676 invoked by uid 99); 1 Jul 2010 05:57:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 05:57:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 05:57:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ABD9A23889B1; Thu, 1 Jul 2010 05:56:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959519 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/spi/ components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/ compo... Date: Thu, 01 Jul 2010 05:56:25 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 05:56:24 2010 New Revision: 959519 URL: http://svn.apache.org/viewvc?rev=959519&view=rev Log: CAMEL-2877: transacted works with async routing engine. Added: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java (with props) camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRecipientListTest.java - copied, changed from r959503, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java (with props) camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java (with props) camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXWireTapTest.java - copied, changed from r959503, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java camel/trunk/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTX2Test.java camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollback2Test.java camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollbackTest.java camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java Thu Jul 1 05:56:24 2010 @@ -115,7 +115,6 @@ public interface Exchange { String SPLIT_COMPLETE = "CamelSplitComplete"; String SPLIT_SIZE = "CamelSplitSize"; - String TRANSACTED = "CamelTransacted"; String TRANSFER_ENCODING = "Transfer-Encoding"; String TRACE_EVENT = "CamelTraceEvent"; String TRACE_EVENT_NODE_ID = "CamelTraceEventNodeId"; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Thu Jul 1 05:56:24 2010 @@ -304,7 +304,7 @@ public final class DefaultExchange imple } public boolean isTransacted() { - return Boolean.TRUE.equals(getProperty(Exchange.TRANSACTED)); + return getUnitOfWork() != null && getUnitOfWork().isTransacted(); } public boolean isRollbackOnly() { Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java Thu Jul 1 05:56:24 2010 @@ -202,6 +202,10 @@ public class DefaultUnitOfWork implement return tracedRouteNodes; } + public boolean isTransacted() { + return transactedBy != null && !transactedBy.isEmpty(); + } + public boolean isTransactedBy(Object transactionDefinition) { return getTransactedBy().contains(transactionDefinition); } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java Thu Jul 1 05:56:24 2010 @@ -82,6 +82,13 @@ public interface UnitOfWork { TracedRouteNodes getTracedRouteNodes(); /** + * Are we transacted? + * + * @return <tt>true</tt> if transacted, <tt>false</tt> otherwise + */ + boolean isTransacted(); + + /** * Are we already transacted by the given transaction definition * <p/> * The definition will most likely be a Spring TransactionTemplate when using Spring Transaction Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTX2Test.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTX2Test.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTX2Test.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTX2Test.java Thu Jul 1 05:56:24 2010 @@ -72,12 +72,14 @@ public class AsyncEndpointJmsTX2Test ext .process(new Processor() { public void process(Exchange exchange) throws Exception { beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("async:Hi Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("log:after") Added: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java?rev=959519&view=auto ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java (added) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java Thu Jul 1 05:56:24 2010 @@ -0,0 +1,95 @@ +/** + * 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.component.jms.tx; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.processor.async.MyAsyncComponent; +import org.apache.camel.test.junit4.CamelSpringTestSupport; +import org.junit.Test; +import org.springframework.context.support.AbstractXmlApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @version $Revision$ + */ +public class AsyncEndpointJmsTXMulticastTest extends CamelSpringTestSupport { + + @Override + protected int getExpectedRouteCount() { + // no routes in Spring XML so return 0 + return 0; + } + + @Override + protected AbstractXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/JmsTransacted-context.xml"); + } + + private static String beforeThreadName; + private static String afterThreadName; + + @Test + public void testAsyncEndpointOK() throws Exception { + getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); + getMockEndpoint("mock:after").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel"); + + template.sendBody("activemq:queue:inbox", "Hello Camel"); + + assertMockEndpointsSatisfied(); + + // we are synchronous due to TX so the we are using same threads during the routing + assertTrue("Should use same threads", beforeThreadName.equalsIgnoreCase(afterThreadName)); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + context.addComponent("async", new MyAsyncComponent()); + + from("activemq:queue:inbox") + .transacted() + .to("mock:before") + .to("log:before") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .multicast().to("direct:foo"); + + from("direct:foo") + // tx should be conveyed to this route as well + .to("async:Bye Camel") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .to("log:after") + .to("mock:after") + .to("mock:result"); + } + }; + } +} \ No newline at end of file Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXMulticastTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Copied: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRecipientListTest.java (from r959503, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java) URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRecipientListTest.java?p2=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRecipientListTest.java&p1=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java&r1=959503&r2=959519&rev=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRecipientListTest.java Thu Jul 1 05:56:24 2010 @@ -28,7 +28,7 @@ import org.springframework.context.suppo /** * @version $Revision$ */ -public class AsyncEndpointJmsTXTest extends CamelSpringTestSupport { +public class AsyncEndpointJmsTXRecipientListTest extends CamelSpringTestSupport { @Override protected int getExpectedRouteCount() { @@ -72,12 +72,18 @@ public class AsyncEndpointJmsTXTest exte .process(new Processor() { public void process(Exchange exchange) throws Exception { beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) + .recipientList(constant("direct:foo")); + + from("direct:foo") + // tx should be conveyed to this route as well .to("async:Bye Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("log:after") @@ -86,4 +92,4 @@ public class AsyncEndpointJmsTXTest exte } }; } -} +} \ No newline at end of file Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollback2Test.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollback2Test.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollback2Test.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollback2Test.java Thu Jul 1 05:56:24 2010 @@ -76,12 +76,14 @@ public class AsyncEndpointJmsTXRollback2 .process(new Processor() { public void process(Exchange exchange) throws Exception { beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("async:Hi Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("log:after") @@ -98,6 +100,7 @@ public class AsyncEndpointJmsTXRollback2 if (invoked < 2) { throw new IllegalArgumentException("Damn"); } + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }); Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollbackTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollbackTest.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollbackTest.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRollbackTest.java Thu Jul 1 05:56:24 2010 @@ -76,12 +76,14 @@ public class AsyncEndpointJmsTXRollbackT .process(new Processor() { public void process(Exchange exchange) throws Exception { beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("async:Bye Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("log:after") @@ -92,6 +94,7 @@ public class AsyncEndpointJmsTXRollbackT if (invoked < 2) { throw new IllegalArgumentException("Damn"); } + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("mock:result"); Added: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java?rev=959519&view=auto ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java (added) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java Thu Jul 1 05:56:24 2010 @@ -0,0 +1,95 @@ +/** + * 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.component.jms.tx; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.processor.async.MyAsyncComponent; +import org.apache.camel.test.junit4.CamelSpringTestSupport; +import org.junit.Test; +import org.springframework.context.support.AbstractXmlApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @version $Revision$ + */ +public class AsyncEndpointJmsTXRoutingSlipTest extends CamelSpringTestSupport { + + @Override + protected int getExpectedRouteCount() { + // no routes in Spring XML so return 0 + return 0; + } + + @Override + protected AbstractXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/JmsTransacted-context.xml"); + } + + private static String beforeThreadName; + private static String afterThreadName; + + @Test + public void testAsyncEndpointOK() throws Exception { + getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); + getMockEndpoint("mock:after").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel"); + + template.sendBody("activemq:queue:inbox", "Hello Camel"); + + assertMockEndpointsSatisfied(); + + // we are synchronous due to TX so the we are using same threads during the routing + assertTrue("Should use same threads", beforeThreadName.equalsIgnoreCase(afterThreadName)); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + context.addComponent("async", new MyAsyncComponent()); + + from("activemq:queue:inbox") + .transacted() + .to("mock:before") + .to("log:before") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .routingSlip(constant("direct:foo")); + + from("direct:foo") + // tx should be conveyed to this route as well + .to("async:Bye Camel") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .to("log:after") + .to("mock:after") + .to("mock:result"); + } + }; + } +} \ No newline at end of file Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXRoutingSlipTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java Thu Jul 1 05:56:24 2010 @@ -72,12 +72,14 @@ public class AsyncEndpointJmsTXTest exte .process(new Processor() { public void process(Exchange exchange) throws Exception { beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("async:Bye Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("log:after") Added: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java?rev=959519&view=auto ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java (added) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java Thu Jul 1 05:56:24 2010 @@ -0,0 +1,103 @@ +/** + * 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.component.jms.tx; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.processor.async.MyAsyncComponent; +import org.apache.camel.test.junit4.CamelSpringTestSupport; +import org.junit.Test; +import org.springframework.context.support.AbstractXmlApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @version $Revision$ + */ +public class AsyncEndpointJmsTXTryCatchFinallyTest extends CamelSpringTestSupport { + + @Override + protected int getExpectedRouteCount() { + // no routes in Spring XML so return 0 + return 0; + } + + @Override + protected AbstractXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/JmsTransacted-context.xml"); + } + + private static String beforeThreadName; + private static String afterThreadName; + + @Test + public void testAsyncEndpointOK() throws Exception { + getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); + getMockEndpoint("mock:after").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:catch").expectedMessageCount(0); + getMockEndpoint("mock:finally").expectedBodiesReceived("Bye Camel"); + + template.sendBody("activemq:queue:inbox", "Hello Camel"); + + assertMockEndpointsSatisfied(); + + // we are synchronous due to TX so the we are using same threads during the routing + assertTrue("Should use same threads", beforeThreadName.equalsIgnoreCase(afterThreadName)); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + context.addComponent("async", new MyAsyncComponent()); + + from("activemq:queue:inbox") + .transacted() + .to("mock:before") + .to("log:before") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .doTry() + .to("direct:foo") + .doCatch(Exception.class) + .to("mock:catch") + .doFinally() + .to("mock:finally") + .end() + .to("mock:result"); + + from("direct:foo") + // tx should be conveyed to this route as well + .to("async:Bye Camel") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + afterThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); + } + }) + .to("log:after") + .to("mock:after"); + } + }; + } +} \ No newline at end of file Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTryCatchFinallyTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Copied: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXWireTapTest.java (from r959503, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java) URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXWireTapTest.java?p2=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXWireTapTest.java&p1=camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java&r1=959503&r2=959519&rev=959519&view=diff ============================================================================== --- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXTest.java (original) +++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AsyncEndpointJmsTXWireTapTest.java Thu Jul 1 05:56:24 2010 @@ -28,7 +28,7 @@ import org.springframework.context.suppo /** * @version $Revision$ */ -public class AsyncEndpointJmsTXTest extends CamelSpringTestSupport { +public class AsyncEndpointJmsTXWireTapTest extends CamelSpringTestSupport { @Override protected int getExpectedRouteCount() { @@ -43,19 +43,20 @@ public class AsyncEndpointJmsTXTest exte private static String beforeThreadName; private static String afterThreadName; + private static volatile boolean txA; + private static volatile boolean txB; @Test public void testAsyncEndpointOK() throws Exception { - getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); - getMockEndpoint("mock:after").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:tap").expectedBodiesReceived("Hi Camel"); getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel"); template.sendBody("activemq:queue:inbox", "Hello Camel"); assertMockEndpointsSatisfied(); - // we are synchronous due to TX so the we are using same threads during the routing - assertTrue("Should use same threads", beforeThreadName.equalsIgnoreCase(afterThreadName)); + // the tapped exchange is not transacted + assertFalse("Should use different threads", beforeThreadName.equalsIgnoreCase(afterThreadName)); } @Override @@ -67,23 +68,30 @@ public class AsyncEndpointJmsTXTest exte from("activemq:queue:inbox") .transacted() - .to("mock:before") - .to("log:before") .process(new Processor() { public void process(Exchange exchange) throws Exception { - beforeThreadName = Thread.currentThread().getName(); + assertTrue("Exchange should be transacted", exchange.isTransacted()); } }) .to("async:Bye Camel") + .wireTap("direct:tap") + .to("mock:result"); + + from("direct:tap") + .process(new Processor() { + public void process(Exchange exchange) throws Exception { + beforeThreadName = Thread.currentThread().getName(); + assertFalse("Exchange should NOT be transacted", exchange.isTransacted()); + } + }) + .to("async:Hi Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { afterThreadName = Thread.currentThread().getName(); } }) - .to("log:after") - .to("mock:after") - .to("mock:result"); + .to("mock:tap"); } }; } -} +} \ No newline at end of file Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java?rev=959519&r1=959518&r2=959519&view=diff ============================================================================== --- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java (original) +++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java Thu Jul 1 05:56:24 2010 @@ -16,8 +16,6 @@ */ package org.apache.camel.spring.spi; -import java.util.concurrent.CountDownLatch; - import org.apache.camel.AsyncCallback; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; @@ -149,8 +147,6 @@ public class TransactionErrorHandler ext // IMPORTANT: Must be a runtime exception to let Spring regard it as to do "rollback" RuntimeException rce = null; - exchange.setProperty(Exchange.TRANSACTED, Boolean.TRUE); - // and now let process the exchange by the error handler processByErrorHandler(exchange); From commitsbeth09@example.net Thu Jul 01 06:16:00 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 34859 invoked from network); 1 Jul 2010 06:16:00 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 06:16:00 -0000 Received: (qmail 93751 invoked by uid 500); 1 Jul 2010 06:16:00 -0000 Delivered-To: beth09@example.net Received: (qmail 93702 invoked by uid 500); 1 Jul 2010 06:15:58 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 93695 invoked by uid 99); 1 Jul 2010 06:15:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:15:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:15:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 12B392388993; Thu, 1 Jul 2010 06:15:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959526 - in /camel/trunk: components/camel-netty/pom.xml parent/pom.xml platforms/karaf/features/src/main/resources/features-spring3.xml platforms/karaf/features/src/main/resources/features.xml Date: Thu, 01 Jul 2010 06:15:00 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 06:15:00 2010 New Revision: 959526 URL: http://svn.apache.org/viewvc?rev=959526&view=rev Log: CAMEL-2884: Upgraded to Netty 3.2.1 Modified: camel/trunk/components/camel-netty/pom.xml camel/trunk/parent/pom.xml camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml camel/trunk/platforms/karaf/features/src/main/resources/features.xml Modified: camel/trunk/components/camel-netty/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-netty/pom.xml?rev=959526&r1=959525&r2=959526&view=diff ============================================================================== --- camel/trunk/components/camel-netty/pom.xml (original) +++ camel/trunk/components/camel-netty/pom.xml Thu Jul 1 06:15:00 2010 @@ -39,8 +39,8 @@ <repositories> <repository> - <id>jboss</id> - <url>http://repository.jboss.org/maven2</url> + <id>repository.jboss.org</id> + <url>http://repository.jboss.org/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=959526&r1=959525&r2=959526&view=diff ============================================================================== --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Jul 1 06:15:00 2010 @@ -92,7 +92,7 @@ <lucene-version>3.0.1</lucene-version> <mina-version>1.1.7</mina-version> <mockito-version>1.8.2</mockito-version> - <netty-version>3.1.5.GA</netty-version> + <netty-version>3.2.1.Final</netty-version> <ode-version>1.3.3</ode-version> <ognl-version>2.7.3_3</ognl-version> <openjpa-version>1.2.2</openjpa-version> Modified: camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml?rev=959526&r1=959525&r2=959526&view=diff ============================================================================== --- camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml (original) +++ camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml Thu Jul 1 06:15:00 2010 @@ -407,7 +407,7 @@ </feature> <feature name='camel-netty' version='${pom.version}'> <feature version='${pom.version}'>camel-core</feature> - <bundle>mvn:http://repository.jboss.org/maven2!org.jboss.netty/netty/${netty-version}</bundle> + <bundle>mvn:http://repository.jboss.org/nexus/content/groups/public!org.jboss.netty/netty/${netty-version}</bundle> <bundle>mvn:org.apache.camel/camel-netty/${pom.version}</bundle> </feature> <feature name='camel-ognl' version='${pom.version}'> Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=959526&r1=959525&r2=959526&view=diff ============================================================================== --- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original) +++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Thu Jul 1 06:15:00 2010 @@ -413,7 +413,7 @@ </feature> <feature name='camel-netty' version='${pom.version}'> <feature version='${pom.version}'>camel-core</feature> - <bundle>mvn:http://repository.jboss.org/maven2!org.jboss.netty/netty/${netty-version}</bundle> + <bundle>mvn:http://repository.jboss.org/nexus/content/groups/public!org.jboss.netty/netty/${netty-version}</bundle> <bundle>mvn:org.apache.camel/camel-netty/${pom.version}</bundle> </feature> <feature name='camel-ognl' version='${pom.version}'> From commitsbeth09@example.net Thu Jul 01 06:25:30 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 36143 invoked from network); 1 Jul 2010 06:25:30 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 06:25:30 -0000 Received: (qmail 3255 invoked by uid 500); 1 Jul 2010 06:25:30 -0000 Delivered-To: beth09@example.net Received: (qmail 3203 invoked by uid 500); 1 Jul 2010 06:25:28 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 3196 invoked by uid 99); 1 Jul 2010 06:25:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:25:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:25:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 45D6923889E7; Thu, 1 Jul 2010 06:24:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959531 - /camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SAOPBeforeAfterAndFinallyTest.scala Date: Thu, 01 Jul 2010 06:24:03 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 06:24:02 2010 New Revision: 959531 URL: http://svn.apache.org/viewvc?rev=959531&view=rev Log: Removed test for AOP feature which is @deprecated. Removed: camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SAOPBeforeAfterAndFinallyTest.scala From commitsbeth09@example.net Thu Jul 01 06:34:44 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 43965 invoked from network); 1 Jul 2010 06:34:44 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 06:34:44 -0000 Received: (qmail 10051 invoked by uid 500); 1 Jul 2010 06:34:44 -0000 Delivered-To: beth09@example.net Received: (qmail 9997 invoked by uid 500); 1 Jul 2010 06:34:43 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 9988 invoked by uid 99); 1 Jul 2010 06:34:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:34:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:34:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6E4C023889DD; Thu, 1 Jul 2010 06:33:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959532 - in /camel/trunk/components/camel-scala: ./ src/main/scala/org/apache/camel/scala/dsl/ src/main/scala/org/apache/camel/scala/dsl/builder/ Date: Thu, 01 Jul 2010 06:33:14 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 06:33:13 2010 New Revision: 959532 URL: http://svn.apache.org/viewvc?rev=959532&view=rev Log: Removed deprecated @aop from camel-scala. Removed: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAOPDefinition.scala Modified: camel/trunk/components/camel-scala/pom.xml camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala Modified: camel/trunk/components/camel-scala/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/pom.xml?rev=959532&r1=959531&r2=959532&view=diff ============================================================================== --- camel/trunk/components/camel-scala/pom.xml (original) +++ camel/trunk/components/camel-scala/pom.xml Thu Jul 1 06:33:13 2010 @@ -15,104 +15,105 @@ See the License for the specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>camel-parent</artifactId> - <version>2.4-SNAPSHOT</version> - </parent> - <artifactId>camel-scala</artifactId> - <packaging>bundle</packaging> - <name>Camel 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 Scala</name> - <description>Camel Scala DSL</description> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>camel-parent</artifactId> + <version>2.4-SNAPSHOT</version> + </parent> + <artifactId>camel-scala</artifactId> + <packaging>bundle</packaging> + <name>Camel 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 Scala</name> + <description>Camel Scala DSL</description> - <properties> - <camel.osgi.export.pkg>org.apache.camel.scala.*</camel.osgi.export.pkg> - </properties> + <properties> + <camel.osgi.export.pkg>org.apache.camel.scala.*</camel.osgi.export.pkg> + </properties> - <build> - <sourceDirectory>src/main/scala</sourceDirectory> - <testSourceDirectory>src/test/scala</testSourceDirectory> - <plugins> - <plugin> - <groupId>org.scala-tools</groupId> - <artifactId>maven-scala-plugin</artifactId> - <version>${scala-plugin-version}</version> - <executions> - <execution> - <goals> - <goal>compile</goal> - <goal>testCompile</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-eclipse-plugin</artifactId> - <configuration> - <projectnatures> - <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> - <projectnature>org.eclipse.jdt.core.javanature</projectnature> - </projectnatures> - <buildcommands> - <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> - </buildcommands> - <classpathContainers> - <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> - <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> - </classpathContainers> - </configuration> - </plugin> - </plugins> - </build> + <build> + <sourceDirectory>src/main/scala</sourceDirectory> + <testSourceDirectory>src/test/scala</testSourceDirectory> + <plugins> + <plugin> + <groupId>org.scala-tools</groupId> + <artifactId>maven-scala-plugin</artifactId> + <version>${scala-plugin-version}</version> + <executions> + <execution> + <goals> + <goal>compile</goal> + <goal>testCompile</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <configuration> + <projectnatures> + <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> + <projectnature>org.eclipse.jdt.core.javanature</projectnature> + </projectnatures> + <buildcommands> + <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> + </buildcommands> + <classpathContainers> + <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> + <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> + </classpathContainers> + </configuration> + </plugin> + </plugins> + </build> - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - </dependency> - <dependency> - <groupId>org.scala-lang</groupId> - <artifactId>scala-library</artifactId> - <version>${scala-version}</version> - </dependency> - <!-- test dependencies --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-juel</artifactId> - <type>jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jxpath</artifactId> - <type>jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-velocity</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core</artifactId> + </dependency> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-library</artifactId> + <version>${scala-version}</version> + </dependency> + <!-- test dependencies --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-juel</artifactId> + <type>jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-jxpath</artifactId> + <type>jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-velocity</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + </dependencies> </project> Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala?rev=959532&r1=959531&r2=959532&view=diff ============================================================================== --- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala (original) +++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/DSL.scala Thu Jul 1 06:33:13 2010 @@ -30,7 +30,6 @@ import org.apache.camel.spi.Policy trait DSL { def aggregate(expression: Exchange => Any, strategy: AggregationStrategy) : SAggregateDefinition - def aop : SAOPDefinition def as[Target](toType: Class[Target]) : DSL def attempt : STryDefinition def bean(bean: Any) : DSL Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala?rev=959532&r1=959531&r2=959532&view=diff ============================================================================== --- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala (original) +++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala Thu Jul 1 06:33:13 2010 @@ -55,8 +55,6 @@ abstract class SAbstractDefinition[P <: def as[Target](toType: Class[Target]) = wrap(target.convertBodyTo(toType)) - def aop = SAOPDefinition(target.aop) - def attempt : STryDefinition = STryDefinition(target.doTry) def split(expression: Exchange => Any) = SSplitDefinition(target.split(expression)) Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala?rev=959532&r1=959531&r2=959532&view=diff ============================================================================== --- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala (original) +++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala Thu Jul 1 06:33:13 2010 @@ -86,7 +86,6 @@ class RouteBuilder extends Preamble with def when(filter: Exchange => Any) = stack.top.when(filter) def as[Target](toType: Class[Target]) = stack.top.as(toType) - def aop = stack.top.aop def recipients(expression: Exchange => Any) = stack.top.recipients(expression) def filter(predicate: Exchange => Any) = stack.top.filter(predicate) From commitsbeth09@example.net Thu Jul 01 06:35:24 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 44139 invoked from network); 1 Jul 2010 06:35:24 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 06:35:24 -0000 Received: (qmail 11615 invoked by uid 500); 1 Jul 2010 06:35:24 -0000 Delivered-To: beth09@example.net Received: (qmail 11564 invoked by uid 500); 1 Jul 2010 06:35:23 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 11557 invoked by uid 99); 1 Jul 2010 06:35:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:35:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 06:35:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BA70D2388993; Thu, 1 Jul 2010 06:34:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959533 - /camel/trunk/parent/pom.xml Date: Thu, 01 Jul 2010 06:34:27 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 06:34:27 2010 New Revision: 959533 URL: http://svn.apache.org/viewvc?rev=959533&view=rev Log: Upgraded to scala 2.8.0.RC7 Modified: camel/trunk/parent/pom.xml Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=959533&r1=959532&r2=959533&view=diff ============================================================================== --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Jul 1 06:34:27 2010 @@ -103,7 +103,7 @@ <quartz-version>1.8.3</quartz-version> <restlet-version>1.1.9</restlet-version> <saxon-version>83.161.120.155</saxon-version> - <scala-version>2.8.0.RC6</scala-version> + <scala-version>2.8.0.RC7</scala-version> <scala-plugin-version>2.9.1</scala-plugin-version> <slf4j-version>1.5.10</slf4j-version> <smack-version>3.1.0</smack-version> From commitsbeth09@example.net Thu Jul 01 07:05:15 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 54607 invoked from network); 1 Jul 2010 07:05:15 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 07:05:15 -0000 Received: (qmail 38961 invoked by uid 500); 1 Jul 2010 07:05:15 -0000 Delivered-To: beth09@example.net Received: (qmail 38869 invoked by uid 500); 1 Jul 2010 07:05:13 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 38857 invoked by uid 99); 1 Jul 2010 07:05:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 07:05:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 07:05:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2A4E923889E5; Thu, 1 Jul 2010 07:04:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959540 - /camel/trunk/parent/pom.xml Date: Thu, 01 Jul 2010 07:04:17 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 07:04:16 2010 New Revision: 959540 URL: http://svn.apache.org/viewvc?rev=959540&view=rev Log: CAMEL-2885: Upgraded to slf4j 1.6.0 Modified: camel/trunk/parent/pom.xml Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=959540&r1=959539&r2=959540&view=diff ============================================================================== --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Jul 1 07:04:16 2010 @@ -105,7 +105,7 @@ <saxon-version>83.161.120.155</saxon-version> <scala-version>2.8.0.RC7</scala-version> <scala-plugin-version>2.9.1</scala-plugin-version> - <slf4j-version>1.5.10</slf4j-version> + <slf4j-version>1.6.0</slf4j-version> <smack-version>3.1.0</smack-version> <snmp4j-version>1.8.1_3</snmp4j-version> <spring-ehcache-version>1.6.2</spring-ehcache-version> From commitsbeth09@example.net Thu Jul 01 07:54:18 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 69645 invoked from network); 1 Jul 2010 07:54:18 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 07:54:18 -0000 Received: (qmail 97894 invoked by uid 500); 1 Jul 2010 07:54:18 -0000 Delivered-To: beth09@example.net Received: (qmail 97835 invoked by uid 500); 1 Jul 2010 07:54:16 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 97827 invoked by uid 99); 1 Jul 2010 07:54:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 07:54:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 07:54:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4E8F023889B1; Thu, 1 Jul 2010 07:52:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959549 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/model/BeanDefinition.java test/java/org/apache/camel/processor/BeanValidateTypeTest.java Date: Thu, 01 Jul 2010 07:52:49 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 07:52:48 2010 New Revision: 959549 URL: http://svn.apache.org/viewvc?rev=959549&view=rev Log: CAMEL-2846: bean DSL validate that instance is not a String as a String is for beanRef DSL instead. Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java (with props) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java?rev=959549&r1=959548&r2=959549&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java Thu Jul 1 07:52:48 2010 @@ -152,6 +152,14 @@ public class BeanDefinition extends Outp ObjectHelper.notNull(beanType, "bean, ref or beanType", this); bean = CamelContextHelper.newInstance(routeContext.getCamelContext(), beanType); } + ObjectHelper.notNull(bean, "bean", this); + + // validate the bean type is not from java so you by mistake think its a reference + // to a bean name but the String is being invoke instead + if (bean instanceof String) { + throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean + + ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef."); + } answer = new BeanProcessor(bean, routeContext.getCamelContext()); } if (method != null) { Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java?rev=959549&view=auto ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java (added) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java Thu Jul 1 07:52:48 2010 @@ -0,0 +1,66 @@ +/** + * 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.processor; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.FailedToCreateRouteException; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.impl.JndiRegistry; + +/** + * @version $Revision$ + */ +public class BeanValidateTypeTest extends ContextTestSupport { + + public static class MyCoolBean { + + public String hello(String s) { + return "Hello " + s; + } + + } + + @Override + public boolean isUseRouteBuilder() { + return false; + } + + @Override + protected JndiRegistry createRegistry() throws Exception { + JndiRegistry jndi = super.createRegistry(); + jndi.bind("cool", new MyCoolBean()); + return jndi; + } + + public void testBeanValidateType() throws Exception { + context.addRoutes(new RouteBuilder() { + @Override + public void configure() throws Exception { + // we should use beanRef instead to refer to cool + from("direct:start").bean("cool"); + } + }); + try { + context.start(); + fail("Should have thrown exception"); + } catch (FailedToCreateRouteException e) { + assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); + assertTrue(e.getCause().getMessage().startsWith("The bean instance is a java.lang.String type: cool.")); + } + } + +} Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date From commitsbeth09@example.net Thu Jul 01 08:17:28 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 87033 invoked from network); 1 Jul 2010 08:17:28 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 08:17:28 -0000 Received: (qmail 44338 invoked by uid 500); 1 Jul 2010 08:17:28 -0000 Delivered-To: beth09@example.net Received: (qmail 44286 invoked by uid 500); 1 Jul 2010 08:17:26 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 44279 invoked by uid 500); 1 Jul 2010 08:17:25 -0000 Delivered-To: beth09@example.net Received: (qmail 44268 invoked by uid 99); 1 Jul 2010 08:17:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 08:17:25 +0000 X-ASF-Spam-Status: No, hits=-1994.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 08:17:21 +0000 Received: from thor (localhost [83.161.120.155]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o618H0jO025213 for <beth09@example.net>; Thu, 1 Jul 2010 08:17:00 GMT Date: Thu, 1 Jul 2010 04:17:00 -0400 (EDT) From: beth09@example.net To: beth09@example.net Message-ID: <6776185.1597.1277972220013.JavaMail.confluence@thor> Subject: [CONF] Apache Camel > AOP MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="https://cwiki.apache.org/confluence"> <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true" type="text/css"> </head> <body style="background: white;" bgcolor="white" class="email-body"> <div id="pageContent"> <div id="notificationFormat"> <div class="wiki-content"> <div class="email"> <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/AOP">AOP</a></h2> <h4>Page <b>edited</b> by <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus Ibsen</a> </h4> <br/> <h4>Changes (1)</h4> <div id="page-diffs"> <table class="diff" cellpadding="0" cellspacing="0"> <tr><td class="diff-snipped" >...<br></td></tr> <tr><td class="diff-unchanged" >*Available as of Camel 2.0* <br> <br></td></tr> <tr><td class="diff-added-lines" style="background-color: #dfd;">{warning:title=@deprecated} <br>The [AOP] has been marked as @deprecated in Camel 2.4 onwards and will be removed in a future release. The concept of the [AOP] did not go in the directs we liked, so sometimes its better to remove unused/less used features. <br>{warning} <br> <br></td></tr> <tr><td class="diff-unchanged" >Camel has a AOP concept in the DSL allowing you do do some custom *before* and/or *after* processing when routing an [Exchange]. <br>It replaces the {{intercept}} from Camel 1.x that was more limited as it could was a fix around a single processor. <br></td></tr> <tr><td class="diff-snipped" >...<br></td></tr> </table> </div> <h4>Full Content</h4> <div class="notificationGreySide"> <h2><a name="AOP-AOP"></a>AOP</h2> <p><b>Available as of Camel 2.0</b></p> <div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>@deprecated</b><br />The <a href="/confluence/display/CAMEL/AOP" title="AOP">AOP</a> has been marked as @deprecated in Camel 2.4 onwards and will be removed in a future release. The concept of the <a href="/confluence/display/CAMEL/AOP" title="AOP">AOP</a> did not go in the directs we liked, so sometimes its better to remove unused/less used features.</td></tr></table></div> <p>Camel has a AOP concept in the DSL allowing you do do some custom <b>before</b> and/or <b>after</b> processing when routing an <a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a>.<br/> It replaces the <tt>intercept</tt> from Camel 1.x that was more limited as it could was a fix around a single processor.</p> <p>This new AOP can span multiple processors (nodes in the route graph) and it uses endpoint <a href="/confluence/display/CAMEL/URIs" title="URIs">URIs</a> to allow invoking any kind of Camel component.</p> <p>The AOP supports the following callbacks in which you can use 1..n free of choice:</p> <ul class="alternate" type="square"> <li>before</li> <li>after</li> <li>afterFinally</li> </ul> <p>The difference between <tt>after</tt> and <tt>afterFinally</tt> is that <tt>afterFinally</tt> is invoked from a finally block so it will <b>always</b> be invoked no matter what, eg also in case of an exception occur.</p> <h3><a name="AOP-UsingfromJavaDSL"></a>Using from Java DSL</h3> <p>In this route we want to use the AOP to do a before and after logging.</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> from(<span class="code-quote">"jms:queue:inbox"</span>) .aop().around(<span class="code-quote">"log:before"</span>, <span class="code-quote">"log:after"</span>) .to(<span class="code-quote">"bean:order?method=validate"</span>) .to(<span class="code-quote">"bean:order?method=handle"</span>) .end() .to(<span class="code-quote">"jms:queue:order"</span>); </pre> </div></div> <p>Notice that we use the <tt>end</tt> to indicate where the AOP around should end, for instance if we do more routing afterwards such as sending to another JMS queue. In the route below the AOP is only being around the bean processing.</p> <p>The aop in Java DSL have the following methods:</p> <ul class="alternate" type="square"> <li>around</li> <li>aroundFinally</li> <li>before</li> <li>after</li> <li>afterFinally</li> </ul> <h3><a name="AOP-UsingfromSpringDSL"></a>Using from Spring DSL</h3> <p>In Spring DSL its nearly the same as in the Java DSL however a bit differently</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-xml"> <span class="code-tag">&lt;route&gt;</span> <span class="code-tag">&lt;from uri=<span class="code-quote">"jms:queue:inbox"</span>/&gt;</span> <span class="code-tag">&lt;aop beforeUri=<span class="code-quote">"log:before"</span> afterUri=<span class="code-quote">"log:after"</span>&gt;</span> <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:order?method=validate"</span>/&gt;</span> <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:order?method=handle"</span>/&gt;</span> <span class="code-tag">&lt;/aop&gt;</span> <span class="code-tag">&lt;to uri=<span class="code-quote">"jms:queue:order"</span>/&gt;</span> </pre> </div></div> <p>Notice we use attributes on the &lt;aop&gt; tag to chose with AOP concept to use.</p> <p>At runtime that resolves into this messages flow:</p> <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> <pre class="code-java"> inbox -&gt; log:before -&gt; bean.validate -&gt; bean.handle -&gt; log:after -&gt; order </pre> </div></div> <p>The aop in Spring DSL have the following attributes:</p> <ul class="alternate" type="square"> <li>beforeUri</li> <li>afterUri</li> <li>afterFinallyUri</li> </ul> <p>So in order to do an around we use both the <tt>beforeUri</tt> and the <tt>afterUri</tt>.</p> <h3><a name="AOP-SeeAlso"></a>See Also</h3> <ul class="alternate" type="square"> <li><a href="/confluence/display/CAMEL/Architecture" title="Architecture">Architecture</a></li> <li><a href="/confluence/display/CAMEL/Intercept" title="Intercept">Intercept</a></li> </ul> </div> <div id="commentsSection" class="wiki-content pageSection"> <div style="float: right;"> <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a> </div> <a href="https://cwiki.apache.org/confluence/display/CAMEL/AOP">View Online</a> | <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2327032&revisedVersion=6&originalVersion=5">View Changes</a> | <a href="https://cwiki.apache.org/confluence/display/CAMEL/AOP?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a> </div> </div> </div> </div> </div> </body> </html> From commitsbeth09@example.net Thu Jul 01 09:08:44 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 16769 invoked from network); 1 Jul 2010 09:08:44 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 09:08:44 -0000 Received: (qmail 19175 invoked by uid 500); 1 Jul 2010 09:08:44 -0000 Delivered-To: beth09@example.net Received: (qmail 19126 invoked by uid 500); 1 Jul 2010 09:08:43 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 19116 invoked by uid 99); 1 Jul 2010 09:08:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 09:08:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 09:08:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0A0F323888D2; Thu, 1 Jul 2010 09:07:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959562 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java Date: Thu, 01 Jul 2010 09:07:45 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Thu Jul 1 09:07:45 2010 New Revision: 959562 URL: http://svn.apache.org/viewvc?rev=959562&view=rev Log: CAMEL-2886: idempotent consumer supports async routing engine Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java - copied, changed from r959549, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java?rev=959562&r1=959561&r2=959562&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java Thu Jul 1 09:07:45 2010 @@ -19,12 +19,16 @@ package org.apache.camel.processor.idemp import java.util.ArrayList; import java.util.List; +import org.apache.camel.AsyncCallback; +import org.apache.camel.AsyncProcessor; import org.apache.camel.Exchange; import org.apache.camel.Expression; import org.apache.camel.Navigate; import org.apache.camel.Processor; import org.apache.camel.impl.ServiceSupport; +import org.apache.camel.impl.converter.AsyncProcessorTypeConverter; import org.apache.camel.spi.IdempotentRepository; +import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.ServiceHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,21 +39,19 @@ import org.apache.commons.logging.LogFac * * @version $Revision$ */ -public class IdempotentConsumer extends ServiceSupport implements Processor, Navigate<Processor> { +public class IdempotentConsumer extends ServiceSupport implements AsyncProcessor, Navigate<Processor> { private static final transient Log LOG = LogFactory.getLog(IdempotentConsumer.class); private final Expression messageIdExpression; - private final Processor processor; + private final AsyncProcessor processor; private final IdempotentRepository<String> idempotentRepository; private final boolean eager; - // TODO: should support async routing engine - - public IdempotentConsumer(Expression messageIdExpression, - IdempotentRepository<String> idempotentRepository, boolean eager, Processor processor) { + public IdempotentConsumer(Expression messageIdExpression, IdempotentRepository<String> idempotentRepository, + boolean eager, Processor processor) { this.messageIdExpression = messageIdExpression; this.idempotentRepository = idempotentRepository; this.eager = eager; - this.processor = processor; + this.processor = AsyncProcessorTypeConverter.convert(processor); } @Override @@ -58,6 +60,10 @@ public class IdempotentConsumer extends } public void process(Exchange exchange) throws Exception { + AsyncProcessorHelper.process(this, exchange); + } + + public boolean process(Exchange exchange, AsyncCallback callback) { final String messageId = messageIdExpression.evaluate(exchange, String.class); if (messageId == null) { throw new NoMessageIdException(exchange, messageIdExpression); @@ -75,14 +81,15 @@ public class IdempotentConsumer extends if (!newKey) { // we already have this key so its a duplicate message onDuplicateMessage(exchange, messageId); - return; + callback.done(true); + return true; } // register our on completion callback exchange.addOnCompletion(new IdempotentOnCompletion(idempotentRepository, messageId, eager)); // process the exchange - processor.process(exchange); + return processor.process(exchange, callback); } public List<Processor> next() { Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java (from r959549, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java) URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java&r1=959549&r2=959562&rev=959562&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java Thu Jul 1 09:07:45 2010 @@ -20,22 +20,33 @@ import org.apache.camel.ContextTestSuppo import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.processor.idempotent.MemoryIdempotentRepository; /** * @version $Revision$ */ -public class AsyncEndpointTest extends ContextTestSupport { +public class AsyncEndpointIdempotentConsumerTest extends ContextTestSupport { private static String beforeThreadName; private static String afterThreadName; public void testAsyncEndpoint() throws Exception { - getMockEndpoint("mock:before").expectedBodiesReceived("Hello Camel"); - getMockEndpoint("mock:after").expectedBodiesReceived("Bye Camel"); - getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel"); + getMockEndpoint("mock:before").expectedBodiesReceived("A", "B", "C"); - String reply = template.requestBody("direct:start", "Hello Camel", String.class); - assertEquals("Bye Camel", reply); + MockEndpoint after = getMockEndpoint("mock:after"); + after.expectedBodiesReceived("Bye Camel", "Bye Camel"); + after.message(0).header("myId").isEqualTo(123); + after.message(1).header("myId").isEqualTo(456); + + MockEndpoint result = getMockEndpoint("mock:result"); + result.expectedBodiesReceived("Bye Camel", "Bye Camel"); + result.message(0).header("myId").isEqualTo(123); + result.message(1).header("myId").isEqualTo(456); + + template.sendBodyAndHeader("direct:start", "A", "myId", 123); + template.sendBodyAndHeader("direct:start", "B", "myId", 123); + template.sendBodyAndHeader("direct:start", "C", "myId", 456); assertMockEndpointsSatisfied(); @@ -57,6 +68,7 @@ public class AsyncEndpointTest extends C beforeThreadName = Thread.currentThread().getName(); } }) + .idempotentConsumer(header("myId"), MemoryIdempotentRepository.memoryIdempotentRepository(200)) .to("async:Bye Camel") .process(new Processor() { public void process(Exchange exchange) throws Exception { @@ -70,4 +82,4 @@ public class AsyncEndpointTest extends C }; } -} +} \ No newline at end of file From commitsbeth09@example.net Thu Jul 01 09:16:03 2010 Return-Path: <commitsbeth09@example.net> Delivered-To: beth09@example.net Received: (qmail 20308 invoked from network); 1 Jul 2010 09:16:03 -0000 Received: from unknown (HELO mail.apache.org) (83.161.120.155) by 83.161.120.155 with SMTP; 1 Jul 2010 09:16:03 -0000 Received: (qmail 23100 invoked by uid 500); 1 Jul 2010 09:16:03 -0000 Delivered-To: beth09@example.net Received: (qmail 23051 invoked by uid 500); 1 Jul 2010 09:16:01 -0000 Mailing-List: contact beth09@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:beth09@example.net> List-Unsubscribe: <mailto:beth09@example.net> List-Post: <mailto:beth09@example.net> List-Id: <commits.camel.apache.org> Reply-To: beth09@example.net Delivered-To: mailing list beth09@example.net Received: (qmail 23044 invoked by uid 99); 1 Jul 2010 09:16:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 09:16:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 09:15:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 310BC23888D2; Thu, 1 Jul 2010 09:15:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959563 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/ components/camel-bam/src/main/java/org/apache/camel/bam/rules/ components/camel-scala/src/test/scala/org/apache/camel/scala/ Date: Thu, 01 Jul 2010 09:15:00 -0000 To: beth09@example.net From: beth09@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <beth09@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: jstrachan Date: Thu Jul 1 09:14:59 2010 New Revision: 959563 URL: http://svn.apache.org/viewvc?rev=959563&view=rev Log: fix for CAMEL-2883 along with a test case in camel-scala so that we can use the ProcessorDefintion typed methods in the model from Scala without getting compile errors due to bad use of generics Added: camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/UsingModelTest.scala - copied, changed from r959354, camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/ScalaTypeConverterTest.scala Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemoveHeadersDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemovePropertyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequenceDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SamplingDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetExchangePatternDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/StopDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadsDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/TransactedDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/TemporalRule.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java Thu Jul 1 09:14:59 2010 @@ -36,7 +36,7 @@ import org.apache.camel.spi.RouteContext @XmlRootElement(name = "aop") @XmlAccessorType(XmlAccessType.FIELD) @Deprecated -public class AOPDefinition extends OutputDefinition<ProcessorDefinition> { +public class AOPDefinition extends OutputDefinition<AOPDefinition> { @XmlAttribute(required = false) private String beforeUri; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java Thu Jul 1 09:14:59 2010 @@ -36,7 +36,7 @@ import org.apache.camel.util.ObjectHelpe */ @XmlRootElement(name = "bean") @XmlAccessorType(XmlAccessType.FIELD) -public class BeanDefinition extends OutputDefinition<ProcessorDefinition> { +public class BeanDefinition extends OutputDefinition<BeanDefinition> { @XmlAttribute(required = false) private String ref; @XmlAttribute(required = false) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java Thu Jul 1 09:14:59 2010 @@ -35,7 +35,7 @@ import org.apache.camel.spi.RouteContext */ @XmlRootElement(name = "convertBodyTo") @XmlAccessorType(XmlAccessType.FIELD) -public class ConvertBodyDefinition extends ProcessorDefinition<ProcessorDefinition> { +public class ConvertBodyDefinition extends ProcessorDefinition<ConvertBodyDefinition> { @XmlAttribute private String type; @XmlAttribute(required = false) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java Thu Jul 1 09:14:59 2010 @@ -30,7 +30,7 @@ import org.apache.camel.spi.RouteContext */ @XmlRootElement(name = "doFinally") @XmlAccessorType(XmlAccessType.FIELD) -public class FinallyDefinition extends OutputDefinition<ProcessorDefinition> implements Block { +public class FinallyDefinition extends OutputDefinition<FinallyDefinition> implements Block { @Override public String toString() { Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java Thu Jul 1 09:14:59 2010 @@ -37,7 +37,7 @@ import org.apache.camel.spi.RouteContext */ @XmlRootElement(name = "intercept") @XmlAccessorType(XmlAccessType.FIELD) -public class InterceptDefinition extends OutputDefinition<ProcessorDefinition> { +public class InterceptDefinition extends OutputDefinition<InterceptDefinition> { // TODO: support stop later (its a bit hard as it needs to break entire processing of route) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java Thu Jul 1 09:14:59 2010 @@ -38,7 +38,7 @@ import org.apache.camel.util.EndpointHel */ @XmlRootElement(name = "interceptToEndpoint") @XmlAccessorType(XmlAccessType.FIELD) -public class InterceptSendToEndpointDefinition extends OutputDefinition<ProcessorDefinition> { +public class InterceptSendToEndpointDefinition extends OutputDefinition<InterceptSendToEndpointDefinition> { // TODO: Support lookup endpoint by ref (requires a bit more work) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java Thu Jul 1 09:14:59 2010 @@ -51,7 +51,7 @@ import org.apache.camel.spi.RouteContext */ @XmlRootElement(name = "marshal") @XmlAccessorType(XmlAccessType.FIELD) -public class MarshalDefinition extends OutputDefinition<ProcessorDefinition> { +public class MarshalDefinition extends OutputDefinition<MarshalDefinition> { @XmlAttribute(required = false) private String ref; // cannot use @XmlElementRef as it doesn't allow optional properties Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java Thu Jul 1 09:14:59 2010 @@ -38,7 +38,7 @@ import org.apache.camel.util.concurrent. */ @XmlRootElement(name = "multicast") @XmlAccessorType(XmlAccessType.FIELD) -public class MulticastDefinition extends OutputDefinition<ProcessorDefinition> implements ExecutorServiceAwareDefinition<MulticastDefinition> { +public class MulticastDefinition extends OutputDefinition<MulticastDefinition> implements ExecutorServiceAwareDefinition<MulticastDefinition> { @XmlAttribute(required = false) private Boolean parallelProcessing; @XmlAttribute(required = false) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java Thu Jul 1 09:14:59 2010 @@ -53,7 +53,7 @@ import static org.apache.camel.builder.P */ @XmlRootElement(name = "onException") @XmlAccessorType(XmlAccessType.FIELD) -public class OnExceptionDefinition extends ProcessorDefinition<ProcessorDefinition> { +public class OnExceptionDefinition extends ProcessorDefinition<OnExceptionDefinition> { @XmlElement(name = "exception") private List<String> exceptions = new ArrayList<String>(); Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java Thu Jul 1 09:14:59 2010 @@ -32,7 +32,7 @@ import org.apache.camel.util.CollectionS */ @XmlRootElement(name = "otherwise") @XmlAccessorType(XmlAccessType.FIELD) -public class OtherwiseDefinition extends OutputDefinition<ProcessorDefinition> implements Block { +public class OtherwiseDefinition extends OutputDefinition<OtherwiseDefinition> implements Block { @Override public String toString() { Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java Thu Jul 1 09:14:59 2010 @@ -31,7 +31,7 @@ import javax.xml.bind.annotation.XmlType */ @XmlType(name = "output") @XmlAccessorType(XmlAccessType.FIELD) -public class OutputDefinition<Type extends ProcessorDefinition> extends ProcessorDefinition<Type> { +public class OutputDefinition<Type extends ProcessorDefinition<Type>> extends ProcessorDefinition<Type> { @XmlElementRef protected List<ProcessorDefinition> outputs = new ArrayList<ProcessorDefinition>(); Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java Thu Jul 1 09:14:59 2010 @@ -31,7 +31,7 @@ import org.apache.camel.spi.RouteContext */ @XmlRootElement(name = "pipeline") @XmlAccessorType(XmlAccessType.FIELD) -public class PipelineDefinition extends OutputDefinition<ProcessorDefinition> { +public class PipelineDefinition extends OutputDefinition<PipelineDefinition> { @Override public String getShortName() { Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java Thu Jul 1 09:14:59 2010 @@ -36,7 +36,7 @@ import org.apache.camel.util.ObjectHelpe */ @XmlRootElement(name = "policy") @XmlAccessorType(XmlAccessType.FIELD) -public class PolicyDefinition extends OutputDefinition<ProcessorDefinition> { +public class PolicyDefinition extends OutputDefinition<PolicyDefinition> { // TODO: Align this code with TransactedDefinition Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java Thu Jul 1 09:14:59 2010 @@ -33,7 +33,7 @@ import org.apache.camel.util.ObjectHelpe */ @XmlRootElement(name = "process") @XmlAccessorType(XmlAccessType.FIELD) -public class ProcessDefinition extends OutputDefinition<ProcessorDefinition> { +public class ProcessDefinition extends OutputDefinition<ProcessDefinition> { @XmlAttribute(required = true) private String ref; @XmlTransient Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=959563&r1=959562&r2=959563&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java Thu Jul 1 09:14:59 2010 @@ -75,7 +75,7 @@ import static org.apache.camel.builder.B * @version $Revision$
{'source': 'Apache Software Foundation Public Mail Archives'}