From 07b7dfd1a70ba222b899d9813f8c449dbf3b785f Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:28 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835124 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/test/CallBackApiCallBack.java | 33 ----- .../apache/tuscany/sca/test/CallBackApiClient.java | 28 ---- .../tuscany/sca/test/CallBackApiClientImpl.java | 159 --------------------- .../tuscany/sca/test/CallBackApiService.java | 37 ----- .../tuscany/sca/test/CallBackApiServiceImpl.java | 91 ------------ 5 files changed, 348 deletions(-) delete mode 100644 branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java delete mode 100644 branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java delete mode 100644 branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java delete mode 100644 branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java delete mode 100644 branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java (limited to 'branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test') diff --git a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java deleted file mode 100644 index e03bc1bda8..0000000000 --- a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.test; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -/** - * - */ -public interface CallBackApiCallBack { - - public void callBackMessage(String aString); - - public void callBackIncrement(String aString); - -} diff --git a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java deleted file mode 100644 index 3e7c840e15..0000000000 --- a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.test; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CallBackApiClient { - - public void run(); - -} diff --git a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java deleted file mode 100644 index 521464b4a2..0000000000 --- a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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.test; - -import junit.framework.Assert; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -@Service(CallBackApiClient.class) -public class CallBackApiClientImpl implements CallBackApiClient, CallBackApiCallBack { - - @Reference - protected CallBackApiService aCallBackService; - - private static String returnMessage = null; - private static int callBackCount = 0; - private static Object monitor = new Object(); - - public void run() { - - // This tests basic callback patterns. - - // Test3a is the basic callback where the target calls back prior to - // returning to the client. - test3a(); - - test3a1(); - - // Test3b is where the target does not call back to the client. - test3b(); - - // Test3c is where the target calls back multiple times to the client. - test3c(); - - return; - } - - private void test3a() { - aCallBackService.knockKnock("Knock Knock"); - int count = 0; - - // - // If we cant get a response in 30 seconds consider this a failure - // - - synchronized (monitor) { - while (returnMessage == null && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage()); - - } - - private void test3a1() { - aCallBackService.knockKnockByRef("Knock Knock"); - int count = 0; - - // - // If we cant get a response in 30 seconds consider this a failure - // - - synchronized (monitor) { - while (returnMessage == null && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage()); - - } - - private void test3b() { - aCallBackService.noCallBack("No Reply Desired"); - Assert.assertEquals("CallBackApiITest - test3b", 1, 1); - return; - } - - private void test3c() { - aCallBackService.multiCallBack("Call me back 3 times"); - int count = 0; - - // - // If we cant get a response in 30 seconds consider this a failure - // - - synchronized (monitor) { - while (this.getCallBackCount() < 3 && count++ < 30) { - try { - monitor.wait(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - Assert.assertEquals("CallBackApiITest - test3c", 3, this.getCallBackCount()); - return; - } - - public String getReturnMessage() { - return returnMessage; - } - - public void setReturnMessage(String aReturnMessage) { - returnMessage = aReturnMessage; - } - - public int getCallBackCount() { - return callBackCount; - } - - public void incrementCallBackCount() { - callBackCount++; - } - - public void callBackMessage(String aString) { - System.out.println("Entering callback callBackMessage: " + aString); - synchronized (monitor) { - this.setReturnMessage(aString); - monitor.notify(); - } - } - - public void callBackIncrement(String aString) { - System.out.println("Entering callback increment: " + aString); - synchronized (monitor) { - this.incrementCallBackCount(); - monitor.notify(); - } - } - -} diff --git a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java deleted file mode 100644 index 4e15e97c8d..0000000000 --- a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.test; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Remotable; - -@Remotable -@Callback(CallBackApiCallBack.class) -/** - * - */ -public interface CallBackApiService { - - public void knockKnock(String aString); - public void knockKnockByRef(String aString); - public void noCallBack(String aString); - - public void multiCallBack(String aString); - -} diff --git a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java deleted file mode 100644 index d51904d2ea..0000000000 --- a/branches/sca-java-1.1/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.test; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Service; - -@Service(CallBackApiService.class) -public class CallBackApiServiceImpl implements CallBackApiService { - - @Context - protected ComponentContext componentContext; - - private CallBackApiCallBack callback; - - @Callback - protected CallableReference callbackRef; - - public void knockKnock(String aString) { - - System.out.println("CallBackApiServiceImpl message received: " + aString); - callback = this.getCallBackInterface(); - callback.callBackMessage("Who's There"); - System.out.println("CallBackApiServiceImpl response sent"); - return; - - } - - public void knockKnockByRef(String aString) { - - System.out.println("CallBackApiServiceImpl message received: " + aString); - callbackRef.getService().callBackMessage("Who's There"); - System.out.println("CallBackApiServiceImpl response sent"); - return; - - } - - public void multiCallBack(String aString) { - - callback = this.getCallBackInterface(); - - System.out.println("CallBackApiServiceImpl message received: " + aString); - callback.callBackIncrement("Who's There 1"); - System.out.println("CallBackApiServiceImpl response sent"); - callback.callBackIncrement("Who's There 2"); - System.out.println("CallBackApiServiceImpl response sent"); - callback.callBackIncrement("Who's There 3"); - System.out.println("CallBackApiServiceImpl response sent"); - return; - - } - - public void noCallBack(String aString) { - - System.out.println("CallBackApiServiceImpl message received: " + aString); - - return; - - } - - private CallBackApiCallBack getCallBackInterface() { - System.out.println("CallBackApiServiceImpl getting request context"); - RequestContext rc = componentContext.getRequestContext(); - System.out.println("CallBackApiServiceImpl getting callback from request context"); - callback = rc.getCallback(); - System.out.println("CallBackApiServiceImpl returning callback"); - return callback; - - } - -} -- cgit v1.2.3