summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-10-15 16:25:02 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-10-15 16:25:02 +0000
commit34ea5dac5d95d94a9acbb4453dfeb097598e63a1 (patch)
tree5adbaa6619416d6ee8cb8d1e8768fcae485e6785 /sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
parent721f0a86ffa36dea3ddd1b98344c94688c45a2de (diff)
TUSCANY-3728 Rename the reference async interface and correct the signature of the poll operation which is causing a bind failure in the JIRA.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1022997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java')
-rw-r--r--sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java b/sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
index 69c96fe892..f27bf7f7f4 100644
--- a/sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
+++ b/sca-java-2.x/trunk/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
@@ -21,6 +21,8 @@ package calculator;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
+import javax.xml.ws.Response;
+
import org.oasisopen.sca.annotation.Reference;
/**
@@ -28,13 +30,13 @@ import org.oasisopen.sca.annotation.Reference;
* to sync and asyn versions of the calculator service. This proxy
* exercises the various async interface alternatives
*/
-public class CalculatorServiceProxyImpl implements CalculatorService {
+public class CalculatorServiceProxyImpl implements CalculatorServiceSync {
@Reference
- protected CalculateViaAsyncRef calculatorServiceRefSync;
+ protected CalculateReferenceAsync calculatorServiceRefSync;
@Reference
- protected CalculateViaAsyncRef calculatorServiceRefAsync;
+ protected CalculateReferenceAsync calculatorServiceRefAsync;
@Override
public String calculate(Integer n1) {
@@ -52,21 +54,21 @@ public class CalculatorServiceProxyImpl implements CalculatorService {
}
// exercise sync and async versions of a service interface method
- private String calculate(CalculateViaAsyncRef calculatorRef, Integer n1) {
+ private String calculate(CalculateReferenceAsync calculatorRef, Integer n1) {
// sync
String result = calculatorRef.calculate(1);
System.out.println("Sync client patern: result = " + result);
// async poll
- Future<String> future = calculatorRef.calculateAsync(20);
+ Response<String> response = calculatorRef.calculateAsync(20);
- while (!future.isDone()){
+ while (!response.isDone()){
System.out.println("Waiting for poll");
}
try {
- result = future.get();
+ result = response.get();
System.out.println("Async client poll patern: result = " + result);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
@@ -78,7 +80,7 @@ public class CalculatorServiceProxyImpl implements CalculatorService {
// async callback
CalculatorAsyncHandler handler = new CalculatorAsyncHandler();
- future = calculatorRef.calculateAsync(3, handler);
+ Future<String> future = calculatorRef.calculateAsync(3, handler);
while (!future.isDone()){
System.out.println("Waiting for callback");