Community
Participate
Working Groups
Currently, remote services lookup is done synchronously by a blocking call IRemoteServicesContainerAdapter.getRemoteServiceReferences(). An asynchronous version of this method (getRemoteServiceReferences()) should be added so that clients can use either blocking or non-blocking retrieval of remote services references.
*** Bug 251897 has been marked as a duplicate of this bug. ***
Here is a possible API using IAsyncResult (future): org.eclipse.ecf.core.util.IAsyncResult; public IAsyncResult asyncGetRemoteServiceReferences(ID[] idFilter, String clazz, String filter) throws InvalidSyntaxException; Here are some possible javadocs for this method: /** * Asynchronously returns an array of <code>IRemoteServiceReference</code> objects. The * returned array of <code>IRemoteServiceReference</code> objects contains * services that were registered under the specified class and match the * specified idFilter, and filter criteria. * <p> * The IAsyncResult is returned immediately, and subsequent calls to {@link IAsyncResult#get()} * or {@link IAsyncResult#get(long)} will return the actual results received. The type of * the Object returned from {@link IAsyncResult#get()} will be IRemoteServiceReference []. * * <p> * The list is valid at the time of the call to this method, however since * the Framework is a very dynamic environment, services can be modified or * unregistered at anytime. * * <p> * <code>idFilter</code> is used to select a registered services that were * registered by a given set of containers with id in idFilter. Only * services exposed by a container with id in idFilter will be returned. * * <p> * If <code>idFilter</code> is <code>null</code>, all containers are * considered to match the filter. * * <p> * <code>filter</code> is used to select the registered service whose * properties objects contain keys and values which satisfy the filter. See * {@link Filter} for a description of the filter string syntax. * * <p> * If <code>filter</code> is <code>null</code>, all registered services * are considered to match the filter. If <code>filter</code> cannot be * parsed, an {@link InvalidSyntaxException} will be thrown with a human * readable message where the filter became unparsable. * * @param idFilter * an array of ID instances that will restrict the search for * matching container ids If null, all remote containers will be * considered in search for matching IRemoteServiceReference * instances. May be <code>null</code>. * * @param clazz * the fully qualified name of the interface class that describes * the desired service. Must not be <code>null</code>. * @param filter * The filter criteria. May be <code>null</code>. * @return IAsyncResult that through subsequent calls to IAsyncResult#get() will return * IRemoteServiceReference [] with IRemoteServiceReferences matching given search criteria. * Will not return <code>null</code>. * * @throws InvalidSyntaxException If filter contains an invalid filter string that cannot be parsed. */
Adding this one to plan
Created attachment 121272 [details] Enhancement to remote service API Added asyncGetRemoteServiceReferences(ID[], String, String) to IRemoteServiceContainerAdapter. Please comment on this bug about the method name, signature, use of IFutureResult, etc.
Also, here's the new method signature and javadocs in the patch: /** * Asynchronously returns an array of <code>IRemoteServiceReference</code> objects. The * returned array of <code>IRemoteServiceReference</code> objects contains * services that were registered under the specified class and match the * specified idFilter, and filter criteria. * <p> * The IFutureStatus is returned immediately, and subsequent calls to {@link IFutureStatus#get()} * or {@link IFutureStatus#get(long)} will return the actual results received. The type of * the Object returned from {@link IFutureStatus#get()} will be IRemoteServiceReference []. * * <p> * The list is valid at the time of the call to this method, however since * the Framework is a very dynamic environment, services can be modified or * unregistered at anytime. * * <p> * <code>idFilter</code> is used to select a registered services that were * registered by a given set of containers with id in idFilter. Only * services exposed by a container with id in idFilter will be returned. * * <p> * If <code>idFilter</code> is <code>null</code>, all containers are * considered to match the filter. * * <p> * <code>filter</code> is used to select the registered service whose * properties objects contain keys and values which satisfy the filter. See * {@link Filter} for a description of the filter string syntax. * * @param idFilter * an array of ID instances that will restrict the search for * matching container ids If null, all remote containers will be * considered in search for matching IRemoteServiceReference * instances. May be <code>null</code>. * * @param clazz * the fully qualified name of the interface class that describes * the desired service. Must not be <code>null</code>. * @param filter * The filter criteria. May be <code>null</code>. * @return IFutureStatus that through subsequent calls to IFutureStatus#get() will return * IRemoteServiceReference [] with IRemoteServiceReferences matching given search criteria. * Will not return <code>null</code>. * * @since 3.0 */ public IFutureStatus asyncGetRemoteServiceReferences(ID[] idFilter, String clazz, String filter); See also docs on IFutureStatus from org.eclipse.ecf plugin (HEAD/ECF 3.0).
Completed some time ago. Resolving as Fixed.