/** * Creates an uninitialized {@link ServiceLocator} * */ @Override public ServiceLocator newServiceLocator() throws MultiException { return newServiceLocator(null); }
public ServiceLocator createServiceLocator(ServiceLocator parent, String name, List<PopulatorPostProcessor> postProcessors) throws MultiException { ServiceLocator serviceLocator = newServiceLocator(parent); populateServiceLocator(name, serviceLocator, postProcessors); return serviceLocator; }
/** * Extensibility point for subclasses to create a different instance * of {@link ModuleDefinition}. * * @param jar * The module jar file for which {@link ModuleDefinition} will be created. * Never null. */ protected ModuleDefinition newModuleDefinition(File jar, Attributes attr) throws IOException { return new DefaultModuleDefinition(jar, attr); }
public Iterator<Class<? extends T>> iterator() { return new FlattenIterator<Class<? extends T>>(new AdapterIterator<Iterator<Class<? extends T>>,Module>(getModules().iterator()) { protected Iterator<Class<? extends T>> adapt(Module module) { return module.getProvidersClass(serviceClass).iterator(); } }); } };
/** * Registers a new DefaultModuleDefinition in this registry. Using this module * definition, the registry will be capable of created shared and private * <code>Module</code> instances. */ public synchronized Module add(ModuleDefinition info) throws ResolveError { return add(info, true); }
public ModuleId createModuleId(String name, String version) { // In HK2, we don't yet use version to compare modules. return new ModuleId(name); }
public boolean hasNext() { fetch(); return next!=null; }
/** * Returns the <code>Module</code> instance giving a name and version * constraints. * * @param name the module name * @param version the module version. * @return the module instance or null if none can be found * @throws ResolveError if the module dependencies cannot be resolved */ public Module makeModuleFor(String name, String version) throws ResolveError { return makeModuleFor(name, version, true); }
@Override public void initialize() throws IOException { super.initialize(); }
public ServiceLocator createServiceLocator(ServiceLocator parent, String name, List<PopulatorPostProcessor> postProcessors) throws MultiException { ServiceLocator serviceLocator = newServiceLocator(parent); populateServiceLocator(name, serviceLocator, postProcessors); return serviceLocator; }
public Iterator<Class<? extends T>> iterator() { return new FlattenIterator<Class<? extends T>>(new AdapterIterator<Iterator<Class<? extends T>>,Module>(getModules().iterator()) { protected Iterator<Class<? extends T>> adapt(Module module) { return module.getProvidersClass(serviceClass).iterator(); } }); } };
@Override protected synchronized void add(Module newModule) { // It is overridden to make it synchronized as it is called from // BundleListener. super.add(newModule); // don't set cacheInvalidated = true here, as this method is called while iterating initial // set of bundles when this module is started. Instead, we invalidate the cache makeModuleDef(). }
@Override public ModuleId createModuleId(String name, String version) { return new ModuleId(name); }
public T next() { fetch(); T r = next; next=null; return r; }
/** * Creates an uninitialized {@link ServiceLocator} * */ @Override public ServiceLocator newServiceLocator() throws MultiException { return newServiceLocator(null); }
/** * Extensibility point for subclasses to create a different instance * of {@link ModuleDefinition}. * * @param jar * The module jar file for which {@link ModuleDefinition} will be created. * Never null. */ protected ModuleDefinition newModuleDefinition(File jar, Attributes attr) throws IOException { return new DefaultModuleDefinition(jar, attr); }
/** * Returns the <code>Module</code> instance giving a name and version * constraints. * * @param name the module name * @param version the module version. * @return the module instance or null if none can be found * @throws ResolveError if the module dependencies cannot be resolved */ public Module makeModuleFor(String name, String version) throws ResolveError { return makeModuleFor(name, version, true); }
/** * Registers a new DefaultModuleDefinition in this registry. Using this module * definition, the registry will be capable of created shared and private * <code>Module</code> instances. */ public synchronized Module add(ModuleDefinition info) throws ResolveError { return add(info, true); }
public T next() { fetch(); T r = next; next=null; return r; }