* @param pluginId The plugin identity, this is the value from {@link org.socialmusicdiscovery.server.api.plugin.Plugin#getId()}
* @throws PluginException If the plugin or one of its dependent plugins fails to start
*/
public void startPlugin(String pluginId) throws PluginException {
if (!runningPlugins.containsKey(pluginId)) {
Plugin plugin = plugins.get(pluginId);
if (plugin != null) {
List<String> dependencies = plugin.getDependencies();
for (String dependency : dependencies) {
if (!runningPlugins.containsKey(dependency)) {
startPlugin(dependency);
}
}
System.out.println("Starting " + pluginId + ": " + plugin.getClass().getName());
System.out.flush();
if (plugin.start()) {
runningPlugins.put(pluginId, plugin);
}
System.out.println("Started " + pluginId + ": OK");
}
}