diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-31 12:27:58 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-31 12:27:58 +0000 |
commit | bcbd8cb0b78cf576d73a0140476b2996a36e5245 (patch) | |
tree | fa4ff621017da31c51e8f591325cd42d6cad3686 /sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java | |
parent | c9ca42a3aa4ac890695ec10e7746b9895fc2cf64 (diff) |
Namespace changes from scatours to tuscanyscatours and addition of callback configuration.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@690687 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java')
-rw-r--r-- | sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java b/sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java index e5cc0cae8f..cbd50e5b35 100644 --- a/sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java +++ b/sandbox/travelsample/travel-contribution/src/scatours/travel/TravelImpl.java @@ -26,7 +26,9 @@ import java.util.UUID; import org.apache.tuscany.sca.data.collection.Entry; import org.apache.tuscany.sca.data.collection.NotFoundException; +import org.osoa.sca.CallableReference; import org.osoa.sca.ComponentContext; +import org.osoa.sca.RequestContext; import org.osoa.sca.ServiceReference; import org.osoa.sca.annotations.Context; import org.osoa.sca.annotations.Property; @@ -81,7 +83,12 @@ public class TravelImpl implements TravelSearch, SearchCallback, TravelBooking{ searchResults.clear(); responsesReceived = 0; - hotelSearch.searchAsynch(tripLeg); + ServiceReference<Search> dynamicHotelSearch = + componentContext.getServiceReference(Search.class, "hotelSearch"); + + dynamicHotelSearch.setCallbackID("HotelSearchCallbackID-" + tripLeg.getId()); + dynamicHotelSearch.getService().searchAsynch(tripLeg); + flightSearch.searchAsynch(tripLeg); carSearch.searchAsynch(tripLeg); @@ -110,6 +117,10 @@ public class TravelImpl implements TravelSearch, SearchCallback, TravelBooking{ // SearchCallback methods public void searchResults(TripItem[] items){ + RequestContext requestContext = componentContext.getRequestContext(); + Object callbackID = requestContext.getServiceReference().getCallbackID(); + System.out.println(callbackID); + for(int i = 0; i < items.length; i++ ){ searchResults.add(items[i]); } |