From bbc9015e8fd499cbb022f232e94c132bb3b295ab Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 10 Dec 2009 09:44:30 +0000 Subject: 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 --- .../tomcat/testing/download-tomcat/pom.xml | 23 ++++++++++- .../testing/helloworld-scaclient-javase/pom.xml | 45 ++++++++++++++++++++++ .../src/main/java/testing/HelloworldClient.java | 43 +++++++++++++++++++++ .../src/main/java/testing/HelloworldService.java | 28 ++++++++++++++ 4 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml create mode 100644 sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java create mode 100644 sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java (limited to 'sca-java-2.x/trunk') 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 @@ download-tomcat - pom + war Apache Tuscany SCA Tomcat Integration Testing Download Tomcat @@ -35,7 +35,16 @@ + + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.0-beta-1 + + org.codehaus.mojo wagon-maven-plugin @@ -58,4 +67,16 @@ + + + + + + download/apache-tomcat-6.0.18.zip + + + + + + 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 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-SNAPSHOT + ../pom.xml + + + helloworld-scaclient-javase + Apache Tuscany SCA Tomcat Integration Testing Helloworld Java SE SCAClient + + + + org.apache.tuscany.sca + tuscany-base + 2.0-SNAPSHOT + provided + + + + + + ${artifactId} + + 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); + +} -- cgit v1.2.3