summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-12-10 09:44:30 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-12-10 09:44:30 +0000
commitbbc9015e8fd499cbb022f232e94c132bb3b295ab (patch)
treec0c72b461cb50f0fd7940bfc39c58c12f477874f /sca-java-2.x/trunk
parent31524306788227052639c12d68780db54cb84a27 (diff)
Add a Java SE client that uses the SCAClient API to talk to the Helloworld service thats running on a Node somewhere else, connecting with tribes. (does work but not yet terribly well)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@889162 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/download-tomcat/pom.xml23
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml45
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java43
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java28
4 files changed, 138 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/download-tomcat/pom.xml b/sca-java-2.x/trunk/distribution/tomcat/testing/download-tomcat/pom.xml
index 2221622a97..68bb686ae3 100644
--- a/sca-java-2.x/trunk/distribution/tomcat/testing/download-tomcat/pom.xml
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/download-tomcat/pom.xml
@@ -27,7 +27,7 @@
</parent>
<artifactId>download-tomcat</artifactId>
- <packaging>pom</packaging>
+ <packaging>war</packaging>
<name>Apache Tuscany SCA Tomcat Integration Testing Download Tomcat</name>
<properties>
@@ -35,7 +35,16 @@
</properties>
<build>
+
+
<plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
@@ -58,4 +67,16 @@
</plugins>
</build>
+
+<profiles>
+ <profile>
+ <activation>
+ <file>
+ <exists>download/apache-tomcat-6.0.18.zip</exists>
+ </file>
+ </activation>
+ </profile>
+</profiles>
+
+
</project>
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml
new file mode 100644
index 0000000000..3e64278dbb
--- /dev/null
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml
@@ -0,0 +1,45 @@
+<?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>tuscany-distribution-tomcat-testing</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>helloworld-scaclient-javase</artifactId>
+ <name>Apache Tuscany SCA Tomcat Integration Testing Helloworld Java SE SCAClient</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java
new file mode 100644
index 0000000000..1a874909f3
--- /dev/null
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java
@@ -0,0 +1,43 @@
+/*
+ * 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 testing;
+
+import java.net.URI;
+
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+
+public class HelloworldClient {
+
+ public static void main(String[] args) throws NoSuchDomainException, NoSuchServiceException {
+
+ URI domainURI ;
+ if (args.length > 0) {
+ domainURI = URI.create(args[0]);
+ } else {
+ domainURI = URI.create("tribes:default");
+ }
+
+ SCAClientFactory factory = SCAClientFactory.newInstance(domainURI);
+ HelloworldService service = factory.getService(HelloworldService.class, "HelloworldComponent");
+ System.out.println(service.sayHello("world"));
+ }
+}
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java
new file mode 100644
index 0000000000..b035a772be
--- /dev/null
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java
@@ -0,0 +1,28 @@
+/*
+ * 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 testing;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}