From 36436b71b9977d6b5940cb6285d5335708ef9bfa Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:55:20 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882851 13f79535-47bb-0310-9956-ffa450edef68 --- .../helloworldwsclient/HelloWorldClient.java | 51 +++++++ .../helloworldwsclient/HelloWorldService.java | 26 ++++ .../HelloWorldServiceComponentImpl.java | 43 ++++++ .../src/main/resources/axis2.xml | 167 +++++++++++++++++++++ .../src/main/resources/sca.module | 40 +++++ .../src/main/resources/wsdl/helloworld.wsdl | 103 +++++++++++++ 6 files changed, 430 insertions(+) create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module create mode 100644 sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl (limited to 'sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src') diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java new file mode 100644 index 0000000000..beece1cae4 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java @@ -0,0 +1,51 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.helloworldwsclient; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +import org.apache.tuscany.core.client.TuscanyRuntime; + +/** + * This client program shows how to create an SCA runtime, start it, locate a simple HelloWorld service component + * and invoke it. + */ +public class HelloWorldClient { + + public static final void main(String[] args) throws Exception { + + // Obtain Tuscany runtime + TuscanyRuntime tuscany = new TuscanyRuntime("hello", null); + + // Start the runtime + tuscany.start(); + + // Obtain SCA module context. + ModuleContext moduleContext = CurrentModuleContext.getContext(); + + // Locate the HelloWorld service component and invoke it + HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); + + String value = helloworldService.getGreetings("World"); + + System.out.println(value); + + // Stop the runtime + tuscany.stop(); + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java new file mode 100644 index 0000000000..00e0af3a9d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldService.java @@ -0,0 +1,26 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.helloworldwsclient; + +/** + * This is the business interface of the HelloWorld service component. + */ +public interface HelloWorldService { + + public String getGreetings(String name); + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java new file mode 100644 index 0000000000..62702b50bb --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldServiceComponentImpl.java @@ -0,0 +1,43 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.helloworldwsclient; + +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; +import org.osoa.sca.annotations.Reference; + +/** + * This class implements the HelloWorld service component. + */ +@Service(HelloWorldService.class) +//FIXME workaround for JIRA TUSCANY-41 +@Scope("MODULE") +public class HelloWorldServiceComponentImpl implements HelloWorldService { + + @Reference + public HelloWorldService hellowWorldService = null; // Injected by the SCA container. + + /** + * @see org.apache.tuscany.samples.helloworldwsclient.HelloWorldService#getGreetings(java.lang.String) + */ + public String getGreetings(final String name) { + assert null != hellowWorldService : "helloWorldService was not set by the SCA runtime!"; + + return hellowWorldService.getGreetings(name); + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml new file mode 100644 index 0000000000..a38cf9864a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/axis2.xml @@ -0,0 +1,167 @@ + + + + + false + false + false + + + + + admin + axis2 + + . + + 127.0.0.1 + 5555 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6060 + + + + + + + + + + + + + + + + + HTTP/1.1 + chunked + + + HTTP/1.1 + chunked + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module new file mode 100644 index 0000000000..9642b2157d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/sca.module @@ -0,0 +1,40 @@ + + + + + + + + HelloWorldService + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl new file mode 100644 index 0000000000..75b732e3a5 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/helloworld/helloworldwsclient/src/main/resources/wsdl/helloworld.wsdl @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3