/** * Add an excluded component. * @param The component identifier. */ public void addExcludedComponent(IComponentIdentifier cid) { IServiceRegistry reg = getSubregistry(cid); reg.addExcludedComponent(cid); }
/** * Add a new registry. * @param registry The registry. */ public void addSubregistry(IComponentIdentifier cid, IServiceRegistry registry) { if(registries==null) registries = new HashMap<IComponentIdentifier, IServiceRegistry>(); if(registries.containsKey(cid)) throw new RuntimeException("Registry already contained: "+cid); registries.put(cid, registry); registryAdded(registry); }
/** * Search for services. */ public <T> T searchService(ClassInfo type, IComponentIdentifier cid, String scope) { return searchService(type, cid, scope, false); }
/** * Get a subregistry. * @param cid The platform id. * @return The registry. */ public IServiceRegistry getSubregistry(IComponentIdentifier cid) { if(cid!=null) cid = cid.getRoot(); if(registries==null) registries = new HashMap<IComponentIdentifier, IServiceRegistry>(); IServiceRegistry ret = registries.get(cid); if(ret==null) { ret = new ServiceRegistry(); // System.out.println("Created registry for: "+cid); addSubregistry(cid, ret); } return ret; }
removeQuery(query.getQuery());
PlatformConfiguration.putPlatformValue(cid, PlatformConfiguration.DATA_SERVICEREGISTRY, new SynchronizedServiceRegistry(true, new MultiServiceRegistry()));
/** * Remove an excluded component. * @param The component identifier. */ public IFuture<Void> removeExcludedComponent(IComponentIdentifier cid) { IServiceRegistry reg = getSubregistry(cid); return reg.removeExcludedComponent(cid); }
/** * 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); }
/** * 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); }
/** * Remove a service from the registry. * @param sid The service id. */ public void removeService(ClassInfo key, IService service) { IServiceRegistry reg = getSubregistry(service.getServiceIdentifier().getProviderId()); reg.removeService(key, service); }