From a40e527938d76ba71f211da7e327adb50384ba69 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:26:33 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835157 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/itest/oneway/OneWayClient.java | 32 +++++++++++++ .../tuscany/sca/itest/oneway/OneWayService.java | 37 +++++++++++++++ .../sca/itest/oneway/impl/OneWayClientImpl.java | 52 ++++++++++++++++++++++ .../sca/itest/oneway/impl/OneWayServer.java | 46 +++++++++++++++++++ .../sca/itest/oneway/impl/OneWayServiceImpl.java | 45 +++++++++++++++++++ .../oneway/src/main/resources/oneWay.composite | 39 ++++++++++++++++ .../src/main/resources/oneWayClient.composite | 31 +++++++++++++ 7 files changed, 282 insertions(+) create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServer.java create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWay.composite create mode 100644 sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWayClient.composite (limited to 'sca-java-1.x/tags/1.0.1/itest/oneway/src/main') diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java new file mode 100644 index 0000000000..afa008bd3e --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java @@ -0,0 +1,32 @@ +/* + * 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 org.apache.tuscany.sca.itest.oneway; + + +/** + * The client for the oneway itest + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + + +public interface OneWayClient { + + public int doSomething(int count); +} diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java new file mode 100644 index 0000000000..b389927403 --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java @@ -0,0 +1,37 @@ +/* + * 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 org.apache.tuscany.sca.itest.oneway; + + +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + + +/** + * The service interface used when testing oneway interactions + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ +@Remotable +public interface OneWayService { + + @OneWay + public void doSomething(int count); + +} diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java new file mode 100644 index 0000000000..b3896a1732 --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java @@ -0,0 +1,52 @@ +/* + * 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 org.apache.tuscany.sca.itest.oneway.impl; + +import org.apache.tuscany.sca.itest.oneway.OneWayClient; +import org.apache.tuscany.sca.itest.oneway.OneWayService; +import org.osoa.sca.annotations.Reference; + + +/** + * The client for the oneway itest + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + + +public class OneWayClientImpl implements OneWayClient { + + @Reference + protected OneWayService oneWayService; + + + public int doSomething(int count){ + + int start = count * 10; + int end = start + 100; + + for (int loopCount = start; loopCount < end; loopCount++){ + System.out.println("Client: doSomething " + loopCount); + System.out.flush(); + oneWayService.doSomething(loopCount); + } + + return count; + } +} diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServer.java b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServer.java new file mode 100644 index 0000000000..405fa5c3fd --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServer.java @@ -0,0 +1,46 @@ +/* + * 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 org.apache.tuscany.sca.itest.oneway.impl; + +import java.io.IOException; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +/** + * This server program shows how to create an SCA runtime, and start it which + * activates the oneway Web service endpoint. + */ +public class OneWayServer { + + public static void main(String[] args) { + + SCADomain scaDomain = SCADomain.newInstance("oneWay.composite"); + + try { + System.out.println("OneWay server started (press enter to shutdown)"); + System.in.read(); + } catch (IOException e) { + e.printStackTrace(); + } + + scaDomain.close(); + System.out.println("OneWay server stopped"); + } + +} diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java new file mode 100644 index 0000000000..c78874bbf6 --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.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 org.apache.tuscany.sca.itest.oneway.impl; + +import org.apache.tuscany.sca.itest.oneway.OneWayService; + +/** + * The service for the oneway itest + * + * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ + */ + + +public class OneWayServiceImpl implements OneWayService { + + public static int callCount = 0; + + public void doSomething(int count){ + + synchronized(this){ + callCount++; + } + + System.out.println("Service: doSomething " + count + " callCount = " + callCount); + System.out.flush(); + + + } +} diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWay.composite b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWay.composite new file mode 100644 index 0000000000..4193c43a63 --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWay.composite @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWayClient.composite b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWayClient.composite new file mode 100644 index 0000000000..ecc8cc7b3a --- /dev/null +++ b/sca-java-1.x/tags/1.0.1/itest/oneway/src/main/resources/oneWayClient.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + + -- cgit v1.2.3