camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1365917 - in /camel/trunk/examples/camel-example-gae: pom.xml src/main/java/org/apache/camel/example/gae/ReportGenerator.java src/main/webapp/WEB-INF/appengine-web.xml src/main/webapp/WEB-INF/web.xml
Date Thu, 26 Jul 2012 09:11:01 GMT
Author: ningjiang
Date: Thu Jul 26 09:11:01 2012
New Revision: 1365917

URL: http://svn.apache.org/viewvc?rev=1365917&view=rev
Log:
CAMEL-5454 Fixed camel-example-gae camel context load issue

Modified:
    camel/trunk/examples/camel-example-gae/pom.xml
    camel/trunk/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java
    camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml
    camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml

Modified: camel/trunk/examples/camel-example-gae/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-gae/pom.xml?rev=1365917&r1=1365916&r2=1365917&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-gae/pom.xml (original)
+++ camel/trunk/examples/camel-example-gae/pom.xml Thu Jul 26 09:11:01 2012
@@ -37,10 +37,21 @@
             <artifactId>camel-gae</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+        <dependency>
             <groupId>com.google.appengine.orm</groupId>
             <artifactId>datanucleus-appengine</artifactId>
             <version>1.0.5</version>
         </dependency>
+        <!-- Set up the log which will be used by camel -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <version>${slf4j-version}</version>
+        </dependency>
+		
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>

Modified: camel/trunk/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java?rev=1365917&r1=1365916&r2=1365917&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java
(original)
+++ camel/trunk/examples/camel-example-gae/src/main/java/org/apache/camel/example/gae/ReportGenerator.java
Thu Jul 26 09:11:01 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.example.gae;
 
+import java.util.logging.Logger;
+
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathFactory;
 
@@ -23,6 +25,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 
 public class ReportGenerator implements Processor {
+    private static final Logger LOGGER = Logger.getLogger(RequestProcessor.class.getName());
 
     public void process(Exchange exchange) throws Exception {
         ReportData data = exchange.getIn().getBody(ReportData.class);
@@ -41,10 +44,13 @@ public class ReportGenerator implements 
             temp = "<error retrieving current temperature>";
         }
         
-        exchange.getIn().setBody(new StringBuilder()
+        String result = new StringBuilder()
             .append("\n").append("Weather report for:  ").append(city)
             .append("\n").append("Current condition:   ").append(cond)
-            .append("\n").append("Current temperature: ").append(temp).append(" (Celsius)").toString());
+            .append("\n").append("Current temperature: ").append(temp).append(" (Celsius)").toString();
+        
+        LOGGER.info("Get the result" + result);
+        exchange.getIn().setBody(result);
     }
 
 }

Modified: camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml?rev=1365917&r1=1365916&r2=1365917&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml (original)
+++ camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/appengine-web.xml Thu Jul
26 09:11:01 2012
@@ -22,6 +22,8 @@
     <static-files>
         <exclude path="/index.html" />
     </static-files>
+    
+    <threadsafe>true</threadsafe>
 
 	<system-properties>
 		<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>

Modified: camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml?rev=1365917&r1=1365916&r2=1365917&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml (original)
+++ camel/trunk/examples/camel-example-gae/src/main/webapp/WEB-INF/web.xml Thu Jul 26 09:11:01
2012
@@ -21,14 +21,21 @@
          xsi:schemaLocation="
            http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          version="2.5">
+         
+  <!-- tell Spring where it should load the XML file -->
+  <context-param>
+       <param-name>contextConfigLocation</param-name>
+       <param-value>classpath:context.xml</param-value>
+  </context-param>
+
+  <!-- spring context listener which loads the XML file -->
+  <listener>
+      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+  </listener>
 
   <servlet>
     <servlet-name>CamelServlet</servlet-name>
     <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
-    <init-param>
-      <param-name>contextConfigLocation</param-name>
-      <param-value>context.xml</param-value>
-    </init-param>
   </servlet>
 
   <servlet-mapping>
@@ -48,14 +55,14 @@
       <role-name>*</role-name>
     </auth-constraint>
   </security-constraint>
-  <security-constraint>
+  <!--security-constraint>
     <web-resource-collection>
       <url-pattern>/worker/*</url-pattern>
     </web-resource-collection>
     <auth-constraint>
       <role-name>admin</role-name>
     </auth-constraint>
-  </security-constraint>
+  </security-constraint-->
 
 </web-app>
 



Mime
View raw message