From 938e8f66975589a340ec3818cf50a7ae672161f4 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 26 Oct 2010 10:56:15 +0000 Subject: Delete and redo release branch git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1027457 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/sample/CallBack.java | 33 ------- .../callback-api/src/main/java/sample/Client.java | 28 ------ .../src/main/java/sample/ClientImpl.java | 108 --------------------- .../src/main/java/sample/Launcher.java | 60 ------------ .../callback-api/src/main/java/sample/Service.java | 36 ------- .../src/main/java/sample/ServiceImpl.java | 96 ------------------ .../src/main/resources/CallBackApi.composite | 33 ------- .../main/resources/META-INF/sca-contribution.xml | 23 ----- 8 files changed, 417 deletions(-) delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/CallBack.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Client.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Launcher.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Service.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml (limited to 'sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src') diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/CallBack.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/CallBack.java deleted file mode 100644 index 16e4297e9d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/CallBack.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 sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The callback interface. - */ -@Remotable -public interface CallBack { - - void callBackMessage(String aString); - - void callBackIncrement(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Client.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Client.java deleted file mode 100644 index 7e0709e660..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Client.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 sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Client { - - void run(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java deleted file mode 100644 index 01219aa608..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java +++ /dev/null @@ -1,108 +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 sample; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -@Service(Client.class) -public class ClientImpl implements Client, CallBack { - - public static final String DELIMITER = "\n----------------------------"; - - @Reference - protected sample.Service service; - - private static int callBackCount = 0; - - /** - * This function prints the message received from the service - * implementation. - * - * @param String the message received from the service - */ - public void callBackMessage(String aString) { - System.out.println("ClientImpl - Received callback message: " + aString); - } - - /** - * This function increments the callBackCount variable when called from the - * service implementation. - */ - public void callBackIncrement() { - System.out.println("ClientImpl - Received increment callback"); - callBackCount++; - System.out.println("ClientImpl - Callback counter incremented to : " + getCallBackCount()); - } - - /** - * This method runs different kinds of service calls implying callbacks. - */ - public void run() { - simpleCallBack(); - simpleCallBackByRef(); - noCallBack(); - multipleCallBack(); - } - - /** - * The basic callback where the target calls back prior to returning to the - * client. - */ - private void simpleCallBack() { - System.out.println(DELIMITER + "\nSimple callback" + DELIMITER); - service.knockKnock("Knock Knock"); - } - - /** - * The basic callback where the target calls back prior to returning to the - * client. - */ - private void simpleCallBackByRef() { - System.out.println(DELIMITER + "\nSimple callback by reference" + DELIMITER); - service.knockKnockByRef("Knock Knock by reference"); - } - - /** - * The basic callback where the target does not call back to the client. - */ - private void noCallBack() { - System.out.println(DELIMITER + "\nNo callback" + DELIMITER); - service.noCallBack("No Reply Desired"); - } - - /** - * The basic callback where the target calls back multiple times to the - * client. - */ - private void multipleCallBack() { - System.out.println(DELIMITER + "\nMultiple callbacks" + DELIMITER); - service.multiCallBack("Call me back 3 times"); - } - - /** - * This function returns the callBackCount variable. - * - * @return Integer the callBackCount variable - */ - public int getCallBackCount() { - return callBackCount; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Launcher.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Launcher.java deleted file mode 100644 index fa1a59d726..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Launcher.java +++ /dev/null @@ -1,60 +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 sample; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This class starts the Tuscany Runtime and runs the client calls to the - * service. - */ -public class Launcher { - - public static void main(String[] args) { - Node node = startRuntime(); - Client client = node.getService(Client.class, "Client"); - client.run(); - stopRuntime(node); - } - - /** - * Starts a Tuscany node with the predefined contribution. - * - * @return the running node - */ - private static Node startRuntime() { - String location = ContributionLocationHelper.getContributionLocation("CallBackApi.composite"); - Node node = NodeFactory.newInstance().createNode("CallBackApi.composite", new Contribution("c1", location)); - node.start(); - return node; - } - - /** - * Stops a Tuscany node. - * - * @param node the node to stop - */ - private static void stopRuntime(Node node) { - node.stop(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Service.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Service.java deleted file mode 100644 index 6723af2adf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/Service.java +++ /dev/null @@ -1,36 +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 sample; - -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -@Callback(CallBack.class) -public interface Service { - - void knockKnock(String aString); - - void knockKnockByRef(String aString); - - void noCallBack(String aString); - - void multiCallBack(String aString); - -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java deleted file mode 100644 index 4850f434ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java +++ /dev/null @@ -1,96 +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 sample; - -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(sample.Service.class) -public class ServiceImpl implements sample.Service { - - public static final String MESSAGE_RECEIVED = "ServiceImpl - Received message: "; - - @Context - protected ComponentContext componentContext; - - @Callback - protected ServiceReference callbackRef; - - /** - * This function gets an object of ServiceImpl by calling - * getCallBackInterface function and calls the callBackMessage function. - * - * @param aString String passed by a function call - */ - public void knockKnock(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - CallBack callback = this.getCallBackFromComponentContext(); - callback.callBackMessage("Who's There"); - } - - /** - * This function calls the callBackMessage function. The reference to this - * function is received from the callback reference to the Service class. - * - * @param aString String passed by a function call - */ - public void knockKnockByRef(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - callbackRef.getService().callBackMessage("Who's There"); - } - - /** - * This function gets an object of ServiceImpl by calling - * getCallBackInterface function. This function then places multiple - * callbacks using the callbackIncrement function defined in the callback - * implementation. - * - * @param aString String passed by a function call - */ - public void multiCallBack(String aString) { - CallBack callback = this.getCallBackFromComponentContext(); - System.out.println(MESSAGE_RECEIVED + aString); - callback.callBackIncrement(); - callback.callBackIncrement(); - callback.callBackIncrement(); - } - - /** - * This function does not callBack any function. - * - * @param aString String passed by a function call - */ - public void noCallBack(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - } - - /** - * This function gets an object of ServiceImpl from the present - * componentContext. - * - * @return the callback - */ - private CallBack getCallBackFromComponentContext() { - return componentContext.getRequestContext().getCallback(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite deleted file mode 100644 index ca3a6e5f9d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index f17791205a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file -- cgit v1.2.3