Updated Branches:
  refs/heads/master bbc1a4df0 -> f7258dab3

Added restlet-jdbc example with both spring-xml and java dsl


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7258dab
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7258dab
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7258dab

Branch: refs/heads/master
Commit: f7258dab36895d15ac3be2e2884150edcf435ee1
Parents: bbc1a4d
Author: Bilgin Ibryam <bibr...@apache.org>
Authored: Tue Aug 20 13:51:17 2013 +0100
Committer: Bilgin Ibryam <bibr...@apache.org>
Committed: Tue Aug 20 13:52:19 2013 +0100

----------------------------------------------------------------------
 examples/camel-example-restlet-jdbc/README.txt  | 36 +++++++
 examples/camel-example-restlet-jdbc/pom.xml     | 99 ++++++++++++++++++++
 .../example/restlet/jdbc/MyRouteConfig.java     | 50 ++++++++++
 .../src/main/resources/camel-context.xml        | 24 +++++
 .../src/main/resources/common.xml               | 35 +++++++
 .../src/main/resources/java-dsl.xml             | 35 +++++++
 .../src/main/resources/log4j.properties         | 30 ++++++
 .../src/main/resources/sql/init.sql             | 22 +++++
 .../src/main/resources/xml-dsl.xml              | 83 ++++++++++++++++
 .../src/main/webapp/WEB-INF/web.xml             | 48 ++++++++++
 examples/pom.xml                                |  1 +
 11 files changed, 463 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/README.txt
----------------------------------------------------------------------
diff --git a/examples/camel-example-restlet-jdbc/README.txt 
b/examples/camel-example-restlet-jdbc/README.txt
new file mode 100644
index 0000000..0f281b0
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/README.txt
@@ -0,0 +1,36 @@
+Camel Restlet and JDBC Example
+==============================
+
+An example which shows how to expose CRUD operations with REST interface and 
JDBC implementation
+
+Compile: mvn clean install
+
+Run the application using XML-DSL: mvn jetty:run
+
+To run with Java-DSL use: mvn jetty:run -Dimpl=java-dsl
+
+To create an person, make a http POST request with firstName and lastName 
parameters:
+curl -d "firstName=test&lastName=person" http://localhost:8080/rs/persons/
+
+To update an existing person, make a http PUT request with firstName and 
lastName parameters:
+curl -X PUT -d "firstName=updated&lastName=person" 
http://localhost:8080/rs/persons/2
+
+To retrieve an existing person, make a http GET request with the personId as 
part of the url:
+curl -X GET  http://localhost:8080/rs/persons/1
+
+To delete an existing person, make a http DELETE request with the personId as 
part of the url:
+curl -X DELETE  http://localhost:8080/rs/persons/1
+
+To retrieve all the existing persons, make a http GET request to persons url:
+curl -X GET  http://localhost:8080/rs/persons
+
+If you hit an problems please let us know on the Camel Forums
+  http://camel.apache.org/discussion-forums.html
+
+Please help us make Apache Camel better - we appreciate any feedback you may
+have.  Enjoy!
+
+------------------------
+The Camel riders!
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-restlet-jdbc/pom.xml 
b/examples/camel-example-restlet-jdbc/pom.xml
new file mode 100755
index 0000000..dd88c8d
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/pom.xml
@@ -0,0 +1,99 @@
+<?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 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>examples</artifactId>
+        <version>2.12-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-restlet-jdbc</artifactId>
+    <packaging>war</packaging>
+    <name>Camel :: Example :: Restlet :: JDBC</name>
+    <description>An example showing how to create REST API with Camel Restlet 
and JDBC components</description>
+
+    <repositories>
+        <repository>
+        <id>maven-restlet</id>
+        <name>Public online Restlet repository</name>
+        <url>http://maven.restlet.org</url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-expression</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-restlet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.restlet.jee</groupId>
+            <artifactId>org.restlet.ext.spring</artifactId>
+            <version>${restlet-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- so we can run mvn jetty:run -->
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>jetty-maven-plugin</artifactId>
+                <configuration>
+                    <connectors>
+                        <connector 
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+                            <port>8080</port>
+                            <maxIdleTime>60000</maxIdleTime>
+                        </connector>
+                    </connectors>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/java/org/apache/camel/example/restlet/jdbc/MyRouteConfig.java
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/java/org/apache/camel/example/restlet/jdbc/MyRouteConfig.java
 
b/examples/camel-example-restlet-jdbc/src/main/java/org/apache/camel/example/restlet/jdbc/MyRouteConfig.java
new file mode 100644
index 0000000..8808029
--- /dev/null
+++ 
b/examples/camel-example-restlet-jdbc/src/main/java/org/apache/camel/example/restlet/jdbc/MyRouteConfig.java
@@ -0,0 +1,50 @@
+/**
+ * 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.example.restlet.jdbc;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class MyRouteConfig extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        from("restlet:/persons?restletMethod=POST")
+                .setBody(simple("insert into person(firstName, lastName) 
values('${header.firstName}','${header.lastName}"))
+                .to("jdbc:dataSource")
+                .setBody(simple("select * from person where id in (select 
max(id) from person)"))
+                .to("jdbc:dataSource");
+
+        from("restlet:/persons/{personId}?restletMethods=GET,PUT,DELETE")
+                .choice()
+                    .when(simple("${header.CamelHttpMethod} == 'GET'"))
+                        .setBody(simple("select * from person where id = 
${header.personId}"))
+                    .when(simple("${header.CamelHttpMethod} == 'PUT'"))
+                        .setBody(simple("update person set 
firstName='${header.firstName}', lastName='${header.lastName}' where id = 
${header.personId}"))
+                    .when(simple("${header.CamelHttpMethod} == 'DELETE'"))
+                        .setBody(simple("delete from person where id = 
${header.personId}"))
+                    .otherwise()
+                        .stop()
+                .end()
+                .to("jdbc:dataSource");
+
+        from("restlet:/persons?restletMethod=GET")
+                .setBody(simple("select * from person"))
+                .to("jdbc:dataSource");
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/camel-context.xml
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/resources/camel-context.xml 
b/examples/camel-example-restlet-jdbc/src/main/resources/camel-context.xml
new file mode 100755
index 0000000..f76cf8a
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/camel-context.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd";>
+
+    <import resource="${impl?:xml-dsl}.xml" />
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/common.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-restlet-jdbc/src/main/resources/common.xml 
b/examples/camel-example-restlet-jdbc/src/main/resources/common.xml
new file mode 100644
index 0000000..66baddd
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/common.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:jdbc="http://www.springframework.org/schema/jdbc";
+
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/jdbc 
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd";>
+
+    <bean id="RestletComponent" class="org.restlet.Component"/>
+
+    <bean id="RestletComponentService" 
class="org.apache.camel.component.restlet.RestletComponent">
+        <constructor-arg ref="RestletComponent" />
+    </bean>
+
+    <jdbc:embedded-database id="dataSource" type="DERBY">
+        <jdbc:script location="classpath:sql/init.sql"/>
+    </jdbc:embedded-database>
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/java-dsl.xml
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/resources/java-dsl.xml 
b/examples/camel-example-restlet-jdbc/src/main/resources/java-dsl.xml
new file mode 100644
index 0000000..dd88e44
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/java-dsl.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           
http://www.springframework.org/schema/beans/spring-beans.xsd
+                           http://camel.apache.org/schema/spring
+                           
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+    <import resource="common.xml" />
+
+    <bean id="myRouteConfig" 
class="org.apache.camel.example.restlet.jdbc.MyRouteConfig" />
+
+    <camel:camelContext id="defaultCamelContext">
+        <camel:routeBuilder ref="myRouteConfig"/>
+    </camel:camelContext>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/resources/log4j.properties 
b/examples/camel-example-restlet-jdbc/src/main/resources/log4j.properties
new file mode 100755
index 0000000..f6a74d5
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/log4j.properties
@@ -0,0 +1,30 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+# default properties to initialise log4j
+log4j.rootLogger=INFO, console
+
+# settings for specific packages
+#log4j.logger.org.apache.camel.component.http=DEBUG
+#log4j.logger.org.apache.camel.component.servlet=DEBUG
+#log4j.logger.org.apache.camel=DEBUG
+
+# Console appender
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} 
- %m%n
+log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/sql/init.sql
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/resources/sql/init.sql 
b/examples/camel-example-restlet-jdbc/src/main/resources/sql/init.sql
new file mode 100644
index 0000000..e7d514a
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/sql/init.sql
@@ -0,0 +1,22 @@
+-- ------------------------------------------------------------------------
+-- 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.
+-- ------------------------------------------------------------------------
+
+CREATE TABLE person(
+  id INT not null primary key GENERATED ALWAYS AS IDENTITY (START WITH 1, 
INCREMENT BY 1),
+  firstName VARCHAR(100) DEFAULT NULL,
+  lastName VARCHAR(100) DEFAULT NULL
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/resources/xml-dsl.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-restlet-jdbc/src/main/resources/xml-dsl.xml 
b/examples/camel-example-restlet-jdbc/src/main/resources/xml-dsl.xml
new file mode 100644
index 0000000..d27f9a7
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/resources/xml-dsl.xml
@@ -0,0 +1,83 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:jdbc="http://www.springframework.org/schema/jdbc";
+
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+       http://www.springframework.org/schema/jdbc 
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd";>
+
+    <import resource="common.xml" />
+
+    <camelContext xmlns="http://camel.apache.org/schema/spring";>
+        <route>
+            <from uri="restlet:/persons?restletMethod=POST"/>
+
+            <setBody>
+                <simple>insert into person(firstName, lastName) 
values('${header.firstName}','${header.lastName}')
+                </simple>
+            </setBody>
+            <to uri="jdbc:dataSource"/>
+
+            <setBody>
+                <!--<simple>select * from person ORDER BY id desc OFFSET 1 
ROWS</simple>-->
+                <simple>select * from person where id in (select max(id) from 
person)</simple>
+            </setBody>
+            <to uri="jdbc:dataSource"/>
+        </route>
+
+        <route>
+            <from 
uri="restlet:/persons/{personId}?restletMethods=GET,PUT,DELETE"/>
+            <choice>
+                <when>
+                    <simple>${header.CamelHttpMethod} == 'GET'</simple>
+                    <setBody>
+                        <simple>select * from person where id = 
${header.personId}</simple>
+                    </setBody>
+                </when>
+                <when>
+                    <simple>${header.CamelHttpMethod} == 'PUT'</simple>
+                    <setBody>
+                        <simple>update person set 
firstName='${header.firstName}', lastName='${header.lastName}' where id = 
${header.personId}</simple>
+                    </setBody>
+                </when>
+                <when>
+                    <simple>${header.CamelHttpMethod} == 'DELETE'</simple>
+                    <setBody>
+                        <simple>delete from person where id = 
${header.personId}</simple>
+                    </setBody>
+                </when>
+                <otherwise>
+                    <stop/>
+                </otherwise>
+            </choice>
+            <to uri="jdbc:dataSource"/>
+        </route>
+
+        <route>
+            <from uri="restlet:/persons?restletMethod=GET"/>
+            <setBody>
+                <constant>select * from person</constant>
+            </setBody>
+            <to uri="jdbc:dataSource"/>
+        </route>
+
+    </camelContext>
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/camel-example-restlet-jdbc/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-restlet-jdbc/src/main/webapp/WEB-INF/web.xml 
b/examples/camel-example-restlet-jdbc/src/main/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000..8fcfc6a
--- /dev/null
+++ b/examples/camel-example-restlet-jdbc/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,48 @@
+<?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.
+-->
+
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
+
+    <display-name>An example showing how to create REST API with Camel Restlet 
and JDBC components</display-name>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>classpath:camel-context.xml</param-value>
+    </context-param>
+
+    <listener>
+        
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>RestletServlet</servlet-name>
+        
<servlet-class>org.restlet.ext.spring.SpringServerServlet</servlet-class>
+        <init-param>
+            <param-name>org.restlet.component</param-name>
+            <param-value>RestletComponent</param-value>
+        </init-param>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>RestletServlet</servlet-name>
+        <url-pattern>/rs/*</url-pattern>
+    </servlet-mapping>
+
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7258dab/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index cd51469..57096e8 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -60,6 +60,7 @@
     <module>camel-example-pojo-messaging</module>
     <module>camel-example-reportincident</module>
     <module>camel-example-reportincident-wssecurity</module>
+    <module>camel-example-restlet-jdbc</module>
     <module>camel-example-route-throttling</module>
     <module>camel-example-servlet-tomcat</module>
     <module>camel-example-servlet-tomcat-no-spring</module>

Reply via email to