From be6f6fdf5f4d17e5eabacf6473031a212914cfcc Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 29 Jan 2010 19:03:27 +0000 Subject: Java SCA 1.6 RC2a Release Tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904591 13f79535-47bb-0310-9956-ffa450edef68 --- .../javaapi/conversation/callback/AService.java | 30 ++++++++ .../conversation/callback/AServiceCallback.java | 33 +++++++++ .../javaapi/conversation/callback/BService.java | 40 +++++++++++ .../conversation/callback/BServiceCallback.java | 33 +++++++++ .../javaapi/conversation/callback/CService.java | 39 +++++++++++ .../javaapi/conversation/callback/Utilities.java | 32 +++++++++ .../callback/accessing/AServiceCallback.java | 33 +++++++++ .../conversation/callback/accessing/BService.java | 41 +++++++++++ .../callback/accessing/impl/AServiceImpl.java | 67 ++++++++++++++++++ .../callback/accessing/impl/BServiceImpl.java | 60 ++++++++++++++++ .../callback/custom/AServiceCallback.java | 33 +++++++++ .../conversation/callback/custom/BService.java | 38 ++++++++++ .../callback/custom/CustomCallback.java | 35 ++++++++++ .../callback/custom/impl/AServiceImpl.java | 61 ++++++++++++++++ .../callback/custom/impl/BServiceImpl.java | 49 +++++++++++++ .../callback/custom/impl/CustomCallbackImpl.java | 38 ++++++++++ .../conversation/callback/id/AServiceCallback.java | 33 +++++++++ .../javaapi/conversation/callback/id/BService.java | 41 +++++++++++ .../callback/id/impl/AServiceImpl.java | 73 +++++++++++++++++++ .../callback/id/impl/BServiceImpl.java | 60 ++++++++++++++++ .../conversation/callback/impl/AServiceImpl.java | 61 ++++++++++++++++ .../conversation/callback/impl/BServiceImpl.java | 73 +++++++++++++++++++ .../conversation/callback/impl/CServiceImpl.java | 49 +++++++++++++ .../callback/local/AServiceCallback.java | 31 +++++++++ .../conversation/callback/local/BService.java | 37 ++++++++++ .../callback/local/BServiceCallback.java | 31 +++++++++ .../conversation/callback/local/CService.java | 37 ++++++++++ .../callback/local/impl/AServiceImpl.java | 61 ++++++++++++++++ .../callback/local/impl/BServiceImpl.java | 73 +++++++++++++++++++ .../callback/local/impl/CServiceImpl.java | 49 +++++++++++++ .../callback/multi/AServiceCallback.java | 33 +++++++++ .../callback/multi/AServiceCallback2.java | 33 +++++++++ .../conversation/callback/multi/BService.java | 39 +++++++++++ .../conversation/callback/multi/BService2.java | 39 +++++++++++ .../callback/multi/impl/AServiceImpl.java | 79 +++++++++++++++++++++ .../callback/multi/impl/BServiceImpl.java | 64 +++++++++++++++++ .../callback/stateless/BServiceCallback.java | 31 +++++++++ .../conversation/callback/stateless/CService.java | 39 +++++++++++ .../callback/stateless/impl/BServiceImpl.java | 73 +++++++++++++++++++ .../callback/stateless/impl/BServiceImpl2.java | 81 ++++++++++++++++++++++ .../callback/stateless/impl/BServiceImpl3.java | 74 ++++++++++++++++++++ .../callback/stateless/impl/CServiceImpl.java | 49 +++++++++++++ .../main/resources/callback-accessing.composite | 34 +++++++++ .../src/main/resources/callback-custom.composite | 40 +++++++++++ .../src/main/resources/callback-id.composite | 34 +++++++++ .../src/main/resources/callback-local.composite | 40 +++++++++++ .../src/main/resources/callback-multi.composite | 35 ++++++++++ .../callback-stateless-callbackfieldnull.composite | 40 +++++++++++ .../callback-stateless-callbackid.composite | 40 +++++++++++ .../main/resources/callback-stateless.composite | 41 +++++++++++ .../callback/src/main/resources/callback.composite | 40 +++++++++++ 51 files changed, 2349 insertions(+) create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite create mode 100644 sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback.composite (limited to 'sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main') diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java new file mode 100644 index 0000000000..e78736d4df --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java @@ -0,0 +1,30 @@ +/* + * 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.vtest.javaapi.conversation.callback; + +/** + * Simple Service + */ +public interface AService { + + public void testCallback(); + + public void testCallback2(); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java new file mode 100644 index 0000000000..0a90f9c99a --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java new file mode 100644 index 0000000000..0e61247294 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.javaapi.conversation.callback; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java new file mode 100644 index 0000000000..e317a6e7e0 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface BServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java new file mode 100644 index 0000000000..6446e006bd --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CService.java @@ -0,0 +1,39 @@ +/* + * 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.vtest.javaapi.conversation.callback; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(BServiceCallback.class) +public interface CService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.java new file mode 100644 index 0000000000..15672f9ee0 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/Utilities.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.vtest.javaapi.conversation.callback; + +public class Utilities { + + public static void delayQuarterSecond() { + try { + Thread.sleep(250);// millisecs + } catch (InterruptedException ex) { + throw new Error(ex); + } + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java new file mode 100644 index 0000000000..400c696d82 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/AServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback.accessing; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java new file mode 100644 index 0000000000..33421cb4d0 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/BService.java @@ -0,0 +1,41 @@ +/* + * 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.vtest.javaapi.conversation.callback.accessing; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + + public void testCallBack2(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java new file mode 100644 index 0000000000..1b220abf69 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/AServiceImpl.java @@ -0,0 +1,67 @@ +/* + * 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.vtest.javaapi.conversation.callback.accessing.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.BService; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService, AServiceCallback { + + @Reference + protected ServiceReference b; + + private String someState; + + public void callBack(String someState) { + System.out.println("A-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallback() { + b.getService().testCallBack("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + b.getService().testCallBack2("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java new file mode 100644 index 0000000000..957957a2e4 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/accessing/impl/BServiceImpl.java @@ -0,0 +1,60 @@ +/* + * 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.vtest.javaapi.conversation.callback.accessing.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.accessing.BService; +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService { + + String someState; + + @Callback + protected CallableReference callback; + + @Context + protected ComponentContext componentContext; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.getService().callBack(someState); + } + + public void testCallBack2(String someState) { + AServiceCallback callback = componentContext.getRequestContext().getCallback(); + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java new file mode 100644 index 0000000000..4ef741c1c1 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/AServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java new file mode 100644 index 0000000000..bba4bf2611 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/BService.java @@ -0,0 +1,38 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java new file mode 100644 index 0000000000..4fb4fa53de --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/CustomCallback.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +public interface CustomCallback { + + public void someMethod(); + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java new file mode 100644 index 0000000000..83453397b2 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/AServiceImpl.java @@ -0,0 +1,61 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.CustomCallback; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService { + + @Reference + protected ServiceReference b; + + @Reference + protected CustomCallback customCallback; + + protected static String someState; + + public void testCallback() { + b.setCallback(customCallback); + b.getService().testCallBack("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + Assert.fail("Should never get here"); + + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java new file mode 100644 index 0000000000..c165aa51da --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/BServiceImpl.java @@ -0,0 +1,49 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.BService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService { + + String someState; + + @Callback + protected AServiceCallback callback; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java new file mode 100644 index 0000000000..c0440a2b1b --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/custom/impl/CustomCallbackImpl.java @@ -0,0 +1,38 @@ +/* + * 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.vtest.javaapi.conversation.callback.custom.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.custom.CustomCallback; +import org.osoa.sca.annotations.Scope; + +@Scope("CONVERSATION") +public class CustomCallbackImpl implements CustomCallback, AServiceCallback { + + public void someMethod() { + System.out.println("Custom-callback some method called"); + } + + public void callBack(String someState) { + System.out.println("Custom-callback called with this state => " + someState); + AServiceImpl.someState = someState; + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java new file mode 100644 index 0000000000..8a237af0ad --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/AServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback.id; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java new file mode 100644 index 0000000000..9c185ddee3 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/BService.java @@ -0,0 +1,41 @@ +/* + * 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.vtest.javaapi.conversation.callback.id; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + + public void testCallBack2(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java new file mode 100644 index 0000000000..2e79d135f4 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/AServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.vtest.javaapi.conversation.callback.id.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.BService; +import org.junit.Assert; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService, AServiceCallback { + + @Reference + protected ServiceReference b; + + @Context + protected RequestContext requestContext; + + private String someState; + + public void callBack(String someState) { + System.out.println("A-callback called with this state => " + someState); + Assert.assertNotNull(requestContext.getServiceReference().getCallbackID()); + this.someState = someState; + } + + public void testCallback() { + b.getService().testCallBack("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + b.getService().testCallBack2("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java new file mode 100644 index 0000000000..fb0d6b8a50 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/id/impl/BServiceImpl.java @@ -0,0 +1,60 @@ +/* + * 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.vtest.javaapi.conversation.callback.id.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.id.BService; +import org.osoa.sca.CallableReference; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService { + + String someState; + + @Callback + protected CallableReference callback; + + @Context + protected ComponentContext componentContext; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.getService().callBack(someState); + } + + public void testCallBack2(String someState) { + AServiceCallback callback = componentContext.getRequestContext().getCallback(); + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java new file mode 100644 index 0000000000..1ace5858b2 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java @@ -0,0 +1,61 @@ +/* + * 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.vtest.javaapi.conversation.callback.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService, AServiceCallback { + + @Reference + protected ServiceReference b; + + private String someState; + + public void callBack(String someState) { + System.out.println("A-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallback() { + b.getService().testCallBack("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + Assert.fail("Should not be called"); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java new file mode 100644 index 0000000000..52d8fe5a7e --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.vtest.javaapi.conversation.callback.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService, BServiceCallback { + + String someState; + + @Callback + protected AServiceCallback callback; + + @Reference + protected ServiceReference c; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void callBack(String someState) { + System.out.println("B-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallBack(String someState) { + + c.getService().testCallBack(someState); + int count = 4; + while (this.someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (this.someState == null) + Assert.fail("Callback not received by this instance"); + + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java new file mode 100644 index 0000000000..eea769b2fb --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/CServiceImpl.java @@ -0,0 +1,49 @@ +/* + * 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.vtest.javaapi.conversation.callback.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +@Scope("CONVERSATION") +public class CServiceImpl implements CService { + + String someState; + + @Callback + protected BServiceCallback callback; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java new file mode 100644 index 0000000000..1caa467348 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java @@ -0,0 +1,31 @@ +/* + * 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.vtest.javaapi.conversation.callback.local; + +import org.osoa.sca.annotations.Conversational; + +/** + * + */ +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java new file mode 100644 index 0000000000..a7f471aa26 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.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.vtest.javaapi.conversation.callback.local; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; + +/** + * Simple Local Service + */ +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java new file mode 100644 index 0000000000..4aeeca6dc3 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BServiceCallback.java @@ -0,0 +1,31 @@ +/* + * 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.vtest.javaapi.conversation.callback.local; + +import org.osoa.sca.annotations.Conversational; + +/** + * Simple Service + */ +@Conversational +public interface BServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.java new file mode 100644 index 0000000000..014f1edd33 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/CService.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.vtest.javaapi.conversation.callback.local; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; + +/** + * Simple Service + */ +@Conversational +@Callback(BServiceCallback.class) +public interface CService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java new file mode 100644 index 0000000000..4e6dce6fb9 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java @@ -0,0 +1,61 @@ +/* + * 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.vtest.javaapi.conversation.callback.local.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BService; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService, AServiceCallback { + + @Reference + protected ServiceReference b; + + private String someState; + + public void callBack(String someState) { + System.out.println("A-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallback() { + b.getService().testCallBack("Some local string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + Assert.fail("Not implemented"); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java new file mode 100644 index 0000000000..2f560fe87b --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.vtest.javaapi.conversation.callback.local.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.CService; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService, BServiceCallback { + + String someState; + + @Callback + protected AServiceCallback callback; + + @Reference + protected ServiceReference c; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void callBack(String someState) { + System.out.println("B-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallBack(String someState) { + + c.getService().testCallBack(someState); + int count = 4; + while (this.someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (this.someState == null) + Assert.fail("Callback not received by this instance"); + + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java new file mode 100644 index 0000000000..23e0d0e70b --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/CServiceImpl.java @@ -0,0 +1,49 @@ +/* + * 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.vtest.javaapi.conversation.callback.local.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.CService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +@Scope("CONVERSATION") +public class CServiceImpl implements CService { + + String someState; + + @Callback + protected BServiceCallback callback; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java new file mode 100644 index 0000000000..16b2932afc --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java new file mode 100644 index 0000000000..56b7006581 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/AServiceCallback2.java @@ -0,0 +1,33 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi; + +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Remotable Service + */ +@Remotable +@Conversational +public interface AServiceCallback2 { + + public void callBack2(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java new file mode 100644 index 0000000000..580cf5a612 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService.java @@ -0,0 +1,39 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback.class) +public interface BService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java new file mode 100644 index 0000000000..144492984a --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/BService2.java @@ -0,0 +1,39 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(AServiceCallback2.class) +public interface BService2 { + + public void setState(String someState); + + public String getState(); + + public void testCallBack2(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java new file mode 100644 index 0000000000..ce7214dba1 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/AServiceImpl.java @@ -0,0 +1,79 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback2; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService2; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(AService.class) +@Scope("CONVERSATION") +public class AServiceImpl implements AService, AServiceCallback , AServiceCallback2 { + + @Reference + protected ServiceReference b; + + @Reference + protected ServiceReference b2; + + + private String someState; + private String someState2; + + public void callBack(String someState) { + System.out.println("A-callback called with this state => " + someState); + this.someState = someState; + } + + public void callBack2(String someState) { + System.out.println("A-callback2 called with this state => " + someState); + this.someState2 = someState; + } + + public void testCallback() { + b.getService().testCallBack("Some string"); + int count = 4; + while (someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState == null) + Assert.fail("Callback not received by this instance"); + } + + public void testCallback2() { + b2.getService().testCallBack2("Some string"); + int count = 4; + while (someState2 == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (someState2 == null) + Assert.fail("Callback not received by this instance"); + } +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java new file mode 100644 index 0000000000..b61a15cbee --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/multi/impl/BServiceImpl.java @@ -0,0 +1,64 @@ +/* + * 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.vtest.javaapi.conversation.callback.multi.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.AServiceCallback2; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.multi.BService2; +import org.junit.Assert; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(interfaces= {BService.class,BService2.class}) +@Scope("CONVERSATION") +public class BServiceImpl implements BService, BService2 { + + String someState; + + @Callback + protected AServiceCallback callback; + + @Callback + protected AServiceCallback2 callback2; + + @Callback + protected AServiceCallback2 callback3; + + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.callBack(someState); + } + + public void testCallBack2(String someState) { + Assert.assertNotNull(callback3); //Spec lines 670,671 + callback2.callBack2(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java new file mode 100644 index 0000000000..cb9aee2b9f --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/BServiceCallback.java @@ -0,0 +1,31 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +public interface BServiceCallback { + + public void callBack(String someState); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java new file mode 100644 index 0000000000..1fe70344af --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/CService.java @@ -0,0 +1,39 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Conversational; +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service + */ +@Remotable +@Conversational +@Callback(BServiceCallback.class) +public interface CService { + + public void setState(String someState); + + public String getState(); + + public void testCallBack(String string); + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java new file mode 100644 index 0000000000..033fa9d097 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl implements BService, BServiceCallback { + + String someState; + + @Callback + protected AServiceCallback callback; + + @Reference + protected ServiceReference c; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void callBack(String someState) { + System.out.println("B-callback called with this state => " + someState); + this.someState = someState; + } + + public void testCallBack(String someState) { + + c.getService().testCallBack(someState); + int count = 4; + while (this.someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (this.someState != null) + Assert.fail("Callback should NOT have been received by this instance"); + + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java new file mode 100644 index 0000000000..5f7d8d9c94 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl2.java @@ -0,0 +1,81 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.junit.Assert; +import org.osoa.sca.RequestContext; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Context; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl2 implements BService, BServiceCallback { + + String someState; + + @Context + protected RequestContext rc; + + @Callback + protected AServiceCallback callback; + + @Reference + protected ServiceReference c; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void callBack(String someState) { + System.out.println("B-callback called with this state => " + someState); + this.someState = someState; + Assert.assertSame("1234", rc.getServiceReference().getCallbackID()); + } + + public void testCallBack(String someState) { + + c.setCallbackID("1234"); + + c.getService().testCallBack(someState); + int count = 4; + while (this.someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (this.someState != null) + Assert.fail("Callback should NOT have been received by this instance"); + + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java new file mode 100644 index 0000000000..47d5d53821 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/BServiceImpl3.java @@ -0,0 +1,74 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.CService; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.Utilities; +import org.junit.Assert; +import org.osoa.sca.ServiceReference; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +@Scope("CONVERSATION") +public class BServiceImpl3 implements BService, BServiceCallback { + + String someState; + + @Callback + protected AServiceCallback callback; + + @Reference + protected ServiceReference c; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void callBack(String someState) { + System.out.println("B-callback called with this state => " + someState); + this.someState = someState; + Assert.assertSame(null, callback); + } + + public void testCallBack(String someState) { + + c.getService().testCallBack(someState); + int count = 4; + while (this.someState == null && count > 0) { + Utilities.delayQuarterSecond(); + count--; + } + if (this.someState != null) + Assert.fail("Callback should NOT have been received by this instance"); + + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java new file mode 100644 index 0000000000..18ce5edebe --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/CServiceImpl.java @@ -0,0 +1,49 @@ +/* + * 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.vtest.javaapi.conversation.callback.stateless.impl; + +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.BServiceCallback; +import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.CService; +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +@Scope("CONVERSATION") +public class CServiceImpl implements CService { + + String someState; + + @Callback + protected BServiceCallback callback; + + public void setState(String someState) { + this.someState = someState; + } + + public String getState() { + return someState; + } + + public void testCallBack(String someState) { + callback.callBack(someState); + } + +} diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite new file mode 100644 index 0000000000..802c9c30db --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-accessing.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite new file mode 100644 index 0000000000..e66ea5d537 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-custom.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite new file mode 100644 index 0000000000..4d93d2279d --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-id.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite new file mode 100644 index 0000000000..cd8c589a59 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite new file mode 100644 index 0000000000..6c69330ce5 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-multi.composite @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite new file mode 100644 index 0000000000..72c08e8344 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackfieldnull.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite new file mode 100644 index 0000000000..144f7f3d00 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite new file mode 100644 index 0000000000..ace06b245c --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback.composite b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback.composite new file mode 100644 index 0000000000..4623f17ca2 --- /dev/null +++ b/sca-java-1.x/tags/1.6-RC2a/vtest/java-api/conversation/callback/src/main/resources/callback.composite @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3