// classes, then initialize each one
Iterator<ClientPlugin> it = loader.getAll(Plugin.class,
ClientPlugin.class);
while (it.hasNext()) {
ClientPlugin plugin = it.next();
String message = BUNDLE.getString("Initialize plugin");
message = MessageFormat.format(
message, plugin.getClass().getSimpleName());
fireConnecting(message);
// check with the filter to see if we should load this plugin
if (LoginManager.getPluginFilter().shouldInitialize(this, plugin)) {
try {
plugin.initialize(this);
plugins.add(plugin);
} catch(Exception e) {
logger.log(Level.WARNING, "Error initializing plugin " +
plugin.getClass().getName(), e);
} catch(Error e) {
logger.log(Level.WARNING, "Error initializing plugin " +
plugin.getClass().getName(), e);
}
}
}
}