You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/12/20 10:34:15 UTC
svn commit: r1424379 - in /karaf/eik/trunk: ./ archetypes/
archetypes/eik-camel-archetype/ archetypes/eik-camel-archetype/src/
archetypes/eik-camel-archetype/src/main/
archetypes/eik-camel-archetype/src/main/resources/
archetypes/eik-camel-archetype/sr...
Author: jbonofre
Date: Thu Dec 20 09:34:14 2012
New Revision: 1424379
URL: http://svn.apache.org/viewvc?rev=1424379&view=rev
Log:
[KARAF-1950] Add EIK Camel archetype
Added:
karaf/eik/trunk/archetypes/
karaf/eik/trunk/archetypes/eik-camel-archetype/
karaf/eik/trunk/archetypes/eik-camel-archetype/NOTICE
karaf/eik/trunk/archetypes/eik-camel-archetype/pom.xml
karaf/eik/trunk/archetypes/eik-camel-archetype/src/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/org.apache.karaf.eik.pde.examples.cfg
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/pom.xml
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyTransform.java
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/
karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/beans.xml
karaf/eik/trunk/archetypes/pom.xml
Modified:
karaf/eik/trunk/pom.xml
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/NOTICE
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/NOTICE?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/NOTICE (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/NOTICE Thu Dec 20 09:34:14 2012
@@ -0,0 +1,31 @@
+Apache Karaf EIK
+Copyright 2010-2012 The Apache Software Foundation
+
+
+I. Used Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+FUSE Source (http://www.fusesource.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Eclipse Foundation (http://www.eclipse.org/).
+Licensed under the EPL.
+
+
+II. License Summary
+- Apache License 2.0
+- EPL License
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/pom.xml?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/pom.xml (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/pom.xml Thu Dec 20 09:34:14 2012
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.karaf.eik</groupId>
+ <artifactId>archetypes</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.eik.archetypes</groupId>
+ <artifactId>eik-camel-archetype</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Apache Karaf :: EIK :: Archetypes :: Camel</name>
+ <description>Camel PDE plugin to be used in EIK</description>
+
+ <properties>
+ <archetype.version>2.2</archetype.version>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>${archetype.version}</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ <delimiters>
+ <delimiter>^*^</delimiter>
+ </delimiters>
+ <useDefaultDelimiters>false</useDefaultDelimiters>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>${archetype.version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
\ No newline at end of file
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml Thu Dec 20 09:34:14 2012
@@ -0,0 +1,64 @@
+<?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.
+-->
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" name="eik-camel-plugin"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd">
+
+ <requiredProperties>
+ <requiredProperty key="camel-version">
+ <defaultValue>${project.version}</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="slf4j-version">
+ <defaultValue>${slf4j-version}</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory>META-INF</directory>
+ <includes>
+ <include>**/*.MF</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8">
+ <directory></directory>
+ <includes>
+ <include>org.apache.karaf.eik.pde.examples.cfg</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</archetype-descriptor>
\ No newline at end of file
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/MANIFEST.MF?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/MANIFEST.MF (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/META-INF/MANIFEST.MF Thu Dec 20 09:34:14 2012
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Build-Jdk: 1.6.0_26
+Bundle-Version: 1.0.0.SNAPSHOT
+Bundle-ManifestVersion: 2
+Bundle-ClassPath: .
+Import-Package: org.apache.camel,
+ org.apache.camel.builder,
+ org.apache.camel.component.bean,
+ org.apache.camel.converter,
+ org.apache.camel.model,
+ org.apache.camel.spring,
+ org.slf4j
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/org.apache.karaf.eik.pde.examples.cfg
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/org.apache.karaf.eik.pde.examples.cfg?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/org.apache.karaf.eik.pde.examples.cfg (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/org.apache.karaf.eik.pde.examples.cfg Thu Dec 20 09:34:14 2012
@@ -0,0 +1 @@
+prefix=YourTransform
\ No newline at end of file
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/pom.xml?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/pom.xml (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/pom.xml Thu Dec 20 09:34:14 2012
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>jar</packaging>
+ <version>${version}</version>
+ <name>${artifactId} Camel PDE Plugin Project</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>provided</version>
+ <version>${slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.basedir}/META-INF/MANIFEST.MF</manifestFile>
+ <manifestEntries>
+ <Bundle-Version>${project.version}</Bundle-Version>
+ <Bundle-Name>${project.name}</Bundle-Name>
+ <Bundle-SymbolicName>${project.name}</Bundle-SymbolicName>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java Thu Dec 20 09:34:14 2012
@@ -0,0 +1,31 @@
+package ${package};
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.spring.Main;
+
+/**
+ * A simple example router to show how to define the route with Java DSL
+ */
+public class MyRouteBuilder extends RouteBuilder {
+
+ /**
+ * Allow this route to be run as an application
+ *
+ * @param args
+ */
+ public static void main(String[] args) throws Exception{
+ new Main().run(args);
+ }
+
+ public void configure() {
+ // set up the transform bean
+ MyTransform transform = new MyTransform();
+ transform.setPrefix("JavaDSL");
+
+ from("timer://javaTimer?fixedRate=true&period=2000")
+ .bean(transform, "transform")
+ .to("log:ExampleRouter");
+ }
+
+
+}
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyTransform.java
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyTransform.java?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyTransform.java (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/java/MyTransform.java Thu Dec 20 09:34:14 2012
@@ -0,0 +1,40 @@
+package ${package};
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+public class MyTransform {
+
+ private static final transient Logger LOG = LoggerFactory.getLogger(MyTransform.class);
+
+ private boolean verbose = true;
+ private String prefix = "MyTransform";
+
+ public Object transform(Object body) {
+ String answer = prefix + " set body: " + new Date();
+ if (verbose) {
+ System.out.println(">>>> " + answer);
+ }
+ LOG.info(">>>> " + answer);
+ return answer;
+ }
+
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+}
Added: karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/beans.xml?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/beans.xml (added)
+++ karaf/eik/trunk/archetypes/eik-camel-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/beans.xml Thu Dec 20 09:34:14 2012
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ctx="http://www.springframework.org/schema/context"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
+
+ <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
+ <!-- install the Java DSL route builder -->
+ <package>${package}</package>
+ <!-- install the route which is defined with xml tags -->
+ <route>
+ <from uri="timer://springTimer?fixedRate=true&period=200"/>
+ <bean ref="myTransform" method="transform"/>
+ <to uri="log:ExampleRouter"/>
+ </route>
+ </camel:camelContext>
+
+ <bean id="myTransform" class="${package}.MyTransform">
+ <property name="prefix" value="${prefix}"/>
+ </bean>
+
+ <osgix:cm-properties id="preProps" persistent-id="org.apache.eik.pde.examples">
+ <prop key="prefix">MyTransform</prop>
+ </osgix:cm-properties>
+
+ <ctx:property-placeholder properties-ref="preProps" />
+
+</beans>
\ No newline at end of file
Added: karaf/eik/trunk/archetypes/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/archetypes/pom.xml?rev=1424379&view=auto
==============================================================================
--- karaf/eik/trunk/archetypes/pom.xml (added)
+++ karaf/eik/trunk/archetypes/pom.xml Thu Dec 20 09:34:14 2012
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+ <!--
+
+ 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.
+ -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>eik</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.eik</groupId>
+ <artifactId>archetypes</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Karaf :: EIK :: Archetypes</name>
+
+ <modules>
+ <module>eik-camel-archetype</module>
+ </modules>
+
+</project>
\ No newline at end of file
Modified: karaf/eik/trunk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/eik/trunk/pom.xml?rev=1424379&r1=1424378&r2=1424379&view=diff
==============================================================================
--- karaf/eik/trunk/pom.xml (original)
+++ karaf/eik/trunk/pom.xml Thu Dec 20 09:34:14 2012
@@ -57,6 +57,7 @@
<modules>
<module>plugins</module>
<module>features</module>
+ <module>archetypes</module>
<module>manual</module>
<module>assembly</module>
</modules>