/** * Get a list of configured instances of the given class specified by the given configuration key. The configuration * may specify either null or an empty string to indicate no configured instances. In both cases, this method * returns an empty list to indicate no configured instances. * @param key The configuration key for the class * @param t The interface the class should implement * @return The list of configured instances */ public <T> List<T> getConfiguredInstances(String key, Class<T> t) { return getConfiguredInstances(key, t, Collections.emptyMap()); }
/** * Get a list of configured instances of the given class specified by the given configuration key. The configuration * may specify either null or an empty string to indicate no configured instances. In both cases, this method * returns an empty list to indicate no configured instances. * @param key The configuration key for the class * @param t The interface the class should implement * @param configOverrides Configuration overrides to use. * @return The list of configured instances */ public <T> List<T> getConfiguredInstances(String key, Class<T> t, Map<String, Object> configOverrides) { return getConfiguredInstances(getList(key), t, configOverrides); }
@Override public <T> List<T> getConfiguredInstances(String key, Class<T> t, Map<String, Object> configOverrides) { List<T> objects = super.getConfiguredInstances(key, t, configOverrides); Map<String, Object> configPairs = originals(); configPairs.putAll(configOverrides); for (T o : objects) { if (o instanceof CruiseControlConfigurable) { ((CruiseControlConfigurable) o).configure(configPairs); } } return objects; }
@Override public <T> List<T> getConfiguredInstances(String key, Class<T> t) { List<T> objects = super.getConfiguredInstances(key, t); for (T o : objects) { if (o instanceof CruiseControlConfigurable) { ((CruiseControlConfigurable) o).configure(originals()); } } return objects; }