Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2016-02-25 18:46:04 +0000
committerslewis2016-02-25 18:46:04 +0000
commit5d719e336a7a5c88edd27a635edb707ea327fe56 (patch)
tree4294767f729bbd0adc7804296bac2d09845b0d73 /framework
parent560dac9dc6411c9c1bd12c0c880244aae6ccc4e9 (diff)
downloadorg.eclipse.ecf-5d719e336a7a5c88edd27a635edb707ea327fe56.tar.gz
org.eclipse.ecf-5d719e336a7a5c88edd27a635edb707ea327fe56.tar.xz
org.eclipse.ecf-5d719e336a7a5c88edd27a635edb707ea327fe56.zip
Simplification of AbstractRSAClientService
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java
index 5a1f12098..1759b7ce0 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java
@@ -22,16 +22,22 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
public static class RSARemoteCall extends RemoteCall {
+ private final Object proxy;
private final Method reflectMethod;
- public RSARemoteCall(Method method, String methodName, Object[] parameters, long timeout) {
+ public RSARemoteCall(Object proxy, Method method, String methodName, Object[] parameters, long timeout) {
super(methodName, parameters, timeout);
this.reflectMethod = method;
+ this.proxy = proxy;
}
public Method getReflectMethod() {
return reflectMethod;
}
+
+ public Object getProxy() {
+ return proxy;
+ }
}
/**
@@ -46,12 +52,12 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
super(container, registration);
}
- protected abstract Object invokeAsync(Method method, Object[] args);
+ protected abstract Object invokeAsync(RSARemoteCall remoteCall);
protected abstract Object invokeSync(RSARemoteCall remoteCall) throws ECFException;
- protected RSARemoteCall createRemoteCall(Method method, String methodName, Object[] parameters, long timeout) {
- return new RSARemoteCall(method, methodName, parameters, timeout);
+ protected RSARemoteCall createRemoteCall(Object proxy, Method method, String methodName, Object[] parameters, long timeout) {
+ return new RSARemoteCall(proxy, method, methodName, parameters, timeout);
}
@Override
@@ -61,11 +67,11 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
if (resultObject != null)
return resultObject;
if (isAsync(proxy, method, args))
- return invokeAsync(method, args);
+ return invokeAsync(createRemoteCall(proxy, method, getAsyncInvokeMethodName(method), args, IRemoteCall.DEFAULT_TIMEOUT));
final String callMethod = getCallMethodNameForProxyInvoke(method, args);
final Object[] callParameters = getCallParametersForProxyInvoke(callMethod, method, args);
final long callTimeout = getCallTimeoutForProxyInvoke(callMethod, method, args);
- return invokeSync(createRemoteCall(method, callMethod, callParameters, callTimeout));
+ return invokeSync(createRemoteCall(proxy, method, callMethod, callParameters, callTimeout));
} catch (Throwable t) {
if (t instanceof ServiceException)
throw t;

Back to the top