List additionCaches = getAdditionsForURI(contributionLocation);
List retryList = new ArrayList();
Set itemsAdded = new HashSet();
for (Iterator iterator = additionCaches.iterator(); iterator.hasNext();) {
AbstractContributionFactory cache = (AbstractContributionFactory) iterator
.next();
if (!processAdditions(serviceLocatorToUse, restriction, mgr, cache,
itemsAdded)) {
retryList.add(cache);
}
}
// OK, iteratively loop through entries whose URI's could not
// be resolved until we either run out of entries or the list
// doesn't change size (indicating that the remaining entries
// can never be resolved).
boolean done = retryList.size() == 0;
while (!done) {
// Clone the retry list and clear it
List curRetry = new ArrayList(retryList);
int retryCount = retryList.size();
retryList.clear();
// Walk the current list seeing if any entries can now be resolved
for (Iterator iterator = curRetry.iterator(); iterator.hasNext();) {
AbstractContributionFactory cache = (AbstractContributionFactory) iterator
.next();
if (!processAdditions(serviceLocatorToUse, restriction, mgr,
cache, itemsAdded))
retryList.add(cache);
}