Skip to content
/ ecf Public
forked from eclipse-ecf/ecf
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Export-Package: org.eclipse.ecf.discovery;version="4.1.0",
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.ecf;bundle-version="[3.4.0,4.0.0)"
Import-Package: org.eclipse.core.runtime.jobs,
org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)",
org.eclipse.ecf.core.jobs;version="[1.1.0,2.0.0)",
org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.osgi.util.tracker;version="[1.3.2,2.0.0)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.discovery.identity.IServiceTypeID;
import org.eclipse.ecf.internal.discovery.*;
import org.eclipse.equinox.concurrent.future.*;
import org.eclipse.ecf.core.jobs.*;

public abstract class AbstractDiscoveryContainerAdapter extends AbstractContainer
implements IDiscoveryLocator, IDiscoveryAdvertiser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.discovery.identity.IServiceTypeID;
import org.eclipse.equinox.concurrent.future.IFuture;

/**
* Entry point discovery locator. This interface exposes the ability to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ Export-Package: org.eclipse.ecf.internal.remoteservice;x-internal:=true,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.ecf;bundle-version="[3.9.0,4.0.0)"
Import-Package: org.eclipse.ecf.core.util.reflection;version="[2.2.100,3.0.0)",
Import-Package: org.eclipse.ecf.core.jobs;version="[1.1.0,2.0.0)",
org.eclipse.ecf.core.util.reflection;version="[2.2.100,3.0.0)",
org.eclipse.ecf.remoteservice.asyncproxy;version="[1.0.0,3.0.0)",
org.eclipse.equinox.concurrent.future;version="[1.1.0,2.0.0)",
org.eclipse.equinox.concurrent.future;version="[1.1.0,2.0.0)";resolution:=optional,
org.osgi.framework;version="[1.3.0,2.0.0)",
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.osgi.util.tracker;version="[1.3.2,2.0.0)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
import java.util.concurrent.*;
import java.util.concurrent.TimeoutException;
import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.jobs.JobsExecutor;
import org.eclipse.ecf.core.jobs.*;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.internal.remoteservice.Activator;
import org.eclipse.ecf.remoteservice.asyncproxy.*;
import org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent;
import org.eclipse.ecf.remoteservice.events.IRemoteCallEvent;
import org.eclipse.ecf.remoteservice.util.AsyncUtil;
import org.eclipse.equinox.concurrent.future.*;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceException;
import org.osgi.util.tracker.ServiceTracker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public interface Constants {
* <pre>
* package foo;
* import org.eclipse.ecf.remoteservice.IAsyncRemoteServiceProxy;
* import org.eclipse.equinox.concurrent.future.IFuture;
* import org.eclipse.ecf.core.jobs.IFuture;
*
* public interface BarAsync extends IAsyncRemoteServiceProxy {
* IFuture doStuffAsync();
Expand All @@ -145,7 +145,7 @@ public interface Constants {
* <pre>
* package gogo;
* import org.eclipse.ecf.remoteservice.IAsyncRemoteServiceProxy;
* import org.eclipse.equinox.concurrent.future.IFuture;
* import org.eclipse.ecf.core.jobs.IFuture;
*
* public interface MyBar extends IAsyncRemoteServiceProxy {
* IFuture doStuffAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

package org.eclipse.ecf.remoteservice;

import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.equinox.concurrent.future.IFuture;

/**
* Interface providing runtime access to a remote service. An instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import org.eclipse.ecf.core.ContainerConnectException;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.equinox.concurrent.future.IFuture;
import org.osgi.framework.*;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.eclipse.ecf.core.ContainerConnectException;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.equinox.concurrent.future.IFuture;
import org.osgi.framework.*;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import java.util.Dictionary;
import java.util.Map;
import org.eclipse.equinox.concurrent.future.IExecutor;
import org.eclipse.ecf.core.jobs.IExecutor;

/**
* A container adapter intended for use by remote service host containers. Implements IRemoteServiceContainerAdapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import org.eclipse.ecf.core.identity.*;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.core.jobs.*;
import org.eclipse.ecf.internal.remoteservice.Activator;
import org.eclipse.ecf.remoteservice.events.*;
import org.eclipse.ecf.remoteservice.util.RemoteFilterImpl;
import org.eclipse.equinox.concurrent.future.*;
import org.osgi.framework.InvalidSyntaxException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package org.eclipse.ecf.remoteservice;

import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.equinox.concurrent.future.IFuture;

/**
* Helper class for making it easier to call a remote service with method name and optional parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
import org.eclipse.ecf.core.events.*;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.jobs.JobsExecutor;
import org.eclipse.ecf.core.jobs.*;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.ecf.internal.remoteservice.Activator;
import org.eclipse.ecf.remoteservice.*;
import org.eclipse.ecf.remoteservice.client.AbstractClientService.UriRequest;
import org.eclipse.ecf.remoteservice.events.IRemoteServiceEvent;
import org.eclipse.ecf.remoteservice.events.IRemoteServiceRegisteredEvent;
import org.eclipse.ecf.remoteservice.util.RemoteFilterImpl;
import org.eclipse.equinox.concurrent.future.*;
import org.osgi.framework.InvalidSyntaxException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ecf.core.jobs.*;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.remoteservice.*;
import org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent;
import org.eclipse.ecf.remoteservice.events.IRemoteCallStartEvent;
import org.eclipse.equinox.concurrent.future.*;

/**
* Remote service client service. Implements {@link IRemoteService}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.eclipse.ecf.remoteservice.events;

import org.eclipse.ecf.core.identity.ID;
import org.eclipse.equinox.concurrent.future.IFuture;
import org.eclipse.ecf.core.jobs.IFuture;

/**
* @since 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Bundle-ManifestVersion: 2
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.equinox.registry;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.ecf;bundle-version="[3.4.0,4.0.0)"
Import-Package: org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)",
Import-Package: org.eclipse.ecf.core.jobs;version="[1.1.0,2.0.0)",
org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.service.log;version="[1.0.0,2.0.0)",
org.osgi.util.tracker;version="[1.3.2,2.0.0)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*****************************************************************************/
package org.eclipse.ecf.core.sharedobject.events;

import org.eclipse.equinox.concurrent.future.IFuture;
import org.eclipse.ecf.core.jobs.IFuture;

public interface ISharedObjectCallEvent extends ISharedObjectEvent {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package org.eclipse.ecf.core.sharedobject.events;

import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.jobs.IFuture;
import org.eclipse.ecf.core.util.Event;
import org.eclipse.equinox.concurrent.future.IFuture;

public class SharedObjectCallEvent implements ISharedObjectCallEvent {
ID sender;
Expand Down
2 changes: 1 addition & 1 deletion framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Export-Package: org.eclipse.ecf.core;version="3.0.0",
org.eclipse.ecf.core.util.reflection;version="2.3.0",
org.eclipse.ecf.internal.core;x-internal:=true
Import-Package: org.eclipse.core.runtime.jobs,
org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)",
org.eclipse.equinox.concurrent.future;version="[1.0.0,2.0.0)";resolution:=optional,
org.osgi.framework;version="[1.3.0,2.0.0)",
org.osgi.service.log;version="[1.3.0,2.0.0)",
org.osgi.util.tracker;version="[1.3.2,2.0.0)"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/****************************************************************************
* Copyright (c) 2024 Composent, Inc. and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* Composent, Inc. - initial API and implementation
*
* SPDX-License-Identifier: EPL-2.0
*****************************************************************************/
package org.eclipse.ecf.core.jobs;

import org.eclipse.core.runtime.IProgressMonitor;

/**
* Abstract base class for IExecutor implementations.
* This class is a replacement for org.eclipse.equinox.concurrent.future.AbstractExecutor
* to eliminate the dependency on org.eclipse.equinox.concurrent.
*
* @since 3.13
*/
public abstract class AbstractExecutor implements IExecutor {

/**
* Execute the given runnable asynchronously.
* Subclasses must implement this method to define the execution strategy.
*
* @param runnable the runnable to execute
* @param clientProgressMonitor optional progress monitor
* @return IFuture representing the asynchronous execution
*/
public abstract IFuture execute(IProgressRunnable runnable, IProgressMonitor clientProgressMonitor);

/**
* Create a future for the given progress monitor.
* Subclasses may override this to provide custom future implementations.
*
* @param progressMonitor the progress monitor
* @return AbstractFuture the created future
*/
protected AbstractFuture createFuture(IProgressMonitor progressMonitor) {
return new SingleOperationFuture(progressMonitor);
}

/**
* Set the child progress monitor on the given parent monitor if it supports it.
*
* @param parent the parent monitor
* @param child the child monitor
*/
protected void setChildProgressMonitor(IProgressMonitor parent, IProgressMonitor child) {
if (parent instanceof FutureProgressMonitor) {
((FutureProgressMonitor) parent).setChildProgressMonitor(child);
}
}

/**
* Run the given runnable safely using the given runner.
*
* @param runner the safe progress runner
* @param progressRunnable the runnable to run
*/
protected void safeRun(ISafeProgressRunner runner, IProgressRunnable progressRunnable) {
runner.runWithProgress(progressRunnable);
}
}
Loading