diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-27 10:12:24 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-27 10:12:24 +0000 |
commit | 46576bda96cf80886ed8bd811e79dee9b1e63f4c (patch) | |
tree | b8ac5e49c7c999f9a03425cab3e844a0a24e6d6a /sca-java-2.x/contrib/tutorials/travelsample/util | |
parent | d3ab2b28493cecc4092814c3fd6873d74d1018d8 (diff) |
Move the travel sample tutorial from 2.x trunk to contrib as its not in the build, doesn't build, and no one is actively working on it. (and even if they were, i wonder if this should be released seperately like the 1.x version and so not in the trunk tree anyway
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@948750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/tutorials/travelsample/util')
7 files changed, 584 insertions, 0 deletions
diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/build.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/build.xml new file mode 100644 index 0000000000..3ab8df5da3 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/build.xml @@ -0,0 +1,44 @@ +<!--
+ * 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="scatours-util" default="compile">
+
+ <target name="compile">
+ <antcall target="allsubdirs">
+ <param name="target" value="compile"/>
+ </antcall>
+ </target>
+
+ <target name="test">
+ <antcall target="allsubdirs">
+ <param name="target" value="test"/>
+ </antcall>
+ </target>
+
+ <target name="clean">
+ <antcall target="allsubdirs">
+ <param name="target" value="clean"/>
+ </antcall>
+ </target>
+
+ <target name="allsubdirs">
+ <ant dir="launcher-common" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/jaxws-runtime/pom.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/jaxws-runtime/pom.xml new file mode 100644 index 0000000000..0a1daf914b --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/jaxws-runtime/pom.xml @@ -0,0 +1,148 @@ +<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <version>2.0-SNAPSHOT</version>
+ <artifactId>scatours-util-jaxws-runtime</artifactId>
+ <name>Apache Tuscany SCA Tours JAX-WS Runtime Dependencies for JDK 5</name>
+
+ <profiles>
+ <profile>
+ <!-- The default profile produces a subset distribution which excludes
+ libraries that are present in the Tuscany SCA binary distro. -->
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.ws</groupId>
+ <artifactId>jaxws-rt</artifactId>
+ <version>2.1.7</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <!-- exclude the following because they are part of the Tuscany SCA binary distro -->
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ </exclusion>
+ <!-- exclude the following because they aren't needed by the travel sample -->
+ <exclusion>
+ <groupId>com.sun.org.apache.xml.internal</groupId>
+ <artifactId>resolver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jvnet</groupId>
+ <artifactId>mimepull</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.net.httpserver</groupId>
+ <artifactId>http</artifactId>
+ <version>20070405</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ <version>1.3</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <!-- exclude the following because it is part of the Tuscany SCA binary distro -->
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <!-- Use mvn -Pselfcontained to produce a self-contained distribution
+ with all library dependencies included. -->
+ <id>selfcontained</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.ws</groupId>
+ <artifactId>jaxws-rt</artifactId>
+ <version>2.1.7</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.net.httpserver</groupId>
+ <artifactId>http</artifactId>
+ <version>20070405</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>../jaxws/</classpathPrefix>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/build.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/build.xml new file mode 100644 index 0000000000..a8fe5faff0 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/build.xml @@ -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.
+-->
+
+<project name="scatours-util-launcher-common" default="compile">
+ <import file="../../antdefs.xml"/>
+</project>
diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/pom.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/pom.xml new file mode 100644 index 0000000000..afb66cc792 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/pom.xml @@ -0,0 +1,58 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours</artifactId> + <version>2.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>2.0-SNAPSHOT</version> + <artifactId>scatours-util-launcher-common</artifactId> + <name>Apache Tuscany SCA Tours Common Utility for Launchers</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java new file mode 100644 index 0000000000..02a32ecf04 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/launcher-common/src/main/java/scatours/launcher/LauncherUtil.java @@ -0,0 +1,86 @@ +/* + * 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 scatours.launcher; + +import java.io.File; + +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * This utility locates SCA contributions by name so that the launcher can work with various environments where + * contributions are stored differently. + */ +public class LauncherUtil { + + /** + * Locate an SCA contribution by name + * @param name The name of the SCA contribution archive + * @return The Contribution + */ + public static Contribution locate(String name) { + // Try to use the target/classes directory inside Eclipse/Maven + File file = new File("../../contributions/" + name + "/target/classes"); + if (!file.exists()) { + // Try to use the target/<contribution>.jar that is generated by maven build + file = new File("../../contributions/" + name + "/target/scatours-contribution-" + name + ".jar"); + if (!file.exists()) { + // Try to use the contribution jar under the contributions folder of the distribution + file = new File("../contributions/scatours-contribution-" + name + ".jar"); + if (!file.exists()) { + // Try to use the contribution subfolder under the contributions folder of the distribution + file = new File("../contributions/scatours-contribution-" + name); + if (!file.exists()) { + throw new IllegalArgumentException("Contribution " + name + " cannot be located."); + } + } + } + } + return new Contribution(name, file.toURI().toString()); + } + + /** + * Locate an SCA contribution by replacing the ${name} in the pattern + * @param urlPattern The url pattern that contains ${name} + * @param name The name of the contribution archive + * @return The Contribution + */ + public static Contribution locate(String urlPattern, String name) { + String url = urlPattern.replace("${name}", name); + return new Contribution(name, url); + } + + /** + * Create an SCA node from a list of contribution names + * @param composite + * @param contributionNames + * @return + */ + public static Node createNode(String composite, String... contributionNames) { + Contribution[] contributions = new Contribution[contributionNames.length]; + int index = 0; + for (String name : contributionNames) { + contributions[index++] = locate(name); + } + Node node = NodeFactory.getInstance().createNode(composite, contributions); + return node; + } +} diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/openejb-runtime/pom.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/openejb-runtime/pom.xml new file mode 100644 index 0000000000..c6b5a02097 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/openejb-runtime/pom.xml @@ -0,0 +1,179 @@ +<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <version>2.0-SNAPSHOT</version>
+ <artifactId>scatours-util-openejb-runtime</artifactId>
+ <name>Apache Tuscany SCA Tours OpenEJB Runtime Dependencies</name>
+
+ <profiles>
+ <profile>
+ <!-- The default profile produces a subset distribution which excludes
+ libraries that are present in the Tuscany SCA binary distro. -->
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-ejbd</artifactId>
+ <version>3.1.2</version>
+ <scope>runtime</scope>
+ <!-- exclude the following because they are part of the Tuscany SCA binary distro -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activeio-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-ra</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-connector</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.javamail</groupId>
+ <artifactId>geronimo-javamail_1.4_mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.objectweb.howl</groupId>
+ <artifactId>howl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>quartz</groupId>
+ <artifactId>quartz</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>serp</groupId>
+ <artifactId>serp</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.swizzle</groupId>
+ <artifactId>swizzle-stream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-naming</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <!-- Use mvn -Pselfcontained to produce a self-contained distribution
+ with all library dependencies included. -->
+ <id>selfcontained</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-ejbd</artifactId>
+ <version>3.1.2</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>../openejb/</classpathPrefix>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sca-java-2.x/contrib/tutorials/travelsample/util/pom.xml b/sca-java-2.x/contrib/tutorials/travelsample/util/pom.xml new file mode 100644 index 0000000000..6426cd5189 --- /dev/null +++ b/sca-java-2.x/contrib/tutorials/travelsample/util/pom.xml @@ -0,0 +1,47 @@ +<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <version>2.0-SNAPSHOT</version>
+ <artifactId>scatours-util</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Tours Utilities</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>jaxws-runtime</module>
+ <module>launcher-common</module>
+ <module>openejb-runtime</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
|