Return-Path: Delivered-To: apmail-activemq-camel-commits-archive@locus.apache.org Received: (qmail 83317 invoked from network); 12 Nov 2008 08:18:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Nov 2008 08:18:16 -0000 Received: (qmail 49719 invoked by uid 500); 12 Nov 2008 08:18:24 -0000 Delivered-To: apmail-activemq-camel-commits-archive@activemq.apache.org Received: (qmail 49693 invoked by uid 500); 12 Nov 2008 08:18:24 -0000 Mailing-List: contact camel-commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-commits@activemq.apache.org Received: (qmail 49681 invoked by uid 99); 12 Nov 2008 08:18:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 00:18:24 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 08:17:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D8921238893B; Wed, 12 Nov 2008 00:17:25 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r713308 - in /activemq/camel/branches/camel-1.x: ./ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ components/camel-sql/ components/camel-sql/src/main/java/org/apache/camel/component/sql/ Date: Wed, 12 Nov 2008 08:17:22 -0000 To: camel-commits@activemq.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081112081725.D8921238893B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Wed Nov 12 00:17:19 2008 New Revision: 713308 URL: http://svn.apache.org/viewvc?rev=713308&view=rev Log: Merged revisions 713290 via svnmerge from https://svn.apache.org/repos/asf/activemq/camel/trunk ........ r713290 | davsclaus | 2008-11-12 08:35:48 +0100 (on, 12 nov 2008) | 1 line CAMEL-1063: Added dataSourceRef option to lookup DS in registry ........ Modified: activemq/camel/branches/camel-1.x/ (props changed) activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTestSupport.java (props changed) activemq/camel/branches/camel-1.x/components/camel-sql/pom.xml activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java Propchange: activemq/camel/branches/camel-1.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Nov 12 00:17:19 2008 @@ -1 +1 @@ -/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713273,713292 +/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713273,713290,713292 Propchange: activemq/camel/branches/camel-1.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Propchange: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTestSupport.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Nov 12 00:17:19 2008 @@ -1 +1 @@ -/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTestSupport.java:713292 +/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTestSupport.java:713290,713292 Modified: activemq/camel/branches/camel-1.x/components/camel-sql/pom.xml URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-sql/pom.xml?rev=713308&r1=713307&r2=713308&view=diff ============================================================================== --- activemq/camel/branches/camel-1.x/components/camel-sql/pom.xml (original) +++ activemq/camel/branches/camel-1.x/components/camel-sql/pom.xml Wed Nov 12 00:17:19 2008 @@ -67,6 +67,11 @@ junit test + + log4j + log4j + test + hsqldb hsqldb Modified: activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java?rev=713308&r1=713307&r2=713308&view=diff ============================================================================== --- activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java (original) +++ activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlComponent.java Wed Nov 12 00:17:19 2008 @@ -28,7 +28,6 @@ * @version $Revision:520964 $ */ public class SqlComponent extends DefaultComponent { - private DataSource dataSource; public SqlComponent() { @@ -39,12 +38,20 @@ } @Override - protected Endpoint createEndpoint(String uri, String remaining, Map parameters) - throws Exception { + protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { + String dataSourceRef = getAndRemoveParameter(parameters, "dataSourceRef", String.class); + if (dataSourceRef != null) { + dataSource = getCamelContext().getRegistry().lookup(dataSourceRef, DataSource.class); + if (dataSource == null) { + throw new IllegalArgumentException("DataSource " + dataSourceRef + " not found in registry"); + } + } + return new SqlEndpoint(uri, remaining.replaceAll("#", "?"), this, dataSource, parameters); } public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; } + } Modified: activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java?rev=713308&r1=713307&r2=713308&view=diff ============================================================================== --- activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java (original) +++ activemq/camel/branches/camel-1.x/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java Wed Nov 12 00:17:19 2008 @@ -32,13 +32,9 @@ * SQL Endpoint. Endpoint URI should contain valid SQL statement, but instead of * question marks (that are parameter placeholders), sharp signs should be used. * This is because in camel question mark has other meaning. - * - * @author romkal */ public class SqlEndpoint extends DefaultEndpoint { - private JdbcTemplate jdbcTemplate; - private String query; public SqlEndpoint(String uri, String query, Component component, DataSource dataSource, Map parameters) throws Exception { @@ -55,7 +51,7 @@ } public Consumer createConsumer(Processor processor) throws Exception { - throw new UnsupportedOperationException("Not yet implemented"); + throw new UnsupportedOperationException("Not implemented"); } public Producer createProducer() throws Exception {