From 38ebe24c08241e09ac0c1c5e257a25583a868566 Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 1 Jun 2009 19:00:22 +0000 Subject: Move redundant modules into contrib git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@780781 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/com/tuscanyscatours/Bookings.java | 26 ++++++++++++++++ .../main/java/com/tuscanyscatours/Checkout.java | 26 ++++++++++++++++ .../java/com/tuscanyscatours/ShoppingCart.java | 28 +++++++++++++++++ .../main/java/com/tuscanyscatours/TripBooking.java | 35 ++++++++++++++++++++++ .../src/main/java/com/tuscanyscatours/Updates.java | 26 ++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Bookings.java create mode 100644 sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Checkout.java create mode 100644 sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/ShoppingCart.java create mode 100644 sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/TripBooking.java create mode 100644 sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Updates.java (limited to 'sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours') diff --git a/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Bookings.java b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Bookings.java new file mode 100644 index 0000000000..9d54d46bb6 --- /dev/null +++ b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/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/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Checkout.java b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Checkout.java new file mode 100644 index 0000000000..688fc7e83b --- /dev/null +++ b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Checkout.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 Checkout { + void makePayment(double amount, String cardInfo); +} diff --git a/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/ShoppingCart.java b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/ShoppingCart.java new file mode 100644 index 0000000000..68bf25a8cd --- /dev/null +++ b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/ShoppingCart.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; + +public class ShoppingCart implements Checkout, Updates { + public void makePayment(double amount, String cardInfo) { + // make payment for trips in cart giving card details + } + public void addTrip(String resCode) { + // add the booked trip to the cart + } +} diff --git a/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/TripBooking.java b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/TripBooking.java new file mode 100644 index 0000000000..e64d60545e --- /dev/null +++ b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/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/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Updates.java b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/src/main/java/com/tuscanyscatours/Updates.java new file mode 100644 index 0000000000..e33b0399cb --- /dev/null +++ b/sandbox/travelsample/contrib/chapter-02/tuscanyscatours-contribution/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); +} -- cgit v1.2.3