diff options
| author | slewis | 2014-04-02 03:18:12 +0000 |
|---|---|---|
| committer | slewis | 2014-04-02 03:18:12 +0000 |
| commit | 599e7ed4d21b7a586f565bff3ae545deda2f8fc8 (patch) | |
| tree | 76fcc573570a25fa26ab54c79d76cc95ccc74757 | |
| parent | 8caf8c2de33df197a3416b48c7bb04efa71aa018 (diff) | |
| download | org.eclipse.ecf-599e7ed4d21b7a586f565bff3ae545deda2f8fc8.tar.gz org.eclipse.ecf-599e7ed4d21b7a586f565bff3ae545deda2f8fc8.tar.xz org.eclipse.ecf-599e7ed4d21b7a586f565bff3ae545deda2f8fc8.zip | |
Added o.e.e.remoteservice.asyncproxy and
o.e.e.remoteservice.asyncproxy.j8 projects. Both contain new bundles
with bundle id: o.e.e.remoteservice.asyncproxy...with versions 1.0.0
(pre-j8) and 2.0.0 (j8+). These will be used for resolving bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431756
Change-Id: Ief2d128229592fbad1c79fe462bdb376b7ec780a
24 files changed, 348 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.classpath b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.classpath new file mode 100644 index 000000000..eca7bdba8 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.gitignore b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.gitignore new file mode 100644 index 000000000..5e56e040e --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.project b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.project new file mode 100644 index 000000000..3559d273d --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ecf.remoteservice.asyncproxy.j8</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.jdt.core.prefs b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0c68a61dc --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.pde.core.prefs b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 000000000..f29e940a0 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/META-INF/MANIFEST.MF new file mode 100644 index 000000000..81c2e5676 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %bundle.name +Bundle-SymbolicName: org.eclipse.ecf.remoteservice.asyncproxy +Bundle-Version: 2.0.0.qualifier +Bundle-Vendor: %bundle.provider +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.equinox.concurrent.future +Bundle-Localization: bundle +Export-Package: org.eclipse.ecf.remoteservice.asyncproxy;version="2.0.0" diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/about.html b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/about.html new file mode 100644 index 000000000..4c79781a5 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 25, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/build.properties b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/build.properties new file mode 100644 index 000000000..d692a27b5 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + bundle.properties +src.includes = about.html diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/bundle.properties b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/bundle.properties new file mode 100644 index 000000000..ffb412962 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/bundle.properties @@ -0,0 +1,10 @@ +############################################################################ +# Copyright (c) 2014 Composent Inc., IBM Corp, and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +############################################################################ +bundle.provider=Eclipse.org - ECF +bundle.name=ECF RemoteServices AsyncProxy API diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java new file mode 100644 index 000000000..d6d7d9ddd --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java @@ -0,0 +1,14 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +public abstract class AbstractAsyncProxyRemoteCall { +} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java new file mode 100644 index 000000000..c3c96a3d2 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java @@ -0,0 +1,50 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Future; + +import org.eclipse.equinox.concurrent.future.IFuture; + +public abstract class AbstractAsyncProxyRemoteService { + + @SuppressWarnings("rawtypes") + protected abstract IFuture callAsync(AbstractAsyncProxyRemoteCall call); + + @SuppressWarnings("rawtypes") + protected abstract Future callFutureAsync(AbstractAsyncProxyRemoteCall call); + + protected abstract void callCompletableAsync(AbstractAsyncProxyRemoteCall call, IAsyncProxyCompletable completable); + + @SuppressWarnings("unchecked") + protected Object callFuture(AbstractAsyncProxyRemoteCall call, @SuppressWarnings("rawtypes") Class returnType) { + // If the result value is a CompletableFuture then + // we callCompletableAsync + if (CompletableFuture.class.isAssignableFrom(returnType)) { + @SuppressWarnings("rawtypes") + CompletableFuture result = new CompletableFuture(); + callCompletableAsync(call, (r,hadException,exception) -> { + if (hadException) result.completeExceptionally(exception); + else result.complete(r); + }); + // And return the CompletableFuture + return result; + } + // Else if it's an IFuture then return + // IFuture result of callAsync + if (IFuture.class.isAssignableFrom(returnType)) + return callAsync(call); + // Else it must be a Future return value + return callFutureAsync(call); + } + +} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java new file mode 100644 index 000000000..26a11a82e --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy.j8/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java @@ -0,0 +1,15 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +public interface IAsyncProxyCompletable { + void handleComplete(Object result, boolean hadException, Throwable exception); +} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.classpath b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.classpath new file mode 100644 index 000000000..64c5e31b7 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.gitignore b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.gitignore new file mode 100644 index 000000000..5e56e040e --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.project b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.project new file mode 100644 index 000000000..d85f9b4a7 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ecf.remoteservice.asyncproxy</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.jdt.core.prefs b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..af0f20f97 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.pde.core.prefs b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 000000000..f29e940a0 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/META-INF/MANIFEST.MF new file mode 100644 index 000000000..87186caf1 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %bundle.name +Bundle-SymbolicName: org.eclipse.ecf.remoteservice.asyncproxy +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: %bundle.provider +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.equinox.concurrent.future +Bundle-Localization: bundle +Export-Package: org.eclipse.ecf.remoteservice.asyncproxy;version="1.0.0" diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/about.html b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/about.html new file mode 100644 index 000000000..4c79781a5 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 25, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/build.properties b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/build.properties new file mode 100644 index 000000000..b9ec38b9f --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + bundle.properties,\ + about.html +src.includes = bundle.properties,\ + about.html diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/bundle.properties b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/bundle.properties new file mode 100644 index 000000000..ffb412962 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/bundle.properties @@ -0,0 +1,10 @@ +############################################################################ +# Copyright (c) 2014 Composent Inc., IBM Corp, and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +############################################################################ +bundle.provider=Eclipse.org - ECF +bundle.name=ECF RemoteServices AsyncProxy API diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java new file mode 100644 index 000000000..d6d7d9ddd --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteCall.java @@ -0,0 +1,14 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +public abstract class AbstractAsyncProxyRemoteCall { +} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java new file mode 100644 index 000000000..7e53b6f75 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/AbstractAsyncProxyRemoteService.java @@ -0,0 +1,35 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +import java.util.concurrent.Future; + +import org.eclipse.equinox.concurrent.future.IFuture; + +public abstract class AbstractAsyncProxyRemoteService { + + @SuppressWarnings("rawtypes") + protected abstract IFuture callAsync(AbstractAsyncProxyRemoteCall call); + + @SuppressWarnings("rawtypes") + protected abstract Future callFutureAsync(AbstractAsyncProxyRemoteCall call); + + protected abstract void callCompletableAsync(AbstractAsyncProxyRemoteCall call, IAsyncProxyCompletable completable); + + protected Object callFuture(AbstractAsyncProxyRemoteCall call, @SuppressWarnings("rawtypes") Class returnType) { + // Iff it's an IFuture then return + // IFuture result of callAsync + if (IFuture.class.isAssignableFrom(returnType)) + return callAsync(call); + return callFutureAsync(call); + } + +} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java new file mode 100644 index 000000000..26a11a82e --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.remoteservice.asyncproxy/src/org/eclipse/ecf/remoteservice/asyncproxy/IAsyncProxyCompletable.java @@ -0,0 +1,15 @@ +/**************************************************************************** + * Copyright (c) 2014 Composent, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Composent, Inc. - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.remoteservice.asyncproxy; + +public interface IAsyncProxyCompletable { + void handleComplete(Object result, boolean hadException, Throwable exception); +} |
