Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-16 11:56:59 -0400
committerslewis2018-03-16 11:56:59 -0400
commita01ef1f6885bd7630aa781afb0b4c45df0431548 (patch)
treecfb70c53849918131a6542545e9de73a0377b6a0 /framework/bundles
parent0f54d67f70879ec5c705036165547f25e3bad349 (diff)
downloadorg.eclipse.ecf-a01ef1f6885bd7630aa781afb0b4c45df0431548.tar.gz
org.eclipse.ecf-a01ef1f6885bd7630aa781afb0b4c45df0431548.tar.xz
org.eclipse.ecf-a01ef1f6885bd7630aa781afb0b4c45df0431548.zip
Additional fixes for bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532205 Simplifications of AbstractRSAClientService Change-Id: I0000000000000000000000000000000000000000
Diffstat (limited to 'framework/bundles')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/client/AbstractRSAClientService.java23
1 files changed, 14 insertions, 9 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 bf0d835cf..0b5140d0f 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
@@ -82,7 +82,7 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
*/
protected Object invokeSync(RSARemoteCall remoteCall) throws ECFException {
if (remoteCall.getClass().isAssignableFrom(RSARemoteCall.class)) {
- Callable<Object> c = createSyncCallable(remoteCall);
+ Callable<Object> c = getSyncCallable(remoteCall);
if (c == null)
throw new ECFException("invokeSync failed on method=" + remoteCall.getMethod(), new NullPointerException("createSyncCallable() must not return null. It's necessary for distribution provider to override createSyncCallable.")); //$NON-NLS-1$ //$NON-NLS-2$
try {
@@ -140,36 +140,41 @@ public abstract class AbstractRSAClientService extends AbstractClientService {
@Override
public void callAsync(IRemoteCall call, IRemoteCallListener listener) {
- if (call instanceof RSARemoteCall)
- callAsyncWithTimeout(call, createAsyncCallable((RSARemoteCall) call), listener);
+ if (call instanceof RSARemoteCall)
+ callAsyncWithTimeout(call, getAsyncCallable((RSARemoteCall) call), listener);
else
super.callAsync(call, listener);
}
@Override
public Object callSync(IRemoteCall call) throws ECFException {
- if (call instanceof RSARemoteCall) {
- Callable<Object> c = createSyncCallable((RSARemoteCall) call);
+ if (call instanceof RSARemoteCall)
try {
- return c.call();
+ return getSyncCallable((RSARemoteCall) call).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) {
+ protected ExecutorService getExecutorService() {
+ return getFutureExecutorService(null);
+ }
+
+ /**
+ * @since 8.13
+ */
+ protected Callable<IRemoteCallCompleteEvent> getAsyncCallable(final RSARemoteCall call) {
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) {
+ protected Callable<Object> getSyncCallable(final RSARemoteCall call) {
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