/** * Creates a {@code ServiceRegistry} instance with a set of categories * taken from the {@code pCategories} argument. * <p/> * The categories are constant during the lifetime of the registry, and may * not be changed after initial creation. * * @param pCategories an {@code Iterator} containing * {@code Class} objects that defines this registry's categories. * @throws IllegalArgumentException if {@code pCategories} is {@code null}. * @throws ClassCastException if {@code pCategories} contains anything * but {@code Class} objects. */ public ServiceRegistry(final Iterator<? extends Class<?>> pCategories) { Validate.notNull(pCategories, "categories"); Map<Class<?>, CategoryRegistry> map = new LinkedHashMap<Class<?>, CategoryRegistry>(); while (pCategories.hasNext()) { putCategory(map, pCategories.next()); } // NOTE: Categories are constant for the lifetime of a registry categoryMap = Collections.unmodifiableMap(map); }
/** * Creates a {@code ServiceRegistry} instance with a set of categories * taken from the {@code pCategories} argument. * <p/> * The categories are constant during the lifetime of the registry, and may * not be changed after initial creation. * * @param pCategories an {@code Iterator} containing * {@code Class} objects that defines this registry's categories. * @throws IllegalArgumentException if {@code pCategories} is {@code null}. * @throws ClassCastException if {@code pCategories} contains anything * but {@code Class} objects. */ public ServiceRegistry(final Iterator<? extends Class<?>> pCategories) { Validate.notNull(pCategories, "categories"); Map<Class<?>, CategoryRegistry> map = new LinkedHashMap<Class<?>, CategoryRegistry>(); while (pCategories.hasNext()) { putCategory(map, pCategories.next()); } // NOTE: Categories are constant for the lifetime of a registry mCategoryMap = Collections.unmodifiableMap(map); }
/** * Creates a {@code ServiceRegistry} instance with a set of categories * taken from the {@code pCategories} argument. * <p/> * The categories are constant during the lifetime of the registry, and may * not be changed after initial creation. * * @param pCategories an {@code Iterator} containing * {@code Class} objects that defines this registry's categories. * @throws IllegalArgumentException if {@code pCategories} is {@code null}. * @throws ClassCastException if {@code pCategories} contains anything * but {@code Class} objects. */ public ServiceRegistry(final Iterator<? extends Class<?>> pCategories) { Validate.notNull(pCategories, "categories"); Map<Class<?>, CategoryRegistry> map = new LinkedHashMap<Class<?>, CategoryRegistry>(); while (pCategories.hasNext()) { putCategory(map, pCategories.next()); } // NOTE: Categories are constant for the lifetime of a registry categoryMap = Collections.unmodifiableMap(map); }
/** * Creates a {@code ServiceRegistry} instance with a set of categories * taken from the {@code pCategories} argument. * <p/> * The categories are constant during the lifetime of the registry, and may * not be changed after initial creation. * * @param pCategories an {@code Iterator} containing * {@code Class} objects that defines this registry's categories. * @throws IllegalArgumentException if {@code pCategories} is {@code null}. * @throws ClassCastException if {@code pCategories} contains anything * but {@code Class} objects. */ public ServiceRegistry(final Iterator<? extends Class<?>> pCategories) { Validate.notNull(pCategories, "categories"); Map<Class<?>, CategoryRegistry> map = new LinkedHashMap<Class<?>, CategoryRegistry>(); while (pCategories.hasNext()) { putCategory(map, pCategories.next()); } // NOTE: Categories are constant for the lifetime of a registry categoryMap = Collections.unmodifiableMap(map); }