Author: kwilliams
Date: Sat May 3 10:51:40 2008
New Revision: 653101
URL: http://svn.apache.org/viewvc?rev=653101&view=rev
Log:
Tests for conversation callback, TUSCANY-2247
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
(with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
(with props)
Modified:
incubator/tuscany/java/sca/vtest/java-api/conversation/pom.xml
Added: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml?rev=653101&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
(added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml Sat
May 3 10:51:40 2008
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>java-api-annotations</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>vtest-java-api-conversation-callback</artifactId>
+ <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests -
Conversation - Callback</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
Sat May 3 10:51:40 2008
@@ -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;
+
+import org.osoa.sca.annotations.Conversational;
+
+/**
+ *
+ */
[EMAIL PROTECTED]
+public interface ALocalServiceCallback {
+
+ public void callBack(String someState);
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
Sat May 3 10:51:40 2008
@@ -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;
+
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+public interface AService {
+
+ public void testAnnotation();
+
+ public void testCallback();
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
Sat May 3 10:51:40 2008
@@ -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
+ */
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+public interface AServiceCallback {
+
+ public void callBack(String someState);
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AServiceCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
Sat May 3 10:51:40 2008
@@ -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;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Conversational;
+
+/**
+ * Simple Local Service
+ */
[EMAIL PROTECTED]
[EMAIL PROTECTED](ALocalServiceCallback.class)
+public interface BLocalService {
+
+ public void setState(String someState);
+
+ public String getState();
+
+ public void testCallBack(String string);
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
Sat May 3 10:51:40 2008
@@ -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
+ */
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED](AServiceCallback.class)
+public interface BService {
+
+ public void setState(String someState);
+
+ public String getState();
+
+ public void testCallBack(String string);
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
Sat May 3 10:51:40 2008
@@ -0,0 +1,69 @@
+/*
+ * 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.ALocalServiceCallback;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.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;
+
[EMAIL PROTECTED](AService.class)
[EMAIL PROTECTED]("CONVERSATION")
+public class ALocalServiceImpl implements AService, ALocalServiceCallback {
+
+ @Reference
+ protected ServiceReference<BService> b;
+
+ private String someState;
+
+ public void testAnnotation() {
+ b.getService();
+ }
+
+ 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) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState == null)
+ Assert.fail("Callback not called");
+ }
+
+ // Utilities
+ private void delayQuarterSecond() {
+ try {
+ Thread.sleep(250);// millisecs
+ } catch (InterruptedException ex) {
+ throw new Error(ex);
+ }
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
Sat May 3 10:51:40 2008
@@ -0,0 +1,69 @@
+/*
+ * 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.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;
+
[EMAIL PROTECTED](AService.class)
[EMAIL PROTECTED]("CONVERSATION")
+public class AServiceImpl implements AService, AServiceCallback {
+
+ @Reference
+ protected ServiceReference<BService> b;
+
+ private String someState;
+
+ public void testAnnotation() {
+ b.getService();
+ }
+
+ 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 remote string");
+ int count = 4;
+ while (someState == null && count > 0) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState == null)
+ Assert.fail("Callback not called");
+ }
+
+ // Utilities
+ private void delayQuarterSecond() {
+ try {
+ Thread.sleep(250);// millisecs
+ } catch (InterruptedException ex) {
+ throw new Error(ex);
+ }
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
Sat May 3 10:51:40 2008
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl;
+
+import
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AServiceCallback;
+import
org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BLocalService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](BService.class)
[EMAIL PROTECTED]("CONVERSATION")
+public class BLocalServiceImpl implements BLocalService {
+
+ 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);
+ }
+
+
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
Sat May 3 10:51:40 2008
@@ -0,0 +1,51 @@
+/*
+ * 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.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](BService.class)
[EMAIL PROTECTED]("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);
+ }
+
+
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
Sat May 3 10:51:40 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://java-api-tests"
name="Converstion-Callback-local">
+
+ <component name="ALocalComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.ALocalServiceImpl"
/>
+ <reference name="b" target="BLocalComponent" />
+ </component>
+
+ <component name="BLocalComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BLocalServiceImpl"
/>
+ </component>
+
+</composite>
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
Sat May 3 10:51:40 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://java-api-tests"
name="Converstion-callback-remote">
+
+ <component name="AComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl"
/>
+ <reference name="b" target="BLocalComponent" />
+ </component>
+
+ <component name="BLocalComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BLocalServiceImpl"
/>
+ </component>
+
+</composite>
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
Sat May 3 10:51:40 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://java-api-tests"
name="Converstion-callback-remote">
+
+ <component name="AComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl"
/>
+ <reference name="b" target="BComponent" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java
+
class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BServiceImpl"
/>
+ </component>
+
+</composite>
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java?rev=653101&view=auto
==============================================================================
---
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
(added)
+++
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
Sat May 3 10:51:40 2008
@@ -0,0 +1,196 @@
+/*
+ * 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.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osoa.sca.ServiceRuntimeException;
+
+/**
+ *
+ */
+public class CallbackTestCase {
+
+ protected static SCADomain domain;
+ protected static String compositeName = "callback-remote.composite";
+ protected static AService aService = null;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ System.out.println("Setting up");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+
+ System.out.println("Cleaning up");
+ if (domain != null)
+ domain.close();
+
+ }
+
+ /**
+ * Lines 529-610
+ * <p>
+ * A callback service is a service that is used for asynchronous
+ * communication from a service provider back to its client in contrast to
+ * the communication through return values from synchronous operations.
+ * Callbacks are used by bidirectional services, which are services that
+ * have two interfaces: an interface for the provided service a
callback
+ * interface that must be provided by the client
+ * <p>
+ * Callbacks may be used for both remotable and local services. Either both
+ * interfaces of a bidirectional service must be remotable, or both must be
+ * local. It is illegal to mix the two. There are two basic forms of
+ * callbacks: stateless callbacks and stateful callbacks. A callback
+ * interface is declared by using the "@Callback" annotation on a remotable
+ * service interface, which takes the Java Class object of the interface as
+ * a parameter. The annotation may also be applied to a method or to a
field
+ * of an implementation, which is used in order to have a callback
injected,
+ * as explained in the next section.
+ * <p>
+ * 1.6.7.1. Stateful Callbacks A stateful callback represents a specific
+ * implementation instance of the component that is the client of the
+ * service. The interface of a stateful callback should be marked as
+ * conversational. The following example interfaces define an interaction
+ * over stateful callback.
+ * <p>
+ * An implementation of the service in this example could use the
+ * "@Callback" annotation to request that a stateful callback be injected.
+ * The following is a fragment of an implementation of the example service.
+ * In this example, the request is passed on to some other component, so
+ * that the example service acts essentially as an intermediary. Because
the
+ * service is conversation scoped, the callback will still be available
when
+ * the backend service sends back its asynchronous response.
+ * <p>
+ * This fragment must come from an implementation that offers two services,
+ * one that it offers to it clients (MyService) and one that is used for
+ * receiving callbacks from the back end (MyServiceCallback). The client of
+ * this service would also implement the methods defined in
+ * MyServiceCallback.
+ * <p>
+ * Stateful callbacks support some of the same use cases as are supported
by
+ * the ability to pass service references as parameters. The primary
+ * difference is that stateful callbacks do not require any additional
+ * parameters be passed with service operations. This can be a great
+ * convenience. If the service has many operations and any of those
+ * operations could be the first operation of the conversation, it would be
+ * unwieldy to have to take a callback parameter as part of every
operation,
+ * just in case it is the first operation of the conversation. It is also
+ * more natural than requiring the application developers to invoke an
+ * explicit operation whose only purpose is to pass the callback object
that
+ * should be used.
+ * <p>
+ * This tests the *remote* bidirectional interfaces option
+ */
+ @Test
+ public void statefulCallback() throws Exception {
+ System.out.println("Setting up for remote callback tests");
+ domain = SCADomain.newInstance("callback-remote.composite");
+ aService = domain.getService(AService.class, "AComponent");
+ aService.testCallback();
+ }
+
+ /**
+ * Lines 529-610
+ * <p>
+ * A callback service is a service that is used for asynchronous
+ * communication from a service provider back to its client in contrast to
+ * the communication through return values from synchronous operations.
+ * Callbacks are used by bidirectional services, which are services that
+ * have two interfaces: an interface for the provided service a
callback
+ * interface that must be provided by the client
+ * <p>
+ * Callbacks may be used for both remotable and local services. Either both
+ * interfaces of a bidirectional service must be remotable, or both must be
+ * local. It is illegal to mix the two. There are two basic forms of
+ * callbacks: stateless callbacks and stateful callbacks. A callback
+ * interface is declared by using the "@Callback" annotation on a remotable
+ * service interface, which takes the Java Class object of the interface as
+ * a parameter. The annotation may also be applied to a method or to a
field
+ * of an implementation, which is used in order to have a callback
injected,
+ * as explained in the next section.
+ * <p>
+ * 1.6.7.1. Stateful Callbacks A stateful callback represents a specific
+ * implementation instance of the component that is the client of the
+ * service. The interface of a stateful callback should be marked as
+ * conversational. The following example interfaces define an interaction
+ * over stateful callback.
+ * <p>
+ * An implementation of the service in this example could use the
+ * "@Callback" annotation to request that a stateful callback be injected.
+ * The following is a fragment of an implementation of the example service.
+ * In this example, the request is passed on to some other component, so
+ * that the example service acts essentially as an intermediary. Because
the
+ * service is conversation scoped, the callback will still be available
when
+ * the backend service sends back its asynchronous response.
+ * <p>
+ * This fragment must come from an implementation that offers two services,
+ * one that it offers to it clients (MyService) and one that is used for
+ * receiving callbacks from the back end (MyServiceCallback). The client of
+ * this service would also implement the methods defined in
+ * MyServiceCallback.
+ * <p>
+ * Stateful callbacks support some of the same use cases as are supported
by
+ * the ability to pass service references as parameters. The primary
+ * difference is that stateful callbacks do not require any additional
+ * parameters be passed with service operations. This can be a great
+ * convenience. If the service has many operations and any of those
+ * operations could be the first operation of the conversation, it would be
+ * unwieldy to have to take a callback parameter as part of every
operation,
+ * just in case it is the first operation of the conversation. It is also
+ * more natural than requiring the application developers to invoke an
+ * explicit operation whose only purpose is to pass the callback object
that
+ * should be used.
+ * <p>
+ * This tests the *local* bidirectional interfaces option
+ */
+ @Test
+ public void statefulCallback2() throws Exception {
+ System.out.println("Setting up for local callback tests");
+ domain = SCADomain.newInstance("callback-local.composite");
+ aService = domain.getService(AService.class, "ALocalComponent");
+ aService.testCallback();
+ }
+
+ /**
+ * Lines 534, 535
+ * <p>
+ * Callbacks may be used for both remotable and local services. Either both
+ * interfaces of a bidirectional service must be remotable, or both must be
+ * local. It is illegal to mix the two.
+ */
+ @Test(expected=ServiceRuntimeException.class)
+ @Ignore("TUSCANY-2291")
+ public void statefulCallback3() throws Exception {
+ System.out.println("Setting up for mixed local/remote callback tests");
+ domain = SCADomain.newInstance("callback-mixed.composite");
+ aService = domain.getService(AService.class, "AComponent");
+ aService.testCallback();
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/vtest/java-api/conversation/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/pom.xml?rev=653101&r1=653100&r2=653101&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/pom.xml Sat May 3
10:51:40 2008
@@ -56,6 +56,7 @@
<module>parameters</module>
<module>lifetime</module>
<module>id</module>
+ <module>callback</module>
</modules>
</profile>
</profiles>