public IFuture<Void> execute(Void args) { delegate.addEventListener(listener); return IFuture.DONE; }
public Object execute(Void args) { Map<ClassInfo, Set<IService>> ret = delegate.getServiceMap(); return ret; } }, "getServiceMap");
public Object execute(Void args) { IServiceRegistry ret = delegate.getSubregistry(cid); return ret; } }, "getSubregistry");
reg.getSubregistry(component.getComponentIdentifier()).removeEventListener(this);
IServiceRegistry reg = getRegistry().getSubregistry(component.getComponentIdentifier()); if(reg==null) throw new IllegalArgumentException("Registry synchronization requires multi service registy to store results"); reg.addEventListener(this);
IServiceRegistry subreg = reg.getSubregistry(component.getComponentIdentifier()); if(subreg!=null) RegistryEvent event = new RegistryEvent(subreg.getServiceMap(), null, eventslimit, timelimit); ret.addIntermediateResult(event);
/** * Remove an existing registry. * @param cid The component id to remove. */ public void removeSubregistry(IComponentIdentifier cid) { if(registries==null || !registries.containsKey(cid)) throw new RuntimeException("Registry not contained: "+cid); // Remove all services to trigger removed events IServiceRegistry reg = registries.get(cid); Map<ClassInfo, Set<IService>> sers = reg.getServiceMap(); if(sers!=null) { for(Map.Entry<ClassInfo, Set<IService>> entry: sers.entrySet()) { for(IService ser: entry.getValue()) { reg.removeService(entry.getKey(), ser); } } } registries.remove(cid); }
public IFuture<Void> execute(Void args) { delegate.removeSubregistry(cid); return IFuture.DONE; }
public IFuture<Void> execute(Void args) { delegate.removeEventListener(listener); return IFuture.DONE; }
/** * Called when a new registry was added. */ protected void registryAdded(IServiceRegistry registry) { // Add existing queries on the new registry if(queries!=null && registries!=null) { for(Set<ServiceQueryInfo<?>> queries: queries.values().toArray(new Set[queries.size()])) { for(ServiceQueryInfo<?> query: queries) { registry.addQuery(query.getQuery()).addIntermediateResultListener( new UnlimitedIntermediateDelegationResultListener(query.getFuture())); } } } }
/** * Get the services per type. * Internally used -> always safe * @param type The type. * @return Iterator with services. */ public Iterator<IService> getServices(ClassInfo type) { return delegate.getServices(type); }
public IFuture<Void> execute(Void args) // public Object execute(Void args) { delegate.addExcludedComponent(cid); // return null; return IFuture.DONE; }
public IFuture<Void> execute(Void args) { return delegate.addService(key, service); }
public Object execute(Void args) { Set<ServiceQueryInfo<T>> ret = delegate.getQueries(type); return ret; } }, "getQueries");
public void execute(SubscriptionInfo entry) { System.out.println("Remove subscription of: "+entry.getPlatformId()); getRegistry().removeSubregistry(entry.getPlatformId()); } }, new AgentDelayRunner(component), false, null);
ISubscriptionIntermediateFuture<T> fut = reg.addQuery(query); fut.addIntermediateResultListener(new UnlimitedIntermediateDelegationResultListener<T>(ret));
/** * Get services per type. * @param type The interface type. If type is null all services are returned. * @return First matching service or null. */ public Iterator<IService> getServices(ClassInfo type) { MultiIterator<IService> ret = new MultiIterator<IService>(); // if(type.getTypeName().indexOf("Fact")!=-1) // System.out.println("hhhhhhhhhhhhheere"); if(registries!=null) { for(Map.Entry<IComponentIdentifier, IServiceRegistry> entry: registries.entrySet()) { IServiceRegistry reg = entry.getValue(); Iterator<IService> it = reg.getServices(type); if(it!=null) ret.addIterator(it); } } return ret; }
/** * Add an excluded component. * @param The component identifier. */ public void addExcludedComponent(IComponentIdentifier cid) { IServiceRegistry reg = getSubregistry(cid); reg.addExcludedComponent(cid); }
/** * Add a service to the registry. * @param sid The service id. */ public IFuture<Void> addService(ClassInfo key, IService service) { IServiceRegistry reg = getSubregistry(service.getServiceIdentifier().getProviderId()); return reg.addService(key, service); }
public IFuture<Void> execute(Void args) { ISubscriptionIntermediateFuture<T> fut = delegate.addQuery(query); fut.addIntermediateResultListener(new IntermediateDelegationResultListener<T>(ret)); final Future<Void> myret = new Future<Void>(); fut.addIntermediateResultListener(new IIntermediateResultListener<T>() { public void finished() { myret.setResult(null); } public void exceptionOccurred(Exception exception) { myret.setException(exception); } public void intermediateResultAvailable(T result) { } public void resultAvailable(Collection<T> result) { finished(); } }); return myret; }