throw new MultiException(th);
}
Collector collector = new Collector();
DynamicConfiguration config = dcs.createDynamicConfiguration();
for (InputStream is : descriptorFileInputStreams) {
BufferedReader br = new BufferedReader(new InputStreamReader(is));
try {
boolean readOne = false;
do {
DescriptorImpl descriptorImpl = new DescriptorImpl();
readOne = descriptorImpl.readObject(br);
if (readOne) {
for (PopulatorPostProcessor pp : postProcessors) {
try {
descriptorImpl = pp.process(serviceLocator, descriptorImpl);
}
catch (Throwable th) {
collector.addThrowable(th);
descriptorImpl = null;
}
if (descriptorImpl == null) {
break;
}
}
if (descriptorImpl != null) {
descriptors.add(config.bind(descriptorImpl, false));
}
}
} while (readOne);
} finally {
br.close();
}
}
// Prior to commit!
collector.throwIfErrors();
config.commit();
return descriptors;
}