Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-03-09 21:55:02 +0000
committerslewis2018-03-09 21:55:02 +0000
commit1aa9691b99d3f0deca7b9ea7d4ba976ef4f7276e (patch)
tree4bfd40b232b5cc09100c7a5b119876f86068df1f /providers
parenta2c6a6429af436a2e30749f75c8a9f88fca9fa45 (diff)
downloadorg.eclipse.ecf-1aa9691b99d3f0deca7b9ea7d4ba976ef4f7276e.tar.gz
org.eclipse.ecf-1aa9691b99d3f0deca7b9ea7d4ba976ef4f7276e.tar.xz
org.eclipse.ecf-1aa9691b99d3f0deca7b9ea7d4ba976ef4f7276e.zip
Additional fixes for bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532205 Change-Id: I0000000000000000000000000000000000000000
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java16
2 files changed, 6 insertions, 11 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
index 6c6898b83..13aa0e386 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
@@ -22,6 +22,7 @@ Import-Package: org.eclipse.core.runtime.jobs,
org.eclipse.osgi.framework.eventmgr;version="[1.0.0,2.0.0)",
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.service.log;version="[1.0.0,2.0.0)",
+ org.osgi.util.promise,
org.osgi.util.tracker;version="[1.3.2,2.0.0)"
Provide-Capability: osgi.remoteserviceadmin.distribution; configs:List<String>="ecf.generic.server,ecf.generic.client,ecf.generic.ssl.server,ecf.generic.ssl.client"; version:Version=1.1
Bundle-ActivationPolicy: lazy
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index c3dbdfb3a..d27545aab 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -14,8 +14,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.*;
import java.util.*;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.ContainerConnectException;
import org.eclipse.ecf.core.events.*;
@@ -30,6 +28,7 @@ import org.eclipse.ecf.core.util.reflection.ClassUtil;
import org.eclipse.ecf.internal.provider.remoteservice.Activator;
import org.eclipse.ecf.internal.provider.remoteservice.IRemoteServiceProviderDebugOptions;
import org.eclipse.ecf.remoteservice.*;
+import org.eclipse.ecf.remoteservice.asyncproxy.AsyncReturnUtil;
import org.eclipse.ecf.remoteservice.events.*;
import org.eclipse.equinox.concurrent.future.*;
import org.eclipse.osgi.framework.eventmgr.*;
@@ -1467,15 +1466,10 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
// Actually invoke method on service object
Object result = method.invoke(service, args);
if (result != null) {
- // provider must expose osgi.async property
- if (reg.getProperty(Constants.OSGI_ASYNC_INTENT) != null) {
- Class returnType = method.getReturnType();
- if (returnType.isAssignableFrom(Future.class))
- result = ((Future) result).get(call.getTimeout(), TimeUnit.MILLISECONDS);
- else if (returnType.isAssignableFrom(IFuture.class))
- result = ((IFuture) result).get();
- // XXX test for Promise here
- }
+ Class returnType = method.getReturnType();
+ // provider must expose osgi.async property and must be async return type
+ if (reg.getProperty(Constants.OSGI_ASYNC_INTENT) != null && AsyncReturnUtil.isAsyncType(returnType))
+ return AsyncReturnUtil.asyncReturn(result, returnType, call.getTimeout());
}
return result;
}

Back to the top