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 2018/05/03 00:48:30 UTC
[camel] branch master updated: CAMEL-10671: Adding camel example
project for the Ceylon JVM language
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 5de9a6c CAMEL-10671: Adding camel example project for the Ceylon JVM language
5de9a6c is described below
commit 5de9a6cf77914897b8d127922377bf6edbfa1614
Author: Dimitrios Liapis <di...@gmail.com>
AuthorDate: Mon Apr 23 11:59:29 2018 +0100
CAMEL-10671: Adding camel example project for the Ceylon JVM language
---
examples/camel-example-ceylon/.gitignore | 1 +
examples/camel-example-ceylon/ReadMe.md | 29 +++++
examples/camel-example-ceylon/pom.xml | 124 +++++++++++++++++++++
.../org/apache/camel/example/MyRouteBuilder.ceylon | 25 +++++
.../ceylon/org/apache/camel/example/package.ceylon | 17 +++
.../ceylon/org/apache/camel/example/run.ceylon | 35 ++++++
.../src/main/resources/log4j2.properties | 23 ++++
.../src/main/resources/module/module.ceylon | 23 ++++
examples/pom.xml | 1 +
9 files changed, 278 insertions(+)
diff --git a/examples/camel-example-ceylon/.gitignore b/examples/camel-example-ceylon/.gitignore
new file mode 100644
index 0000000..a2583f2
--- /dev/null
+++ b/examples/camel-example-ceylon/.gitignore
@@ -0,0 +1 @@
+module.ceylon
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/ReadMe.md b/examples/camel-example-ceylon/ReadMe.md
new file mode 100644
index 0000000..c7f1e63
--- /dev/null
+++ b/examples/camel-example-ceylon/ReadMe.md
@@ -0,0 +1,29 @@
+# Camel Router with Ceylon Project
+
+A simple example that uses Ceylon programming language to define a little Camel route.
+
+The Camel route listen on HTTP port 8080 and return back a constant response.
+
+### How to run
+
+To build this project use
+
+ mvn clean install
+
+To run this project
+
+ mvn resources:resources ceylon:run
+
+You can then open the following url from a web browser: <http://localhost:8080>
+
+
+### Forum, Help, etc
+
+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!
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/pom.xml b/examples/camel-example-ceylon/pom.xml
new file mode 100644
index 0000000..4ec21f1
--- /dev/null
+++ b/examples/camel-example-ceylon/pom.xml
@@ -0,0 +1,124 @@
+<?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.example</groupId>
+ <artifactId>examples</artifactId>
+ <version>2.22.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-ceylon</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: Ceylon</name>
+ <description>A Camel route using Ceylon</description>
+
+ <properties>
+ <category>Other Languages</category>
+ <ceylon.version>1.3.3</ceylon.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+
+ <!-- used for jetty -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jetty</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources/module</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/module.ceylon</include>
+ </includes>
+ </resource>
+ </resources>
+
+ <sourceDirectory>${project.basedir}/src/main/ceylon</sourceDirectory>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <copy file="${project.build.outputDirectory}/module.ceylon"
+ toFile="${project.basedir}/src/main/ceylon/org/apache/camel/example/module.ceylon" overwrite="true" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.ceylon-lang</groupId>
+ <artifactId>ceylon-maven-plugin</artifactId>
+ <version>${ceylon.version}</version>
+ <configuration>
+ <disablePomChecks>true</disablePomChecks>
+ <module>org.apache.camel.example/${project.version}</module>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
new file mode 100644
index 0000000..db0f2a3
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/MyRouteBuilder.ceylon
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+import org.apache.camel.builder { RouteBuilder }
+
+class MyRouteBuilder() extends RouteBuilder() {
+
+ shared actual void configure() {
+ from("jetty:http://0.0.0.0:8080")
+ .transform(constant("Hello from Ceylon"));
+ }
+}
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon
new file mode 100644
index 0000000..6308d01
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/package.ceylon
@@ -0,0 +1,17 @@
+/**
+ * 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.
+ */
+shared package org.apache.camel.example;
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon
new file mode 100644
index 0000000..b1b4418
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/ceylon/org/apache/camel/example/run.ceylon
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+import org.apache.camel.main { CamelMain = Main }
+import org.apache.camel.example { MyRouteBuilder }
+import ceylon.interop.java { createJavaStringArray }
+import java.lang { System }
+
+shared void run() {
+ print("\n\n\n\n");
+ print("===============================================");
+ print("Open your web browser on http://localhost:8080");
+ print("Press ctrl+c to stop this example");
+ print("===============================================");
+ print("\n\n\n\n");
+
+ CamelMain main = CamelMain();
+ main.addRouteBuilder(MyRouteBuilder());
+ main.run(createJavaStringArray(process.arguments));
+ System.exit(main.exitCode);
+
+}
\ No newline at end of file
diff --git a/examples/camel-example-ceylon/src/main/resources/log4j2.properties b/examples/camel-example-ceylon/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..d9f0508
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.out.ref = out
diff --git a/examples/camel-example-ceylon/src/main/resources/module/module.ceylon b/examples/camel-example-ceylon/src/main/resources/module/module.ceylon
new file mode 100644
index 0000000..36de736
--- /dev/null
+++ b/examples/camel-example-ceylon/src/main/resources/module/module.ceylon
@@ -0,0 +1,23 @@
+/**
+ * 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.
+ */
+native("jvm")
+module org.apache.camel.example "${project.version}" {
+
+ shared import "ceylon.interop.java" "${ceylon.version}";
+ shared import maven:"org.apache.camel:camel-core" "${project.version}";
+ shared import maven:"org.apache.camel:camel-jetty" "${project.version}";
+}
diff --git a/examples/pom.xml b/examples/pom.xml
index a1ec0f8..1769a97 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -52,6 +52,7 @@
<module>camel-example-cdi-rest-servlet</module>
<module>camel-example-cdi-test</module>
<module>camel-example-cdi-xml</module>
+ <module>camel-example-ceylon</module>
<module>camel-example-cxf</module>
<module>camel-example-cxf-blueprint</module>
<module>camel-example-cxf-proxy</module>
--
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.