From 3caf8614f25d6b1962e20331fdf423c863bc02f3 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:13:31 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835144 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/helloworld/om/HelloWorldImpl.java | 45 ++++++++++++++++++++++ .../main/java/helloworld/om/HelloWorldServer.java | 28 ++++++++++++++ .../main/java/helloworld/om/HelloWorldService.java | 36 +++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java create mode 100644 sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java create mode 100644 sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java (limited to 'sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java') diff --git a/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java new file mode 100644 index 0000000000..6705ec5a4a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java @@ -0,0 +1,45 @@ +/* + * 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 helloworld.om; + + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public OMElement getGreetings(OMElement requestOM) { + String name = requestOM.getFirstElement().getText(); + + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); + OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); + responseOM.addChild(param); + param.addChild(omFactory.createOMText("Hello " + name)); + + return responseOM; + } + +} diff --git a/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java new file mode 100644 index 0000000000..d68a6a39ad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java @@ -0,0 +1,28 @@ +package helloworld.om; + + +import java.io.IOException; + +import org.apache.tuscany.api.SCARuntime; + +public class HelloWorldServer { + + /** + * @param args + */ + public static void main(String[] args) { + + SCARuntime.start("helloworldws-om.composite"); + + try { + System.out.println("HelloWorld server started"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + SCARuntime.stop(); + System.out.println("HelloWorld server stopped"); + } + +} diff --git a/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java new file mode 100644 index 0000000000..8c17d68a4d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java @@ -0,0 +1,36 @@ +/* + * 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 helloworld.om; + +import org.apache.axiom.om.OMElement; +import org.apache.tuscany.api.annotation.DataType; +import org.osoa.sca.annotations.Remotable; +import org.osoa.sca.annotations.Service; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@Service +@Remotable +@DataType(name="org.apache.axiom.om.OMElement") +public interface HelloWorldService { + + public OMElement getGreetings(OMElement name); + +} -- cgit v1.2.3