From 46576bda96cf80886ed8bd811e79dee9b1e63f4c Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 27 May 2010 10:12:24 +0000 Subject: Move the travel sample tutorial from 2.x trunk to contrib as its not in the build, doesn't build, and no one is actively working on it. (and even if they were, i wonder if this should be released seperately like the 1.x version and so not in the trunk tree anyway git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@948750 13f79535-47bb-0310-9956-ffa450edef68 --- .../impl/InteractionConversationClientImpl.java | 73 -------------------- .../client/impl/InteractionLocalClientImpl.java | 53 --------------- .../impl/InteractionOneWayCallbackClientImpl.java | 78 ---------------------- .../client/impl/InteractionRemoteClientImpl.java | 64 ------------------ .../impl/InteractionRequestResponseClientImpl.java | 39 ----------- .../main/resources/META-INF/sca-contribution.xml | 30 --------- .../src/main/resources/client.composite | 77 --------------------- 7 files changed, 414 deletions(-) delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/client.composite (limited to 'sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main') diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java deleted file mode 100644 index 7ad0d15442..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionConversationClientImpl.java +++ /dev/null @@ -1,73 +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 scatours.client.impl; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -import com.tuscanyscatours.common.TripItem; -import com.tuscanyscatours.shoppingcart.CartStore; - -@Scope("COMPOSITE") -@Service(Runnable.class) -public class InteractionConversationClientImpl implements Runnable { - - @Reference - protected CartStore cartStoreConversation; - - public void run() { - System.out.println("\nCalling cart store using the conversational interaction pattern"); - - // add some trip items to the cart store - TripItem tripItem = getTestTripItem(); - cartStoreConversation.addTrip(tripItem); - - tripItem.setDescription("2nd trip item"); - cartStoreConversation.addTrip(tripItem); - - tripItem.setDescription("3rd trip item"); - cartStoreConversation.addTrip(tripItem); - - System.out.println("Trip items now in cart"); - TripItem[] tripItems = cartStoreConversation.getTrips(); - for (TripItem item : tripItems) { - System.out.println("Item - " + item.getDescription()); - } - - System.out.println("Reset the cart"); - cartStoreConversation.reset(); - - System.out.println("Trip items now in cart"); - tripItems = cartStoreConversation.getTrips(); - for (TripItem item : tripItems) { - System.out.println("Item - " + item.getDescription()); - } - } - - private TripItem getTestTripItem() { - TripItem tripItem = new TripItem(); - tripItem.setLocation("FLR"); - tripItem.setFromDate("06/12/09 00:00"); - tripItem.setToDate("13/12/09 00:00"); - tripItem.setDescription("1st trip item"); - return tripItem; - } -} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java deleted file mode 100644 index c12c709461..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionLocalClientImpl.java +++ /dev/null @@ -1,53 +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 scatours.client.impl; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -import com.tuscanyscatours.calendar.Calendar; -import com.tuscanyscatours.common.TripLeg; - -@Service(Runnable.class) -public class InteractionLocalClientImpl implements Runnable { - - @Reference - protected Calendar calendarLocal; - - public void run() { - System.out.println("\nCalling calendar component over a local binding"); - TripLeg tripLeg = getTestTripLeg(); - String toDate = calendarLocal.getEndDate(tripLeg.getFromDate(), 10); - tripLeg.setToDate(toDate); - System.out.println("Calculated trip end date - " + toDate); - ; - } - - private TripLeg getTestTripLeg() { - TripLeg tripLeg = new TripLeg(); - tripLeg.setFromLocation("LGW"); - tripLeg.setToLocation("FLR"); - tripLeg.setFromDate("06/12/09 00:00"); - tripLeg.setToDate("13/12/09 00:00"); - tripLeg.setNoOfPeople("1"); - tripLeg.setId("TRIP27"); - return tripLeg; - } -} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java deleted file mode 100644 index 0b52d2d516..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java +++ /dev/null @@ -1,78 +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 scatours.client.impl; - -import java.util.concurrent.CountDownLatch; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -import com.tuscanyscatours.common.Search; -import com.tuscanyscatours.common.SearchCallback; -import com.tuscanyscatours.common.TripItem; -import com.tuscanyscatours.common.TripLeg; - -@Scope("COMPOSITE") -@Service(Runnable.class) -public class InteractionOneWayCallbackClientImpl implements Runnable, SearchCallback { - - @Reference - protected Search hotelSearchOneWayCallback; - - CountDownLatch resultsReceivedCountdown; - - public void run() { - System.out.println("\nCalling hotel component using both one way and callback interation patterns"); - resultsReceivedCountdown = new CountDownLatch(1); - TripLeg tripLeg = getTestTripLeg(); - hotelSearchOneWayCallback.searchAsynch(tripLeg); - - // start other searched here while the hotel search progresses - - // wait for responses to come back - try { - resultsReceivedCountdown.await(); - } catch (InterruptedException ex) { - } - } - - public void searchResults(TripItem[] items) { - for (TripItem tripItem : items) { - System.out.println("Found hotel - " + tripItem.getName()); - } - resultsReceivedCountdown.countDown(); - } - - public void setPercentComplete(String searchComponent, int percentComplete) { - // Not used in this sample - } - - private TripLeg getTestTripLeg() { - TripLeg tripLeg = new TripLeg(); - tripLeg.setFromLocation("LGW"); - tripLeg.setToLocation("FLR"); - tripLeg.setFromDate("06/12/09 00:00"); - tripLeg.setToDate("13/12/09 00:00"); - tripLeg.setNoOfPeople("1"); - tripLeg.setId("TRIP27"); - return tripLeg; - } -} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java deleted file mode 100644 index 0026b2e0b7..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRemoteClientImpl.java +++ /dev/null @@ -1,64 +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 scatours.client.impl; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -import com.tuscanyscatours.common.Search; -import com.tuscanyscatours.common.SearchCallback; -import com.tuscanyscatours.common.TripItem; -import com.tuscanyscatours.common.TripLeg; - -@Service(Runnable.class) -public class InteractionRemoteClientImpl implements Runnable, SearchCallback { - - @Reference - protected Search hotelSearchRemote; - - public void run() { - System.out.println("\nCalling hotel component over a remote binding"); - TripLeg tripLeg = getTestTripLeg(); - TripItem[] tripItems = hotelSearchRemote.searchSynch(tripLeg); - for (TripItem tripItem : tripItems) { - System.out.println("Found hotel - " + tripItem.getName()); - } - } - - public void searchResults(TripItem[] items) { - // we are calling the hotel component synchronously here - // so the callback interface is not used - } - - public void setPercentComplete(String searchComponent, int percentComplete) { - // Not used in this sample - } - - private TripLeg getTestTripLeg() { - TripLeg tripLeg = new TripLeg(); - tripLeg.setFromLocation("LGW"); - tripLeg.setToLocation("FLR"); - tripLeg.setFromDate("06/12/09 00:00"); - tripLeg.setToDate("13/12/09 00:00"); - tripLeg.setNoOfPeople("1"); - tripLeg.setId("TRIP27"); - return tripLeg; - } -} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java deleted file mode 100644 index f25a069713..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionRequestResponseClientImpl.java +++ /dev/null @@ -1,39 +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 scatours.client.impl; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -import com.tuscanyscatours.currencyconverter.CurrencyConverter; - -@Service(Runnable.class) -public class InteractionRequestResponseClientImpl implements Runnable { - - @Reference - protected CurrencyConverter currencyConverterRequestResponse; - - public void run() { - System.out.println("\nCalling currency converter component using request response interation pattern"); - double exchangeRate = currencyConverterRequestResponse.getExchangeRate("GBP", "USD"); - System.out.println("GBP to USD exchange rate is " + exchangeRate); - } - -} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 24349299a4..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/client.composite b/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/client.composite deleted file mode 100644 index 5fc2006cf0..0000000000 --- a/sca-java-2.x/trunk/tutorials/travelsample/contributions/interaction-client/src/main/resources/client.composite +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3