diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-25 18:00:45 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-25 18:00:45 +0000 |
commit | 3852b601e7c5d71282cb5e37e9c6ce6e648503a2 (patch) | |
tree | 65e9367a1a4e6b3386f3b745f0611fb13ac67396 /sandbox/travelsample/hotel-contribution/src/scatours | |
parent | fcc6917ad657da26eedccadf3e7b8d81d410b6a7 (diff) |
switch components so that the booking component talks directly to the trip suppliers.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@737553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java index 81012ea08b..a9a6d1bbde 100644 --- a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java +++ b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java @@ -26,6 +26,7 @@ import org.osoa.sca.annotations.Init; import org.osoa.sca.annotations.Scope; import org.osoa.sca.annotations.Service; +import scatours.common.Book; import scatours.common.Search; import scatours.common.SearchCallback; import scatours.common.TripItem; @@ -35,8 +36,8 @@ import scatours.common.TripLeg; * An implementation of the Hotel service */ @Scope("STATELESS") -@Service(interfaces={Search.class}) -public class HotelImpl implements Search { +@Service(interfaces={Search.class, Book.class}) +public class HotelImpl implements Search, Book { private List<HotelInfo> hotels = new ArrayList<HotelInfo>(); @@ -47,35 +48,35 @@ public class HotelImpl implements Search { public void init() { hotels.add(new HotelInfo("Deep Bay Hotel", "Wonderful sea views and a relaxed atmosphere", - "ANU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("Long Bay Hotel", "Friendly staff and an ocean breeze", - "ANU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("City Hotel", "Smart rooms and early breakfasts", - "NY", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("County Hotel", "The smell of the open country", - "SOU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); } @@ -87,7 +88,7 @@ public class HotelImpl implements Search { if (hotel.getLocation().equals(tripLeg.getToLocation())){ TripItem item = new TripItem("", "", - "Hotel", + TripItem.HOTEL, hotel.getName(), hotel.getDescription(), hotel.getLocation(), @@ -108,4 +109,8 @@ public class HotelImpl implements Search { // return available hotels searchCallback.searchResults(searchSynch(tripLeg)); } + + public String book(TripItem tripItem) { + return "hotel1"; + } } |