}
// For each, spawn a thread and kick off the loader for each of the
// factory. We catch exceptions just in case.
for (AvatarFactorySPI factory : factorySet) {
final AvatarFactorySPI f = factory;
logger.info("Loading avatar from factory " + f.getClass().getName());
new Thread() {
@Override
public void run() {
try {
f.registerAvatars(manager);
} catch (java.lang.Exception excp) {
// Catch any and all exceptions and print a message to the log
logger.log(Level.WARNING, "Exception from avatar factory", excp);
} finally {
// Always remove the class from the set. When this set is empty
// the loading state will be made READY.
loadingComplete((Class<AvatarFactorySPI>) f.getClass());
}
}
}.start();
}
}