List<URLNormalizer> normalizers = new Vector<URLNormalizer>(extensions.size());
Iterator<Extension> it = extensions.iterator();
while (it.hasNext()) {
Extension ext = it.next();
URLNormalizer normalizer = null;
try {
// check to see if we've cached this URLNormalizer instance yet
normalizer = (URLNormalizer) objectCache.getObject(ext.getId());
if (normalizer == null) {
// go ahead and instantiate it and then cache it
normalizer = (URLNormalizer) ext.getExtensionInstance();
objectCache.setObject(ext.getId(), normalizer);
}
normalizers.add(normalizer);
} catch (PluginRuntimeException e) {
e.printStackTrace();
LOG.warn("URLNormalizers:PluginRuntimeException when "
+ "initializing url normalizer plugin "
+ ext.getDescriptor().getPluginId()
+ " instance in getURLNormalizers "
+ "function: attempting to continue instantiating plugins");
}
}
return normalizers.toArray(new URLNormalizer[normalizers