Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/.settings/.api_filters4
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java49
3 files changed, 51 insertions, 4 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/.settings/.api_filters b/framework/bundles/org.eclipse.ecf.remoteservice/.settings/.api_filters
index 1c1e42412..332577a70 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/.settings/.api_filters
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/.settings/.api_filters
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.ecf.remoteservice" version="2">
<resource path="src/org/eclipse/ecf/remoteservice/Constants.java" type="org.eclipse.ecf.remoteservice.Constants">
- <filter comment="Added to allow remote services to expose async proxies outside of original package." id="1211105284">
+ <filter id="1211105284">
<message_arguments>
- <message_argument value="SERVICE_ASYNC_PROXY"/>
+ <message_argument value="SERVICE_ASYNC_RSPROXY_CLASS_"/>
</message_arguments>
</filter>
</resource>
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
index 997b62ca6..202ce1660 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRemoteService.java
@@ -198,7 +198,7 @@ public abstract class AbstractRemoteService implements IRemoteService, Invocatio
protected String convertInterfaceNameToAsyncInterfaceName(String interfaceName) {
if (interfaceName == null)
return null;
- String asyncProxyName = (String) getRemoteServiceReference().getProperty(Constants.SERVICE_ASYNC_PROXY + interfaceName);
+ String asyncProxyName = (String) getRemoteServiceReference().getProperty(Constants.SERVICE_ASYNC_RSPROXY_CLASS_ + interfaceName);
if (asyncProxyName != null)
return asyncProxyName;
// If a value has been specified by the ServiceProperty
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
index 0f4f576d3..2ac0a3dd0 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Constants.java
@@ -111,7 +111,54 @@ public interface Constants {
*/
public static final String SERVICE_PREVENT_RSPROXY = "ecf.rsvc.norsproxy"; //$NON-NLS-1$
- public static final String SERVICE_ASYNC_PROXY = "ecf.rsvc.async.proxy_"; //$NON-NLS-1$
+ /**
+ * This constant allows the fully qualified async remote service proxy to be specified
+ * as a service property. For example, if the remote service interface is as so:
+ * <pre>
+ * package foo;
+ *
+ * public interface Bar {
+ * String doStuff();
+ * }
+ * </pre>
+ * then by default, the async remote service proxy interface class would be expected
+ * to be the following:
+ * <pre>
+ * package foo;
+ * import org.eclipse.ecf.remoteservice.IAsyncRemoteServiceProxy;
+ * import org.eclipse.equinox.concurrent.future.IFuture;
+ *
+ * public interface BarAsync extends IAsyncRemoteServiceProxy {
+ * IFuture doStuffAsync();
+ * }
+ * </pre>
+ * This property allows a new class to be associated with the
+ * original service interface, so that rather than looking for the foo.BarAsync class
+ * when a proxy is created, the class specified by the value of the property will
+ * be used instead. For example, assume the existance of another async
+ * remote service interface:
+ * <pre>
+ * package gogo;
+ * import org.eclipse.ecf.remoteservice.IAsyncRemoteServiceProxy;
+ * import org.eclipse.equinox.concurrent.future.IFuture;
+ *
+ * public interface MyBar extends IAsyncRemoteServiceProxy {
+ * IFuture doStuffAsync();
+ * }
+ * </pre>
+ * Further assume that when the remote service was registered, that a service property
+ * was specified:
+ * <pre>
+ * serviceProps.put("ecf.rsvc.async.proxy_&lt;fq classname&gt;","&lt;fq substitute&gt;");
+ * </pre>
+ * <pre>
+ * serviceProps.put("ecf.rsvc.async.proxy_foo.Bar","gogo.MyBar");
+ * </pre>
+ * Then, when a Bar proxy is created, if the 'gogo.MyBar' interface is available on
+ * the client, an async remote service proxy will be added to the proxy, and
+ * client will be able to asynchronously call MyBar.doStuffAsync() on the proxy.
+ */
+ public static final String SERVICE_ASYNC_RSPROXY_CLASS_ = "ecf.rsvc.async.proxy_"; //$NON-NLS-1$
/**
* @deprecated

Back to the top