Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-15 22:53:41 -0400
committerslewis2018-03-15 22:53:41 -0400
commitffa487aad2674b82ece557b99560b1d138fe3a33 (patch)
treedaf63dc44d4606b6f8138cbc0ed55b45f04ab2d0 /framework/bundles
parentad9072431abb30e725f6a1b30328b59abf6c229a (diff)
downloadorg.eclipse.ecf-ffa487aad2674b82ece557b99560b1d138fe3a33.tar.gz
org.eclipse.ecf-ffa487aad2674b82ece557b99560b1d138fe3a33.tar.xz
org.eclipse.ecf-ffa487aad2674b82ece557b99560b1d138fe3a33.zip
Additional fixes for bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532205 Simplifications of AbstractRSAClientService Change-Id: I9229e9e219a35a042d5af205f4078869ebd53a93 Change-Id: I9229e9e219a35a042d5af205f4078869ebd53a93
Diffstat (limited to 'framework/bundles')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java24
1 files changed, 18 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 bffc416eb..178121e4d 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
@@ -115,7 +115,7 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
return invokeAsync(createRemoteCall(proxy, method, getAsyncInvokeMethodName(method), args, getDefaultTimeout()));
// If OSGI Async then invoke method directly
if (isOSGIAsync())
- return invokeReturnAsync(proxy, method, args);
+ return invokeAsync(createRemoteCall(proxy, method, method.getName(), args, getDefaultTimeout()));
}
} catch (Throwable t) {
handleProxyException("Exception invoking async method on remote service proxy=" + getRemoteServiceID(), t); //$NON-NLS-1$
@@ -142,25 +142,37 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
public void callAsync(IRemoteCall call, IRemoteCallListener listener) {
if (call instanceof RSARemoteCall) {
Callable<IRemoteCallCompleteEvent> c = createAsyncCallable((RSARemoteCall) call);
- if (c == null)
- throw new NullPointerException("createAsyncCallable returns null. Distribution provider must override createAsyncCallable"); //$NON-NLS-1$
- callAsyncWithTimeout(call, c, listener);
+ if (c != null)
+ callAsyncWithTimeout(call, c, listener);
} else
super.callAsync(call, listener);
}
+ @Override
+ public Object callSync(IRemoteCall call) throws ECFException {
+ if (call instanceof RSARemoteCall) {
+ Callable<Object> c = createSyncCallable((RSARemoteCall) call);
+ try {
+ return c.call();
+ } catch (Exception e) {
+ throw new ECFException("Exception calling callable for method=" + call.getMethod(), e); //$NON-NLS-1$
+ }
+ }
+ return super.callSync(call);
+ }
+
/**
* @since 8.13
*/
protected Callable<IRemoteCallCompleteEvent> createAsyncCallable(final RSARemoteCall call) {
- return null;
+ throw new UnsupportedOperationException("distribution provider must override createAsyncCallable for service method=" + call.getMethod() + " class=" + call.getReflectMethod().getDeclaringClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* @since 8.13
*/
protected Callable<Object> createSyncCallable(final RSARemoteCall call) {
- return null;
+ throw new UnsupportedOperationException("distribution provider must override createAsyncCallable for service method=" + call.getMethod() + " class=" + call.getReflectMethod().getDeclaringClass()); //$NON-NLS-1$ //$NON-NLS-2$
}
}

Back to the top