You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/06/30 11:21:12 UTC

svn commit: r672732 - in /activemq/camel/trunk/examples/camel-example-loan-broker: README.txt build.xml src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java

Author: ningjiang
Date: Mon Jun 30 02:21:11 2008
New Revision: 672732

URL: http://svn.apache.org/viewvc?rev=672732&view=rev
Log:
CAMEL-649 Add build.xml for loan-broker example

Added:
    activemq/camel/trunk/examples/camel-example-loan-broker/build.xml   (with props)
Modified:
    activemq/camel/trunk/examples/camel-example-loan-broker/README.txt
    activemq/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java

Modified: activemq/camel/trunk/examples/camel-example-loan-broker/README.txt
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-loan-broker/README.txt?rev=672732&r1=672731&r2=672732&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-loan-broker/README.txt (original)
+++ activemq/camel/trunk/examples/camel-example-loan-broker/README.txt Mon Jun 30 02:21:11 2008
@@ -20,12 +20,47 @@
   mvn exec:java -PQueue.LoanBroker
   mvn exec:java -PQueue.Client
 
-The exmple of  web service version
+The exmple of WebServices version
   mvn exec:java -PWS.LoanBroker
   mvn exec:java -PWS.Client
 
+To run the example with Ant
+  a. You need to have Apache ActiveMQ , Apache CXF and Spring installed. They can be
+  downloaded from the following locations
+    Apache ActiveMQ
+    http://activemq.apache.org/
+    Apache CXF
+    http://cxf.apache.org/
+    Spring 2.5
+    http://www.springframework.org/download
+
+
+  b. Export / Set home directories for the above as follows
+    UNIX
+    export ACTIVEMQ_HOME=<path to ActiveMQ install directory>
+    export CXF_HOME=<path to CXF install directory>
+    export SPRING_HOME=<path to Spring install directory>
+    Windows
+    set ACTIVEMQ_HOME=<path to ActiveMQ install directory>
+    set CXF_HOME=<path to CXF install directory>
+    set SPRING_HOME=<path to Spring install directory>
+
+  c. To Run the server of the example of WebServices version using Ant, type
+    ant
+
+     To Run the client of the example of WebServices version using Ant, type
+    ant runWebClient
+
+     To run the server of the example of Queue version using Ant , type
+    ant runQueueServer
+
+     To run the client of the example of Queue version using Ant , type
+    ant runQueueClient
+
 To stop the example hit ctrl + c
 
+
+
 To use log4j as the logging framework add this to the pom.xml:
     <dependency>
       <groupId>log4j</groupId>

Added: activemq/camel/trunk/examples/camel-example-loan-broker/build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-loan-broker/build.xml?rev=672732&view=auto
==============================================================================
--- activemq/camel/trunk/examples/camel-example-loan-broker/build.xml (added)
+++ activemq/camel/trunk/examples/camel-example-loan-broker/build.xml Mon Jun 30 02:21:11 2008
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<project name="camel-example-loan-broker" default="run" basedir=".">
+
+	<import file="../common_build.xml"/>
+
+	<fail unless="env.ACTIVEMQ_HOME" message="You must download ActiveMQ and set your ACTIVEMQ_HOME to run this demo."/>
+	<fail unless="env.CXF_HOME" message="You must download CXF and set your CXF_HOME to run this demo."/>
+	<fail unless="env.SPRING_HOME" message="You must download Spring 2.5 and set your SPRING_HOME to run this demo."/>
+
+	<property name="project.name" value="camel-example-loan-broker"/>
+
+	<path id="sample.build.classpath">
+		<fileset dir="${camel.lib}">
+			<include name="**/camel-cxf-*.jar"/>
+			<include name="**/camel-jms-*.jar"/>
+			<exclude name="**/*-tests.jar"/>
+		</fileset>
+		<path refid="camel.spring.classpath"/>
+		<path refid="spring.classpath"/>
+		<path refid="camel.core.classpath"/>
+		<path refid="activemq.classpath"/>
+		<path refid="cxf.classpath"/>
+	</path>
+
+	<property name="cxf.home" value="${env.CXF_HOME}"/>
+	<path id="cxf.classpath">
+		<fileset dir="${cxf.home}">
+			<include name="**/cxf-*.jar"/>
+		</fileset>
+	</path>
+
+
+	<target name="run" depends="build"
+		description="Compile and run the WebServices version server of loan broker">
+		<camelrun mainClass="org.apache.camel.loanbroker.webservice.version.LoanBroker" />
+	</target>
+
+	<target name="runWebClient" depends="build"
+		description="Compile and run the WebServices version client of loan broker">
+		<camelrun mainClass="org.apache.camel.loanbroker.webservice.version.Client" />
+	</target>
+
+	<target name="runQueueServer" depends="build"
+		description="Compile and run the queue version server of loan broker">
+		<camelrun mainClass="org.apache.camel.loanbroker.queue.version.LoanBroker" />
+	</target>
+
+	<target name="runQueueClient" depends="build"
+			description="Compile and run the queue version client of loan broker">
+			<camelrun mainClass="org.apache.camel.loanbroker.queue.version.Client" />
+	</target>
+
+</project>

Propchange: activemq/camel/trunk/examples/camel-example-loan-broker/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/examples/camel-example-loan-broker/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/examples/camel-example-loan-broker/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: activemq/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java?rev=672732&r1=672731&r2=672732&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java (original)
+++ activemq/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version/Translator.java Mon Jun 30 02:21:11 2008
@@ -26,8 +26,8 @@
         String bank = (String)exchange.getIn().getHeader(Constants.PROPERTY_BANK);
         Double rate = (Double)exchange.getIn().getHeader(Constants.PROPERTY_RATE);
         String ssn = (String)exchange.getIn().getHeader(Constants.PROPERTY_SSN);
-        exchange.getOut().setBody("Loan quotion for Client " + ssn
-                                  + "The lowest rate of bank is " + bank + ", the rate is " + rate);
+        exchange.getOut().setBody("Loan quotion for Client " + ssn + "."
+                                  + " The lowest rate of bank is " + bank + ", the rate is " + rate);
     }
 
 }