Make the search service OneWay

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
slaws 2008-08-11 06:39:21 +00:00
parent 716d910def
commit 4fcefa96cd
3 changed files with 11 additions and 6 deletions

View file

@ -30,6 +30,6 @@ import org.osoa.sca.annotations.Remotable;
public interface Search {
TripItem[] searchSynch(TripLeg tripLeg);
// TODO - Use to run searches in parallel @OneWay
@OneWay
void searchAsynch(TripLeg tripLeg);
}

View file

@ -87,7 +87,9 @@ public class TravelImpl implements TravelSearch, SearchCallback, TravelBooking{
while (responsesReceived < 3){
try {
this.wait();
synchronized (this) {
this.wait();
}
} catch (InterruptedException ex){
// do nothing
}
@ -114,7 +116,9 @@ public class TravelImpl implements TravelSearch, SearchCallback, TravelBooking{
responsesReceived++;
try {
this.notifyAll();
synchronized (this) {
this.notifyAll();
}
} catch (Exception ex) {
}
}

View file

@ -206,7 +206,7 @@
<img src="scatours.png" border="0" />
<div id="scatours">
<form name="travelForm">
<h3><div id="tripId"></h3>
<h3>Search for hotels, flights and cars</h3>
<br/>
<table border="0">
<tr>
@ -233,16 +233,17 @@
<td/>
</tr>
</table>
<br/>
<input type="button" onClick="searchPackages()" value="SearchPackages">
<input type="button" onClick="searchHotels()" value="Search Hotels">
<input type="button" onClick="searchFlights()" value="Search Flights">
<input type="button" onClick="searchHotels()" value="Search Cars">
<input type="button" onClick="searchCars()" value="Search Cars">
</form>
<form name="tripForm">
<h3>Search Results</h3>
<div id="searchResponse"></div>
<br>
<h3>You Trip</h3>
<h3><div id="tripId"></h3>
<div id="tripItems"></div>
<br>
<div id="totalPrice"></div>