From f0797f0026f729fa612930fbd0acefc5343a0fe6 Mon Sep 17 00:00:00 2001 From: nash Date: Mon, 22 Nov 2010 09:49:22 +0000 Subject: Copy 1.6.1-RC2 tag as 1.6.1 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1037648 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/com/goodvaluetrips/Trips.java | 26 ++++++++++++ .../main/java/com/tuscanyscatours/Bookings.java | 26 ++++++++++++ .../main/java/com/tuscanyscatours/Checkout.java | 28 +++++++++++++ .../java/com/tuscanyscatours/ShoppingCart.java | 40 +++++++++++++++++++ .../main/java/com/tuscanyscatours/TripBooking.java | 35 ++++++++++++++++ .../src/main/java/com/tuscanyscatours/Updates.java | 26 ++++++++++++ .../main/resources/META-INF/sca-contribution.xml | 25 ++++++++++++ .../basic/tours/src/main/resources/tours.composite | 46 ++++++++++++++++++++++ 8 files changed, 252 insertions(+) create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/goodvaluetrips/Trips.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Checkout.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/ShoppingCart.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/TripBooking.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Updates.java create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/tours.composite (limited to 'sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main') diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/goodvaluetrips/Trips.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/goodvaluetrips/Trips.java new file mode 100644 index 0000000000..365a210368 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/goodvaluetrips/Trips.java @@ -0,0 +1,26 @@ +/* + * 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 com.goodvaluetrips; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Trips { + String checkAvailability(String trip, int people); +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Bookings.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Bookings.java @@ -0,0 +1,26 @@ +/* + * 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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Bookings { + String newBooking(String trip, int people); +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Checkout.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Checkout.java new file mode 100644 index 0000000000..29c84d2bc0 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Checkout.java @@ -0,0 +1,28 @@ +/* + * 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 com.tuscanyscatours; + +import java.math.BigDecimal; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Checkout { + void makePayment(BigDecimal amount, String cardInfo); +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/ShoppingCart.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/ShoppingCart.java new file mode 100644 index 0000000000..db551501e1 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/ShoppingCart.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.tuscanyscatours; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class ShoppingCart implements Checkout, Updates { + private static List bookedTrips = new ArrayList(); + + public void makePayment(BigDecimal amount, String cardInfo) { + System.out.print("Charged $" + amount + " to card " + cardInfo + " for " + + (bookedTrips.size() > 1 ? "trips" : "trip")); + for (String trip : bookedTrips){ + System.out.print(" " + trip); + } + System.out.println(); + bookedTrips.clear(); + } + public void addTrip(String resCode) { + bookedTrips.add(resCode); + } +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/TripBooking.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/TripBooking.java new file mode 100644 index 0000000000..e64d60545e --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/TripBooking.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.tuscanyscatours; + +import org.osoa.sca.annotations.Reference; + +public class TripBooking implements Bookings { + @Reference + protected com.goodvaluetrips.Trips mytrips; + + @Reference + protected Updates cart; + + public String newBooking(String trip, int people) { + String resCode = mytrips.checkAvailability(trip, people); + cart.addTrip(resCode); + return "GV" + resCode; + } +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Updates.java b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Updates.java new file mode 100644 index 0000000000..e33b0399cb --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/java/com/tuscanyscatours/Updates.java @@ -0,0 +1,26 @@ +/* + * 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 com.tuscanyscatours; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Updates { + void addTrip(String resCode); +} diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..b6ef1acafa --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/tours.composite b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/tours.composite new file mode 100644 index 0000000000..f166a1635d --- /dev/null +++ b/sca-java-1.x/tags/1.6.1/itest/domainmgr/basic/tours/src/main/resources/tours.composite @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3