Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 431756

Summary: add support for java8 completable future via ECF async proxies
Product: [RT] ECF Reporter: Scott Lewis <slewis>
Component: ecf.remoteservicesAssignee: ecf.core-inbox <ecf.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Scott Lewis CLA 2014-04-01 18:34:22 EDT
For some time, ECF remote services has a concept called 'asynchronous proxies' 

https://wiki.eclipse.org/ECF/Asynchronous_Remote_Services

With Java8 the availability of the CompletableFuture class opens up the possibility that ECF's asynchronous proxies capability could be extended to support the use of CompletableFuture as a remote service return type, rather than (or in addition to) Future.

It would be very nice to add support for java Completable future via ECF async proxies.  For explanation see this blog posting

http://eclipseecf.blogspot.com/2014/03/completablefuture-for-osgi-remote.html
Comment 1 Scott Lewis CLA 2014-04-01 23:29:24 EDT
Pushed to master first checkin to address this enhancement:

http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/commit/?id=599e7ed4d21b7a586f565bff3ae545deda2f8fc8

There are two new projects in this checkin:

org.eclipse.ecf.remoteservice.asyncproxy

and 

org.eclipse.ecf.remtoeservice.adyncproxy.j8

These two projects represent two versions of a single, new bundle with id:  org.eclipse.ecf.remoteservice.asyncproxy.j8.  The first is version 1.0.0, and is intended for use on runtimes with java version 1.5->1.7.   The second is version 2.0.0 for java version 1.8+.   The BREE is set appropriately (1.5 for first, 1.8 for second).

The idea behind this is that these two versions have the same 3 classes:

org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteCall
This is a method-less abstract superclass for org.eclipse.ecf.remoteservice.RemoteCall

org.eclipse.ecf.remoteservice.asyncproxy.IAsyncProxyCompletable
This is a new interface used for handling usage of java8 CompletableFuture

org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteService
This class is a new superclass for org.eclipse.ecf.remoteservice, that allows the callFuture to be handled in different ways for <= j8 vs j8+.

These three classes will be used by org.eclipse.ecf.remoteservice.AbstractRemoteService to allow for different runtime behavior of callFuture based upon whether the code is being executed j5 <= j7 or j8+.
Comment 2 Scott Lewis CLA 2014-05-09 12:08:13 EDT
Fixed/addressed for ECF 3.8.1