summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java62
1 files changed, 31 insertions, 31 deletions
diff --git a/sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java b/sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java
index d764917276..9689ce8e0c 100644
--- a/sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java
+++ b/sandbox/travelsample/contributions/interaction-client/src/main/java/scatours/client/impl/InteractionOneWayCallbackClientImpl.java
@@ -32,47 +32,47 @@ import com.tuscanyscatours.common.TripLeg;
@Scope("COMPOSITE")
@Service(Runnable.class)
-public class InteractionOneWayCallbackClientImpl implements Runnable, SearchCallback{
-
+public class InteractionOneWayCallbackClientImpl implements Runnable, SearchCallback {
+
@Reference
protected Search hotelSearchOneWayCallback;
-
+
CountDownLatch resultsReceivedCountdown;
-
+
public void run() {
- System.out.println("\nCalling hotel component using both one way and callback interation patterns");
- resultsReceivedCountdown = new CountDownLatch(1);
- TripLeg tripLeg = getTestTripLeg();
- hotelSearchOneWayCallback.searchAsynch(tripLeg);
-
- // start other searched here while the hotel search progresses
-
- // wait for responses to come back
+ System.out.println("\nCalling hotel component using both one way and callback interation patterns");
+ resultsReceivedCountdown = new CountDownLatch(1);
+ TripLeg tripLeg = getTestTripLeg();
+ hotelSearchOneWayCallback.searchAsynch(tripLeg);
+
+ // start other searched here while the hotel search progresses
+
+ // wait for responses to come back
try {
resultsReceivedCountdown.await();
- } catch (InterruptedException ex){
+ } catch (InterruptedException ex) {
}
}
-
- public void searchResults(TripItem[] items){
- for (TripItem tripItem : items){
+
+ public void searchResults(TripItem[] items) {
+ for (TripItem tripItem : items) {
System.out.println("Found hotel - " + tripItem.getName());
}
resultsReceivedCountdown.countDown();
- }
-
- public void setPercentComplete(String searchComponent, int percentComplete){
+ }
+
+ public void setPercentComplete(String searchComponent, int percentComplete) {
// Not used in this sample
- }
-
- private TripLeg getTestTripLeg(){
- TripLeg tripLeg = new TripLeg();
- tripLeg.setFromLocation("LGW");
- tripLeg.setToLocation("FLR");
- tripLeg.setFromDate("06/12/09 00:00");
- tripLeg.setToDate("13/12/09 00:00");
- tripLeg.setNoOfPeople("1");
- tripLeg.setId("TRIP27");
- return tripLeg;
- }
+ }
+
+ private TripLeg getTestTripLeg() {
+ TripLeg tripLeg = new TripLeg();
+ tripLeg.setFromLocation("LGW");
+ tripLeg.setToLocation("FLR");
+ tripLeg.setFromDate("06/12/09 00:00");
+ tripLeg.setToDate("13/12/09 00:00");
+ tripLeg.setNoOfPeople("1");
+ tripLeg.setId("TRIP27");
+ return tripLeg;
+ }
}