/** * Add a service query to the registry. * @param type The service type. * @param scope The scope. * @param filter The filter. */ public static <T> ISubscriptionIntermediateFuture<T> addQuery(final IComponentIdentifier cid, Class<T> type, String scope, IAsyncFilter<T> filter) { ServiceQuery<T> query = new ServiceQuery<T>(type, scope, filter, cid); return SynchronizedServiceRegistry.getRegistry(cid).addQuery(query); } }
/** * Remove an excluded component. * @param The component identifier. */ public IFuture<Void> removeExcludedComponent(IComponentIdentifier cid) { IServiceRegistry reg = getSubregistry(cid); return reg.removeExcludedComponent(cid); }
/** * Add an excluded component. * @param The component identifier. */ public void addExcludedComponent(IComponentIdentifier cid) { IServiceRegistry reg = getSubregistry(cid); reg.addExcludedComponent(cid); }
/** * Get one service of a type. // * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> IFuture<T> getService(IInternalAccess component, Class<T> type, boolean proxy) { return getService(component, type, null, proxy); }
/** * Get all services of a type. // * (Returns required service proxy). * @param type The class. * @return The corresponding services. */ public static <T> ITerminableIntermediateFuture<T> getServices(IInternalAccess component, Class<T> type, String scope, boolean proxy) { return getServices(component, type, scope, (IAsyncFilter<T>)null, proxy); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final ClassInfo type, final String scope) { return getLocalService(component, type, scope, null, true); }
/** * Get the fitting search manager. * @param multiple The multiple flag (i.e. one vs. multiple services required) */ public static ISearchManager getSearchManager(boolean multiple) { return getSearchManager(multiple, null); }
public void exceptionOccurred(Exception exception) { removeOpenCall(ret, future); // System.out.println("nothing found: "+provider.getId()); // do not terminate serach when one node fails // what to do with exception? resultAvailable(null); // ret.setException(exception); } });
/** * Test if a service is included. * @param ser The service. * @return True if is included. */ public boolean isIncluded(IComponentIdentifier cid, IService ser) { IServiceRegistry reg = getSubregistry(cid); return reg.isIncluded(cid, ser); }
/** * Get the copy info for method parameters. */ public static boolean[] getRemoteReferenceInfo(Method method, boolean refdef) { return getReferenceInfo(method, refdef, false); }
public void resultAvailable(Collection<T> result) { for(T t: result) { intermediateResultAvailable(t); } finished(); }
/** * Search for services. */ public <T> T searchService(ClassInfo type, IComponentIdentifier cid, String scope) { return searchService(type, cid, scope, false); }
/** * Get services per type. * @param type The interface type. If type is null all services are returned. * @return First matching service or null. */ // read protected Iterator<IService> getServices(ClassInfo type) { return provider.getServices(type); }
/** * Get queries per type. * @param type The interface type. If type is null all services are returned. * @return The queries. */ // read protected <T> Set<ServiceQueryInfo<T>> getQueries(ClassInfo type) { return provider.getQueries(type); }
/** * Get one service of a type. // * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> IFuture<T> getService(IInternalAccess component, ClassInfo type, String scope) { return getService(component, type, scope, (IAsyncFilter<T>)null, true); }
/** * Get all services of a type. * @param type The class. * @return The corresponding services. */ public static <T> ITerminableIntermediateFuture<T> getServices(IExternalAccess provider, Class<T> type) { return getServices(provider, type, null); }
/** * Get one service of a type. * (Returns required service proxy). * @param component The internal access. * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final ClassInfo type, final String scope, final IFilter<T> filter) { return getLocalService(component, type, scope, filter, true); }
/** * Search for service. */ public <T> T searchService(ClassInfo type, IComponentIdentifier cid, String scope, IFilter<T> filter) { return searchfunc.searchService(type, cid, scope, filter); }
/** * Get all services of a type. * @param type The class. * @return The corresponding services. */ public static <T> ITerminableIntermediateFuture<T> getServices(IInternalAccess component, ClassInfo type) { return getServices(component, type, null, true); }
/** * Get all services of a type. * @param type The class. * @return The corresponding services. */ public static <T> ITerminableIntermediateFuture<T> getServices(IInternalAccess component, ClassInfo type, String scope, IAsyncFilter<T> filter) { return getServices(component, type, scope, filter, true); }