You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2008/05/07 20:48:50 UTC
svn commit: r654209 - in
/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src:
main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/
main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/
main/java/or...
Author: kwilliams
Date: Wed May 7 11:48:48 2008
New Revision: 654209
URL: http://svn.apache.org/viewvc?rev=654209&view=rev
Log:
More callback testing, TUSCANY-2247
Added:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/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/local/impl/BServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/AServiceCallback.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/BService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/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/mixed/impl/BServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/AServiceCallback.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/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/stateless/impl/AServiceImpl2.java (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite (with props)
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite (with props)
Removed:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/ALocalServiceCallback.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BLocalService.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/ALocalServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BLocalServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-remote.composite
Modified:
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite
incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/AService.java Wed May 7 11:48:48 2008
@@ -18,18 +18,12 @@
*/
package org.apache.tuscany.sca.vtest.javaapi.conversation.callback;
-import org.osoa.sca.annotations.Conversational;
-import org.osoa.sca.annotations.Remotable;
/**
- * Simple Remotable Service
+ * Simple Service
*/
-@Remotable
-@Conversational
public interface AService {
- public void testAnnotation();
-
public void testCallback();
}
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/BService.java Wed May 7 11:48:48 2008
@@ -37,4 +37,6 @@
public void testCallBack(String string);
+ public boolean isCallBackNull();
+
}
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/AServiceImpl.java Wed May 7 11:48:48 2008
@@ -37,24 +37,20 @@
private String someState;
- public void testAnnotation() {
- b.getService();
- }
-
public void callBack(String someState) {
- System.out.println("A callback called with this state => " + someState);
+ System.out.println("A-callback called with this state => " + someState);
this.someState = someState;
}
public void testCallback() {
- b.getService().testCallBack("Some remote string");
+ b.getService().testCallBack("Some string");
int count = 4;
while (someState == null && count > 0) {
delayQuarterSecond();
count--;
}
if (someState == null)
- Assert.fail("Callback not called");
+ Assert.fail("Callback not received by this instance");
}
// Utilities
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/impl/BServiceImpl.java Wed May 7 11:48:48 2008
@@ -45,6 +45,10 @@
public void testCallBack(String someState) {
callback.callBack(someState);
}
+
+ public boolean isCallBackNull() {
+ return (callback == null) ;
+ }
Added: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/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/local/AServiceCallback.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/AServiceCallback.java Wed May 7 11:48:48 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.local;
+
+import org.osoa.sca.annotations.Conversational;
+
+/**
+ *
+ */
+@Conversational
+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/local/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/local/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/local/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/local/BService.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/BService.java Wed May 7 11:48:48 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.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);
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/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/local/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/local/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/local/impl/AServiceImpl.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/AServiceImpl.java Wed May 7 11:48:48 2008
@@ -0,0 +1,65 @@
+/*
+ * 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.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<BService> 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) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState == null)
+ Assert.fail("Callback not received by this instance");
+ }
+
+ // 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/local/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/local/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/local/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/local/impl/BServiceImpl.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/impl/BServiceImpl.java Wed May 7 11:48:48 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.local.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.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);
+ }
+
+
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/local/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/local/impl/BServiceImpl.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/mixed/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/mixed/AServiceCallback.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/AServiceCallback.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/AServiceCallback.java Wed May 7 11:48:48 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.mixed;
+
+import org.osoa.sca.annotations.Conversational;
+
+/**
+ *
+ */
+@Conversational
+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/mixed/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/mixed/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/mixed/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/mixed/BService.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/BService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/BService.java Wed May 7 11:48:48 2008
@@ -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.mixed;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Local Service
+ */
+@Remotable
+@Conversational
+@Callback(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/mixed/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/mixed/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/mixed/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/mixed/impl/AServiceImpl.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/AServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/AServiceImpl.java Wed May 7 11:48:48 2008
@@ -0,0 +1,65 @@
+/*
+ * 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.mixed.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
+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<BService> 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) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState == null)
+ Assert.fail("Callback not received by this instance");
+ }
+
+ // 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/mixed/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/mixed/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/mixed/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/mixed/impl/BServiceImpl.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/impl/BServiceImpl.java Wed May 7 11:48:48 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.mixed.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.AServiceCallback;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.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);
+ }
+
+
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/mixed/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/mixed/impl/BServiceImpl.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/stateless/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/stateless/AServiceCallback.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/AServiceCallback.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/AServiceCallback.java Wed May 7 11:48:48 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.stateless;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
+@Remotable
+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/stateless/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/stateless/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/stateless/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/stateless/impl/AServiceImpl.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/AServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/AServiceImpl.java Wed May 7 11:48:48 2008
@@ -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.stateless.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.AService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.AServiceCallback;
+import org.junit.Assert;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(AService.class)
+public class AServiceImpl implements AService, AServiceCallback {
+
+ @Reference
+ protected ServiceReference<BService> 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 remote string");
+ int count = 4;
+ while (someState == null && count > 0) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState != null)
+ Assert.fail("Same instance received statefull calledback");
+ }
+
+ // 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/stateless/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/stateless/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/stateless/impl/AServiceImpl2.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/stateless/impl/AServiceImpl2.java?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/AServiceImpl2.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/stateless/impl/AServiceImpl2.java Wed May 7 11:48:48 2008
@@ -0,0 +1,68 @@
+/*
+ * 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.AService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.BService;
+import org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.AServiceCallback;
+import org.junit.Assert;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(AService.class)
+public class AServiceImpl2 implements AService, AServiceCallback {
+
+ @Reference
+ protected ServiceReference<BService> b;
+
+ private String someState;
+
+ private String someKey = "1234";
+
+ public void callBack(String someState) {
+ System.out.println("A callback called with this state => " + someState);
+ this.someState = someState;
+ Assert.assertSame(someKey, b.getCallbackID());
+ }
+
+ public void testCallback() {
+
+ b.setCallbackID("someKey");
+ b.getService().testCallBack("Some string");
+ int count = 4;
+ while (someState == null && count > 0) {
+ delayQuarterSecond();
+ count--;
+ }
+ if (someState != null)
+ Assert.fail("Same instance received statefull calledback");
+ }
+
+ // 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/stateless/impl/AServiceImpl2.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/stateless/impl/AServiceImpl2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-local.composite Wed May 7 11:48:48 2008
@@ -20,15 +20,15 @@
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://java-api-tests" name="Converstion-Callback-local">
- <component name="ALocalComponent">
+ <component name="AComponent">
<implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.ALocalServiceImpl" />
- <reference name="b" target="BLocalComponent" />
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl.AServiceImpl" />
+ <reference name="b" target="BComponent" />
</component>
- <component name="BLocalComponent">
+ <component name="BComponent">
<implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BLocalServiceImpl" />
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.local.impl.BServiceImpl" />
</component>
</composite>
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-mixed.composite Wed May 7 11:48:48 2008
@@ -18,17 +18,17 @@
* under the License.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://java-api-tests" name="Converstion-callback-remote">
+ targetNamespace="http://java-api-tests" name="Converstion-callback-mixed">
<component name="AComponent">
<implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.AServiceImpl" />
- <reference name="b" target="BLocalComponent" />
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.AServiceImpl" />
+ <reference name="b" target="BComponent" />
</component>
- <component name="BLocalComponent">
+ <component name="BComponent">
<implementation.java
- class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.impl.BLocalServiceImpl" />
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.mixed.impl.BServiceImpl" />
</component>
</composite>
Added: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite Wed May 7 11:48:48 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-stateless">
+
+ <component name="AComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.impl.AServiceImpl2" />
+ <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-stateless-callbackid.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless-callbackid.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite Wed May 7 11:48:48 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-stateless">
+
+ <component name="AComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.conversation.callback.stateless.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-stateless.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback-stateless.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite?rev=654209&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite (added)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite Wed May 7 11:48:48 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">
+
+ <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.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/main/resources/callback.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: 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=654209&r1=654208&r2=654209&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/conversation/callback/src/test/java/org/apache/tuscany/sca/vtest/javaapi/conversation/callback/CallbackTestCase.java Wed May 7 11:48:48 2008
@@ -21,6 +21,7 @@
import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -34,6 +35,7 @@
protected static SCADomain domain;
protected static String compositeName = "callback-remote.composite";
protected static AService aService = null;
+ protected static BService bService = null;
@BeforeClass
public static void init() throws Exception {
@@ -109,8 +111,8 @@
*/
@Test
public void statefulCallback() throws Exception {
- System.out.println("Setting up for remote callback tests");
- domain = SCADomain.newInstance("callback-remote.composite");
+ System.out.println("Setting up for callback tests");
+ domain = SCADomain.newInstance("callback.composite");
aService = domain.getService(AService.class, "AComponent");
aService.testCallback();
}
@@ -168,12 +170,12 @@
* should be used.
* <p>
* This tests the *local* bidirectional interfaces option
- */
+ */
@Test
- public void statefulCallback2() throws Exception {
+ public void localstatefulCallback() throws Exception {
System.out.println("Setting up for local callback tests");
domain = SCADomain.newInstance("callback-local.composite");
- aService = domain.getService(AService.class, "ALocalComponent");
+ aService = domain.getService(AService.class, "AComponent");
aService.testCallback();
}
@@ -184,13 +186,54 @@
* interfaces of a bidirectional service must be remotable, or both must be
* local. It is illegal to mix the two.
*/
- @Test(expected=ServiceRuntimeException.class)
+ @Test(expected = ServiceRuntimeException.class)
@Ignore("TUSCANY-2291")
- public void statefulCallback3() throws Exception {
+ public void statefulMixedCallback() 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();
}
+ /**
+ * Lines 613-615
+ * <p>
+ * A stateless callback interface is a callback whose interface is not
+ * marked as conversational. Unlike stateless services, the client of that
+ * uses stateless callbacks will not have callback methods routed to an
+ * instance of the client that contains any state that is relevant to the
+ * conversation.
+ */
+ @Test
+ public void statelessCallback() throws Exception {
+ System.out.println("Setting up for stateless callback tests");
+ domain = SCADomain.newInstance("callback-stateless.composite");
+ aService = domain.getService(AService.class, "AComponent");
+ aService.testCallback();
+ }
+
+ /**
+ * Lines 616-621
+ * <p>
+ * The only information that the client has to work with (other than the
+ * parameters of the callback method) is a callback ID object that is passed
+ * with requests to the service and is guaranteed to be returned with any
+ * callback.
+ * <p>
+ * The following is a repeat of the client code fragment above, but with the
+ * assumption that in this case the MyServiceCallback is stateless. The
+ * client in this case needs to set the callback ID before invoking the
+ * service and then needs to get the callback ID when the response is
+ * received.
+ */
+ @Test
+ @Ignore("TUSCANY-2299")
+ public void statelessCallback2() throws Exception {
+ System.out.println("Setting up for stateless callback tests");
+ domain = SCADomain.newInstance("callback-stateless-callbackid.composite");
+ aService = domain.getService(AService.class, "AComponent");
+ aService.testCallback();
+
+ }
+
}